I tried to flash atsame53j18 with openocd 0.10.0. I used following .cfg file:
# Atmel-ICE JTAG/SWD in-circuit debugger. source [find interface/cmsis-dap.cfg] transport select swd # Chip info set CHIPNAME at91same53j18 source [find target/atsamv.cfg] # this disables Failed to read memory at 0x400e0944 # if program is not following gdb_memory_map disable reset_config srst_only
There is whole command with following output.
openocd -f myopenocd.cfg -c "program build/$(PROJECT).elf verify reset exit" Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html adapter speed: 4000 kHz adapter_nsrst_delay: 100 adapter speed: 1800 kHz cortex_m reset_config sysresetreq Info : flash bank command none separate Info : CMSIS-DAP: SWD Supported Info : CMSIS-DAP: JTAG Supported Info : CMSIS-DAP: Interface Initialised (SWD) Info : CMSIS-DAP: FW Version = 01.27.0082 Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1 Info : CMSIS-DAP: Interface ready Info : clock speed 1800 kHz Info : SWD DPIDR 0x2ba01477 Info : at91same53j18.cpu: hardware has 6 breakpoints, 4 watchpoints target halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0x000002d0 msp: 0x2001b2e8 ** Programming Started ** auto erase enabled Info : SWD DPIDR 0x2ba01477 Error: Failed to read memory at 0x400e0944 Error: auto_probe failed ** Programming Failed ** shutdown command invoked make: *** [upload] Error 1
It is possible to load elf to the board if I do this and then attach arm gdb:
>>openocd -f myopenocd.cfg >>arm-none-eabi-gdb some.elf (gdb) load some.elf (gdb) run
However as soon as flash info is requested it fails:
(gdb) monitor flash list {name atsamv base 4194304 size 0 bus_width 0 chip_width 0} (gdb) monitor flash info 0 SWD DPIDR 0x2ba01477 Failed to read memory at 0x400e0944 auto_probe failed
What might cause this behaviour?
Hello,
On Mon, Jan 28, 2019 at 08:51:32PM -0000, Andres Vahter wrote:
Are you sure samv flash driver supports your target controller?
This just makes gdb unaware of the flash region mapping so...
... this makes GDB use regular "write to memory" commands instead of
"write to flash".
Are you saying that in this case the target flash memory is actually
modified?
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
This one https://www.besttechnology.co.jp/modules/knowledge/gate.php/openocd.pdf?way=attach&_noumb&refer=OpenOCD&openfile=openocd.pdf says:
Hmm, it is true that actually this one does not have M7 core. There seems to have been references to atsame5x, but I cannot find such driver in official repository:
https://gitlab.cba.mit.edu/jakeread/atkstepper17/commit/e6559372a14fa69ba360da903480d962d786744f
So please try http://openocd.zylin.com/#/c/4272 and report how it
works for you.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
It seems that atsame5x.cfg is removed from everywhere, however there is patch that can be added:
myopenocd.cfg for atsame5x:
So this worked very nicely. Not sure why atsame5x.cfg was removed in first place. Probably atsamv.cfg should support E5X series but it seems to be buggy. I can test E5X support if it lands somewhere.
On Tue, Jan 29, 2019 at 10:04:32AM -0000, Andres Vahter wrote:
This shouldn't be used for normal microcontroller development
workflow.
It wasn't removed from anywhere AFACT. Can you please add a comment to
Gerrit and possibly test this patch with other related devices if you
have any?
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
I also have SAME54 Xplained board and flashing also worked for that.
What do you mean by it wasn't removed from anywhere - I couldn't find it from latest version.
On Tue, Jan 29, 2019 at 01:02:59PM -0000, Andres Vahter wrote:
It wasn't removed from the sources as it wasn't ever merged in the
first place. It's a pending change and it needed some review and
testing. If you add your feedback to the Gerrit change it would be
nice.
--
Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav@gmail.com
I added my review to http://openocd.zylin.com/#/c/4272/5.