Olimex Support Forum

ARM => ST => Topic started by: opr on April 24, 2023, 02:52:34 PM

Title: LoRa-STM32WL-DevKit flashing with openocd fails
Post by: opr on April 24, 2023, 02:52:34 PM
I could compile the demo with my settings but uploading the .elf always fails with:

openocd -f interface/cmsis-dap.cfg -c "cmsis_dap_vid_pid 0x15ba 0x0044" -c "transport select swd" -c "adapter speed 4000" -f "target/stm32wlx.cfg" -c "program BB-STM32WLE-WAN.elf"
Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
swd
adapter speed: 4000 kHz

none separate

Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 500 kHz
Info : SWD DPIDR 0x6ba02477
Info : [stm32wlx.cpu0] Cortex-M4 r0p1 processor detected
Info : [stm32wlx.cpu0] target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32wlx.cpu0 on 3333
Info : Listening on port 3333 for gdb connections
[stm32wlx.cpu0] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff2b6c msp: 0x20001508
** Programming Started **
Info : device idcode = 0x10016497 (STM32WLE/WL5x - Rev 'unknown' : 0x1001)
Info : RDP level 0 (0xAA)
Info : flash size = 256 KiB
Info : flash mode : single-bank
Warn : Adding extra erase range, 0x08011fc8 .. 0x08011fff
Info : SWD DPIDR 0x6ba02477
Error: Failed to write memory at 0x20009ff8
Error: block write failed
Error: error writing to flash at address 0x08000000 at offset 0x00000000
embedded:startup.tcl:1516: Error: ** Programming Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 1581
at file "embedded:startup.tcl", line 1516

Am I missing something? I tried it under OSX and Windows with openocd 0.12 and 0.11
Title: Re: LoRa-STM32WL-DevKit flashing with openocd fails
Post by: LubOlimex on April 25, 2023, 03:47:51 PM
Seems like openocd issue. Either the script or the  core are problematic. Make sure to test with the latest OpenOCD version.
Title: Re: LoRa-STM32WL-DevKit flashing with openocd fails
Post by: JohnS on April 25, 2023, 05:49:12 PM
Maybe try an older oocd, too, as they sometimes make major changes which are ... er ... not quite right first try.

John
Title: Re: LoRa-STM32WL-DevKit flashing with openocd fails
Post by: opr on April 28, 2023, 11:01:40 AM
I tried it on a different machine (Apple M2) and it worked with the same version.

Thank you!