Cannot successfully flash .bin file into AT91 SAM7-A2

Started by fabiobarrosoist, July 09, 2014, 06:05:26 PM

Previous topic - Next topic

fabiobarrosoist

Good afternoon everyone.

I've been able to create a .bin file through the modification of an example coded provided in https://www.olimex.com/Products/ARM/Atmel/SAM7-LA2/ (the build was done in Eclipse IDE (Ubuntu)).

When I tried to flash the bin file, though, the board didn't seem to run the program at all.

OpenOCD Terminal results:


Warn : protect: cfi primary command set 2 unsupported
cleared protection for sectors 0 through 18 on flash bank 0
erased sectors 0 through 6 on flash bank 0 in 10.848760s
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
wrote 44624 bytes from file OlimexLA2test.bin in 2.830561s (15.396 KiB/s)
successfully checked erase state
#  0: 0x00000000 (0x4000 16kB) not erased
#  1: 0x00004000 (0x2000 8kB) not erased
#  2: 0x00006000 (0x2000 8kB) not 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



As you can see, the code seems to have been successfully flashed into the device. However, in practical term, the application does nothing (cannot communicate with the board via serial in PuTTY).

Either the code didn't actually compile properly (Eclipse side) or it didn't flash properly (openOCD side).
How can I be sure the code was flashed properly without trying to run it? Is there any preliminar diagnosis I can do? With the messages above shown, can I be sure the flashing worked at all?

Thank you in advance.

Best regards,
Fábio

LubOlimex

Hello Fábio,

Quite likely the problem is in the compilation of the example. The examples provided at the web page were made with IAR EW for ARM 4.42. Unless you modified the example completely they wouldn't work properly with another compiler different than IAR's.

It might be the best idea to start by configuring the Eclipse properly and writing a simple blink example. A good guide for SAM7 Eclipse development is this one: http://www.machinegrid.com/machinepress/wp-content/uploads/media/code/arm_toolchain_tutorial/Using_Open_Source_Tools_for_AT91SAM7S_Cross_Development_revision_C.pdf.

Best regards,
Lib/OLIMEX
Technical support and documentation manager at Olimex