J-Link>con Please specify device / core. Type '?' for selection dialog Device>STM32L496RE Specify target interface speed [kHz]. <Default>: 4000 kHz Speed> Device "STM32L496RE" selected. Connecting to target via SWD Found SW-DP with ID 0x2BA01477 STM32 (Protection Detection): Unexpected IDCODE DEV_ID 0x 461 found. Only checking the 1st flash bank for write protection. Found SW-DP with ID 0x2BA01477 Unknown DP version. Assuming DPv0 Scanning AP map to find all available APs AP: Stopped AP scan as end of AP map has been reached AP: AHB-AP (IDR: 0x24770011) Iterating through AP map to find AHB-AP to use AP: Core found AP: AHB-AP ROM base: 0xE00FF000 CPUID register: 0x410FC241. Implementer code: 0x41 (ARM) Found Cortex-M4 r0p1, Little endian. FPUnit: 6 code (BP) slots and 2 literal slots CoreSight components: ROMTbl @ E00FF000 ROMTbl: E000E000, CID: B105E00D, PID: 000BB00C SCS-M7 ROMTbl: E0001000, CID: B105E00D, PID: 003BB002 DWT ROMTbl: E0002000, CID: B105E00D, PID: 002BB003 FPB ROMTbl: E0000000, CID: B105E00D, PID: 003BB001 ITM ROMTbl: E0040000, CID: B105900D, PID: 000BB9A1 TPIU ROMTbl: E0041000, CID: B105900D, PID: 000BB925 ETM Cortex-M4 identified. J-Link>loadbin nuttx.bin, 0 Halting CPU for downloading file. Downloading file [nuttx.bin]… Writing target memory failed.
J-Link: Flash download: Only internal flash banks will be erased.
To enable erasing of other flash banks like QSPI or CFI, it needs to be enabled via "exec EnableEraseAllFlashBanks"
Erasing flash [100%] Done.
Error: Failed to erase chip @ address 0x08000000 (Algo87: Unspecified error #1)
Failed to erase chip.
Failed to execute RAMCode for chip erase!
J-Link: Flash download: Total time needed: 0.105s (Prepare: 0.064s, Compare: 0.000s, Erase: 0.001s, Program: 0.000s, Verify: 0.000s, Restore: 0.038s)
ERROR: Erase returned with error code -5.
Strange, after resetting the board and writing a .hex instead of a .bin worked:
J-Link>loadbin nuttx.hex, 0
'loadbin': Performing implicit reset & halt of MCU.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading file [nuttx.hex]…
J-Link: Flash download: Bank 0 @ 0x08000000: 1 range affected (251904 bytes)
J-Link: Flash download: Total: 2.972s (Prepare: 0.120s, Compare: 0.038s, Erase: 0.000s, Program & Verify: 2.749s, Restore: 0.063s)
J-Link: Flash download: Program & Verify speed: 89 KB/s