AT91SAM7-LA2 flashing problem

AT91SAM9 Evaluation Boards

Moderator: nferre

fabiobarrosoist
Posts: 1
Joined: Wed Jul 09, 2014 3:19 pm

AT91SAM7-LA2 flashing problem

Wed Jul 09, 2014 3:50 pm

Hey everyone!

I've been using an AT91-SAM7-LA2 development board from OLIMEX, and tried to compile a couple of C projects and flash them with openOCD in Linux. The board i'm using has 4MB of RAM and a 1MB flash memory.

I have used a pre-compiled ELF file to flash into the memory. In the openOCD configuration file I have the following configs:

Code: Select all

#standard cfgs provided (...)

#confirm location of flash bank
#address 0x40000000, 1MB size
flash probe 0
flash list
#remove sector protection for memory erasing
flash protect 0 0 18 off
flash erase_sector 0 0 18
flash erase_check 0
#says all banks have been erased, from 0 to 18
flash banks
#confirms flash memory as bank with num = 0
flash write_image OlimexLA2test.elf 0x40000000 elf
0x0
flash erase_check 0
and in the board cfg i have

Code: Select all

 
# standard cfgs provided

#bank name, cfi, base adddr, size, bus width, chip width
flash bank ROM.flash   cfi 0x40000000 0x00100000 2 2 $_TARGETNAME 
(If it is needed for a better understanding of the code I can copy the whole files, but I think the problem resides in the lines of configurations i've placed here)

Anyway, as I said before, the flash has 18 sectors, with sizes:

terminal:

Code: Select all

erased sectors 0 through 6 on flash bank 0 in 11.437886s
successfully checked erase state
 #  0: 0x00000000 (0x4000 16kB) erased
 #  1: 0x00004000 (0x2000 8kB) erased
 #  2: 0x00006000 (0x2000 8kB) erased
 #  3: 0x00008000 (0x8000 32kB) erased
 #  4: 0x00010000 (0x10000 64kB) erased
 #  5: 0x00020000 (0x10000 64kB) erased
 #  6: 0x00030000 (0x10000 64kB) erased
 #  7: 0x00040000 (0x10000 64kB) erased
 #  8: 0x00050000 (0x10000 64kB) erased
 #  9: 0x00060000 (0x10000 64kB) erased
 # 10: 0x00070000 (0x10000 64kB) erased
 # 11: 0x00080000 (0x10000 64kB) erased
 # 12: 0x00090000 (0x10000 64kB) erased
 # 13: 0x000a0000 (0x10000 64kB) erased
 # 14: 0x000b0000 (0x10000 64kB) erased
 # 15: 0x000c0000 (0x10000 64kB) erased
 # 16: 0x000d0000 (0x10000 64kB) erased
 # 17: 0x000e0000 (0x10000 64kB) erased
 # 18: 0x000f0000 (0x10000 64kB) erased
#0 : ROM.flash (cfi) at 0x40000000, size 0x00100000, buswidth 2, chipwidth 2
Info : Padding image section 0 with 32768 bytes
wrote 44624 bytes from file OlimexLA2test.elf in 1.939672s (22.467 KiB/s)
successfully checked erase state
 #  0: 0x00000000 (0x4000 16kB) not erased
 #  1: 0x00004000 (0x2000 8kB) erased
 #  2: 0x00006000 (0x2000 8kB) erased
 #  3: 0x00008000 (0x8000 32kB) not erased
 #  4: 0x00010000 (0x10000 64kB) erased
 #  5: 0x00020000 (0x10000 64kB) erased
 #  6: 0x00030000 (0x10000 64kB) erased
 #  7: 0x00040000 (0x10000 64kB) erased
 #  8: 0x00050000 (0x10000 64kB) erased
 #  9: 0x00060000 (0x10000 64kB) erased
 # 10: 0x00070000 (0x10000 64kB) erased
 # 11: 0x00080000 (0x10000 64kB) erased
 # 12: 0x00090000 (0x10000 64kB) erased
 # 13: 0x000a0000 (0x10000 64kB) erased
 # 14: 0x000b0000 (0x10000 64kB) erased
 # 15: 0x000c0000 (0x10000 64kB) erased
 # 16: 0x000d0000 (0x10000 64kB) erased
 # 17: 0x000e0000 (0x10000 64kB) erased
 # 18: 0x000f0000 (0x10000 64kB) erased
Warn : protect: cfi primary command set 2 unsupported
set protection for sectors 0 through 18 on flash bank 0
shutdown command invoked
tl;dr:

basically, the memory is fully wiped, then I flash the ELF file and it seems to occupy sectors 0 and 3 (the code occupies around 43KB). Is that normal? My code doesn't run on the board everytime sectors are skipped.

I'm sorry if I didn't explain the question well but i'm fairly new to this.

Thank you in advance and best regards,
Fábio.

Return to “Evaluation and Development Boards”

Who is online

Users browsing this forum: No registered users and 1 guest