Dual bank flash - Custom variant

Post here first, or if you can't find a relevant section!
Post Reply
hetlelid
Posts: 3
Joined: Sat Aug 14, 2021 2:56 pm
Answers: 1

Dual bank flash - Custom variant

Post by hetlelid »

Hi.

I try to create custom variant config for the STM32L072CBT6 MCU (128 KB).

This is forking fine, as long as the code is below 64 KB.

I expect his to be related to the ldscript. Any idea how i can set this up to work with dual bank flash?

Error from openocd:

Code: Select all

openocd -d2 -s C:\Users\xxx\.platformio\packages\tool-openocd/scripts -f interface/stlink.cfg -c "transport select hla_swd" -f target/stm32l0.cfg -c "program {.pio\build\custom_L051K8\firmware.elf}  verify reset; shutdown;"
xPack OpenOCD, x86_64 Open On-Chip Debugger 0.11.0-00155-ge392e485e (2021-03-15-16:44)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
debug_level: 2

hla_swd
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD    
Info : clock speed 300 kHz
Info : STLINK V3J7M2B4S1 (API v3) VID:PID 0483:374F
Info : Target voltage: 0.000000
Error: target voltage may be too low for reliable debugging
Info : stm32l0.cpu: hardware has 4 breakpoints, 2 watchpoints
Info : starting gdb server for stm32l0.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 300 kHz, using 200 kHz
Info : Unable to match requested speed 300 kHz, using 200 kHz
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x08009aec msp: 0x20005000
STM32L0: Enabling HSI16
Info : Unable to match requested speed 2500 kHz, using 1000 kHz
Info : Unable to match requested speed 2500 kHz, using 1000 kHz
** Programming Started **
Info : Device: STM32L0xx (Cat.5)
Info : STM32L flash has dual banks. Bank (0) size is 64kb, base address is 0x8000000
Warn : no flash bank found for address 0x08010000
Warn : no flash bank found for address 0x080114a0
** Programming Finished **
** Verify Started **
Error: checksum mismatch - attempting binary compare
embedded:startup.tcl:530: Error: ** Verify Failed **
in procedure 'program' 
in procedure 'program_error' called at file "embedded:startup.tcl", line 591
at file "embedded:startup.tcl", line 530
*** [upload] Error 1
============================================== [FAILED] Took 33.97 seconds ==============================================
by hetlelid » Fri Oct 08, 2021 12:04 pm
Found a solution:

Have to change the openocd_target parameter from stm32l0 to stm32l0_dual_bank.
Go to full post
hetlelid
Posts: 3
Joined: Sat Aug 14, 2021 2:56 pm
Answers: 1

Re: Dual bank flash - Custom variant

Post by hetlelid »

Found a solution:

Have to change the openocd_target parameter from stm32l0 to stm32l0_dual_bank.
pallago
Posts: 1
Joined: Sun Jan 23, 2022 6:43 pm

Re: Dual bank flash - Custom variant

Post by pallago »

Hello,
thanks. I have exactly the same problem.
1) How did you change the debug_level to 2 in your platformio.ini ?
2) How do you change your platformio.ini to get include the target parameter of openocd ? Do you mind to post the example?

Best regards!
Post Reply

Return to “General discussion”