Dear OpenOCD developers, I want to report a regression in OpenOCD. OpenOCD 0.12.0 is unable to flash a certain .elf file to my NUCLEO-F303K8 board , while OpenOCD 0.10.0 flashes it without issues. Below I'll provide all the detailed information, as well as the links to the .elf files.
Platform and OpenOCD version ============================ I'm working on Windows 11 with OpenOCD 0.12.0 as downloaded from Liviu Ionescu's xPack page: [ https://xpack.github.io/dev-tools/openocd/releases/ | https://xpack.github.io/dev-tools/openocd/releases/ ] The exact version is: > xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04) I also have an OpenOCD 0.10.0 , which I compiled myself some time ago, following the compilation instructions provided by Liviu Ionescu's xPack project. The exact version is: > Open On-Chip Debugger 0.10.0+dev-01404-g393448342 (2020-09-08-10:40) .elf files ========== The following .elf file can be flashed to the NUCLEO-F303K8 board with OpenOCD 0.10.0, but fails to be flashed with OpenOCD 0.12.0: [ https://new.embeetle.com/downloads/misc/f303_app_fails.elf | https://new.embeetle.com/downloads/misc/f303_app_fails.elf ] I have also a .elf file that can be flashed with both OpenOCD 0.10.0 and OpenOCD 0.12.0: [ https://new.embeetle.com/downloads/misc/f303_app_fails.elf | https://new.embeetle.com/downloads/misc/f303_app_works.elf ] OpenOCD flash command ===================== To flash the .elf file, I enter the following command: > openocd -f openocd_probe.cfg -f openocd_chip.cfg -c "program > f303_app_fails.elf reset; shutdown;" Hereby, the file 'openocd_probe.cfg' contains the following content: # openocd_probe.cfg # ----------------- source [find interface/stlink.cfg] transport select hla_swd The file 'openocd_chip.cfg' contains the following content: # openocd_chip.cfg # ----------------- source [find target/stm32f3x.cfg] reset_config srst_only The file 'f303_app_fails.elf' is the .elf file mentioned before. You can download it here: [ https://new.embeetle.com/downloads/misc/f303_app_fails.elf | https://new.embeetle.com/downloads/misc/f303_app_fails.elf ] Flashing this file with OpenOCD 0.10.0 works just fine, but it fails with OpenOCD 0.12.0. OpenOCD output ============== OpenOCD 0.12.0 outputs this when it fails to flash the .elf file: hla_swd Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : clock speed 1000 kHz Info : STLINK V2J25M14 (API v2) VID:PID 0483:374B Info : Target voltage: 3.249572 Info : [stm32f3x.cpu] Cortex-M4 r0p1 processor detected Info : [stm32f3x.cpu] target has 6 breakpoints, 4 watchpoints Info : starting gdb server for stm32f3x.cpu on 3333 Info : Listening on port 3333 for gdb connections [stm32f3x.cpu] halted due to breakpoint, current mode: Thread xPSR: 0x61000000 pc: 0x2000003a msp: 0x20003000 Info : Unable to match requested speed 1000 kHz, using 950 kHz Info : Unable to match requested speed 1000 kHz, using 950 kHz [stm32f3x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc Info : Unable to match requested speed 8000 kHz, using 4000 kHz Info : Unable to match requested speed 8000 kHz, using 4000 kHz ** Programming Started ** Info : device id = 0x10016438 Info : flash size = 64 KiB Warn : Adding extra erase range, 0x08003198 .. 0x080037ff 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 To provide you with more detailed output, I've run the same OpenOCD command again with the -d flag. The debug output is too large to put in this mail, but you can download it from here: [ https://new.embeetle.com/downloads/misc/f303_app_fails.elf | https://new.embeetle.com/downloads/misc/f303_app_fails_debug_output.txt ] Conclusion ========== I hope I have provided all the necessary information to solve this regression. Please contact me if there's anything more I can do to help. Kind regards, Kristof Mulier