ATSAME54 MCU not allowing DFU bootloader flash from J link

1 post / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi team,

 

I am using the ATSAME54 X PRO board, I have followed the procedure to flash DFU bootloader here :

https://git.osmocom.org/osmo-asf...

 

when I try to flash after erasing the chip the i'm getting the below error :

from ST-link v2 :

 

~/openocd/0.10.0-13/scripts$ sudo ../bin/openocd --file interface/stlink.cfg --command "transport select hla_swd" --command "set CHIPNAME same54" --command "set CPUTAPID 0x2ba01477" --file target/atsame5x.cfg --command "init" --command "reset halt" --command "atsame5 bootloader 0" --command "flash erase_sector 0 0 last" --command "reset halt" --command "program ./bootloader.bin" --command "atsame5 bootloader 16384" --command "reset run" --command "shutdown"

[sudo] password for shashi:
xPack OpenOCD, 64-bit Open On-Chip Debugger 0.10.0+dev (2019-07-17-11:25)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
hla_swd
same54
0x2ba01477
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : clock speed 2000 kHz
Info : STLINK V2J37S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.229552
Info : same54.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00003270 msp: 0x2003fff8
Bootloader protected in the first 0 bytes

Info : SAM MCU: SAME54P20A (1024KB Flash, 256KB RAM)
Error: SAM: NVM programming error
Error: Failed to erase block containing 00002000
Error: SAM: failed to erase sector 1 at 0x00002000
Error: failed erasing sectors 0 to 127

 

from J link :

$sudo openocd --file interface/jlink.cfg --command "transport select swd" --command "set CHIPNAME same54" --command "set CPUTAPID 0x2ba01477" --file target/atsame5x.cfg --command "init" --command "reset halt" --command "atsame5 bootloader 0" --command "flash erase_sector 0 0 last" --command "reset halt" --command "program ../../../../osmo-asf4-dfu/gcc/bootloader-same54_xplained_pro-0.1.9-3761.bin" --command "atsame5 bootloader 16384" --command "reset run" --command "shutdown"

Open On-Chip Debugger 0.10.0+dev-00677-gdeaf3d264 (2021-07-15-12:54)
Licensed under GNU GPL v2
For bug reports, read
    http://openocd.org/doc/doxygen/b...
none separate
adapter speed: 2000 kHz
cortex_m reset_config sysresetreq
Info : J-Link V11 compiled Feb  4 2021 12:59:17
Info : Hardware version: 11.00
Info : VTarget = 3.328 V
Info : clock speed 2000 kHz
Info : SWD DPIDR 0x2ba01477
Info : atsame5.cpu: hardware has 6 breakpoints, 4 watchpoints
Error: atsame5.cpu -- clearing lockup after double fault
Polling target atsame5.cpu failed, trying to reexamine
Info : atsame5.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread 
xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc
Bootloader protected in the first 0 bytes
Info : SAM MCU: SAME54P20A (1024KB Flash, 256KB RAM)
Error: SAM: NVM programming error
Error: Failed to erase block containing 0000e000
Error: SAM: failed to erase sector 7 at 0x0000e000
Error: failed erasing sectors 0 to 127

 

Can you help in flashing it successfully, and also how to flash bin.dfu as Application code after 16Kb of BOOTPROT ?