Flashing big files on LPC2212 [solved]

Hi,

I’m using OpenOCD 423 from yagarto.de and a LPC2212 with the JTAGkey-tiny from Amontec.

Everything is working fine, I’m able to debug, flash etc.

I’m trying to flash a pretty big file:

$ arm-elf-size -x -A main.elf
main.elf  :
section              size         addr
.init               0x270          0x0
.code             0x15868        0x270
.data               0x8a4   0x82000000
.bss               0x3da4   0x820008a4
.ARM.attributes      0x10          0x0
.debug_line        0x5ae6          0x0
.debug_info       0x1d0fb          0x0
.debug_abbrev      0x53d9          0x0
.debug_aranges      0x848          0x0
.debug_ranges       0x328          0x0
.debug_frame       0x2568          0x0
.debug_loc         0x86dd          0x0
.debug_pubnames    0x17ce          0x0
.debug_str         0x1a55          0x0
.comment            0x44a          0x0
Total             0x50f0c

But it doesn’t seem to work:

...
Info:    options.c:50 configuration_output_handler(): lpc2000 flash driver variant: 1, clk: 12000
Warning: lpc2000.c:603 lpc2000_write(): lpc2000 returned 9
Error:   flash.c:96 flash_driver_write(): error writing to flash at address 0x00000000 at offset 0x00000000
Warning: arm7_9_common.c:724 arm7_9_poll(): DBGACK set, but the target did not end up in the halted stated 1
Info:    options.c:50 configuration_output_handler(): Timed out waiting for reset
Flash Programming Finished.

I have try to increment the debug level but with no help (for me)

I have flashed the big file previousely converted to hex with LPC2000 flash utility without problem.

If I try to flash a smaller file with openocd, there is no problem.

Thanks for your ideas!

Yann

edit: Ok, my fault. I’m using LPC2212 and LPC2119 and I didn’t figured that They don’t have the same internal flash. One is 128kb an the other is 256kb. I had just to correct the flash configuration on openocd and all is working again!

Have you tried to use a bigger timeout?

Katagia:
Have you tried to use a bigger timeout?

Thanks for the suggestion.

do you mean something like

ft2232_latency 10
```Yes, I tried with no change. (I tried even bigger value)

I have done some more tests:

  • Erase the flash of my board with LPC2000FlashUtility

  • Flash my program with openocd, getting the previous error

  • Dumped the flash content of my board with LPC2000FlashUtility to a file

  • diff of the two files

  • The two files differs mainly begining a the line 4611: which correspond to the adress 0x2000 (ihex format)

    :10200000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
    ``` and continue with the same type of line.
    
    The original ihex file contain normal code.[/list]

    I have done one more test: the flash is successful while the file that I try to flash is smaler or equal to 73728 bytes (0x12000)

    Does someone have an idea about what could be the problem?

    Thanks

    You have to set a bigger timeout in gdb, not in openocd.

    Forum search has returned “set remotetimeout 60”.

    This is working for me also with bigger programs.

    If you use gdb to program using the new vFlash*** interface then you have no issues with timeouts.

    viewtopic.php?t=9215&highlight=vflash

    Cheers

    Spen

    Hi, I have edited my first post, I found the problem.

    For the remote timeout, I don’t have this problem, I’m not flashing from GDB.

    When debugging, I’m using vFlash.

    Thanks

    Yann