Hi,
We are using Jlink commander in combination with J-Link LITE Cortex-M to flash STM32l476qe device
STM32L476QE has 512KB (Bank1- 256K, Bank2-256K), Everything was working fine till the binary was limited to 256K, recently it crossed 256K, then at the time of flashing , verification started failing and application goes to hardfault.
Below is Jlink commander output while flashing
Display All
I read 0x800 bytes from flash address start from 0x8040000 which falls in BANK2, it returns all zeros , but i checked actual binary its different at that particular addresses.
We are using Jlink commander in combination with J-Link LITE Cortex-M to flash STM32l476qe device
STM32L476QE has 512KB (Bank1- 256K, Bank2-256K), Everything was working fine till the binary was limited to 256K, recently it crossed 256K, then at the time of flashing , verification started failing and application goes to hardfault.
Below is Jlink commander output while flashing
Source Code
- SEGGER J-Link Commander V5.02f ('?' for help)
- Compiled Oct 2 2015 20:52:00
- Script file read successfully.
- Info: Device "STM32L476QE" selected.
- DLL version V5.02f, compiled Oct 2 2015 20:51:34
- Firmware: J-Link Lite-Cortex-M V8 compiled Aug 20 2015 17:57:19
- Hardware: V8.00
- S/N: 518110336
- Feature(s): GDB
- Emulator has Trace capability
- VTarget = 3.300V
- Info: Found SWD-DP with ID 0x2BA01477
- Info: Found SWD-DP with ID 0x2BA01477
- Info: Found Cortex-M4 r0p1, Little endian.
- Info: FPUnit: 6 code (BP) slots and 2 literal slots
- Info: CoreSight components:
- Info: ROMTbl 0 @ E00FF000
- Info: ROMTbl 0 [0]: FFF0F000, CID: B105E00D, PID: 000BB00C SCS
- Info: ROMTbl 0 [1]: FFF02000, CID: B105E00D, PID: 003BB002 DWT
- Info: ROMTbl 0 [2]: FFF03000, CID: B105E00D, PID: 002BB003 FPB
- Info: ROMTbl 0 [3]: FFF01000, CID: B105E00D, PID: 003BB001 ITM
- Info: ROMTbl 0 [4]: FFF41000, CID: B105900D, PID: 000BB9A1 TPIU
- Info: ROMTbl 0 [5]: FFF42000, CID: B105900D, PID: 000BB925 ETM
- Found 1 JTAG device, Total IRLen = 4:
- Cortex-M4 identified.
- Target interface speed: 100 kHz
- Processing script file...
- Firmware: J-Link Lite-Cortex-M V8 compiled Aug 20 2015 17:57:19
- Hardware: V8.00
- Target interface speed: 2000 kHz
- Reset delay: 0 ms
- Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
- PC = 080065B0, CycleCnt = 00000000
- R0 = 00000000, R1 = 00000000, R2 = 00000000, R3 = 00000000
- R4 = 00000000, R5 = 00000000, R6 = 00000000, R7 = 00000000
- R8 = 00000000, R9 = 00000000, R10= 00000000, R11= 00000000
- R12= 00000000
- SP(R13)= 20017FFC, MSP= 20017FFC, PSP= 00000000, R14(LR) = FFFFFFFF
- XPSR = 01000000: APSR = nzcvq, EPSR = 01000000, IPSR = 000 (NoException)
- CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
- FPU regs: FPU not enabled / not implemented on connected CPU.
- Downloading file [debug/BikeSensor.bin]...
- **************************
- WARNING: CPU is running at low speed (4026 kHz).
- **************************
- Info: J-Link: Flash download: Total time needed: 6.847s (Prepare: 0.114s, Compare: 0.103s, Erase: 3.023s, Program: 3.594s, Verify: 0.000s, Restore: 0.010s)
- Info: J-Link: Flash download: Restarting flash programming due to program error (possibly skipped erasure of half-way erased sector).
- Info: J-Link: Flash download: Skip optimizations disabled for second try.
- Error while programming flash: Programming failed.
- Loading binary file debug/xxxx.bin
- Reading 285336 bytes data from target memory @ 0x08000000.
- Verify failed @ address 0x08040000.
- Expected 02 read 00
- Reset delay: 0 ms
- Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
- Script processing completed.
I read 0x800 bytes from flash address start from 0x8040000 which falls in BANK2, it returns all zeros , but i checked actual binary its different at that particular addresses.
Actual Binary start from 0x8040000J-Link>mem 0x8040000 0x800
08040000 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040010 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040020 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040030 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040040 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040050 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040060 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040070 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040080 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040090 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400A0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400B0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400C0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400D0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400E0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
080400F0 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
08040100 = 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Can you please help us , what may be the problem? Does JLink commander is not able to flash in Bank2 ?02 f0 0f 03 03 fa 20 f3 a5 42 48 ea 03 08 19 d2 14 f8 01 2c 52 45 04 f1 ff 39 e9 d1 09 eb 0c 03 9d 42 e5 d8 02 99 03 9a cd f8 20 c0 18 46 01 93 fb f7 8e f9 01 99 dd f8 20 c0 20 28 d8 d1 0c 46 a5 42 e5 d3 4b f8 04 8b 08 9d 04 99 c5 eb 0b 0b 4f ea ab 07 40 46 0f 61 01 f0 2a f8 06 9c 7d 01 24 68 28 1a a0 42 20 f3 34 81 c0 f2 5a 81 20 25 06 9b 05 99 9f 68 b9 42 20 f3 05 81 06 98 05 9a 43 68 9a 42 80 f2 0f 81 9e 1a b4 42 72 dc c7 68 02 2f 20 f0 81 81 03 2f 20 f0 bb 81 01 2f 20 f0 a9 81 07 98 04 99 20 f0 dd fe 14 98 20 27 07 60 .....................