Skip to main content
SWent.1
Associate
August 5, 2025
Question

openocd is not working with STM32WBA65 CPU

The bottom line is the  "wba" file stm32wbax.cfg is missing from openocd

Here are the details:

  • I have designed a board with the STM32WBA65 CPU.
  • I downloaded openocd
  • But the needed file stm32wbax.cfg is missing
    • find . -name "stm32wb*"
      ./tcl/target/stm32wbx.cfg


What I need is an openocd that works with the stm32wbax.cfg file.
I have found the file in https://github.com/openocd-org/openocd 
However, that file does not work with openocd distributed by MorseMicro

  • openocd --version
    xPack Open On-Chip Debugger 0.12.0+dev-01312-g18281b0c4-dirty (2023-09-04-22:31

And I built openocd from scratch and it also fail

  • openocd --version
    Open On-Chip Debugger 0.12.0-rc3-00999-gfcb40f49b (2025-08-05-13:39)

Conclusion: 

When you find the file stm32wbax.cfg, please make sure it works with openocd.

And please add LABELS to your GUI so I can file under STM32WBA or STM32WBA65

 

This topic has been closed for replies.

3 replies

STTwo-32
ST Technical Moderator
September 16, 2025

Hello @SWent.1 

Could you please give more details about what is not working exactly and what is your test process.

Best Regards.

STTwo-32

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Associate II
October 10, 2025

I have the same issue, I can not get mainline top of tree regular openocd or ST fork of openocd to work with STM32WBA65.   

For regular openocd:

    clone: https://github.com/openocd-org/openocd.git

    hash:  896738264e92b74a17250dab639999a2743d0b7c  from 9/27/2025

For st fork

    clone: https://github.com/STMicroelectronics/OpenOCD.git

    hash: 0de861e21c12fd39fdce7b6296994d89eca6146f from 12/03/2024

Regular openocd

When I run openocd with the following command-line it appears to work at first:

~/repos/openocd/src/openocd -s ~/repos/openocd/tcl -f interface/stlink.cfg -f target/stm32wbax.cfg
Open On-Chip Debugger 0.12.0+dev-02228-ge5888bda3 (2025-10-03-23:47)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : DEPRECATED: auto-selecting transport "swd (dapdirect)". Use 'transport select swd' to suppress this message.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V3J16M9 (API v3) VID:PID 0483:3754
Info : Target voltage: 3.267778
Info : Unable to match requested speed 500 kHz, using 200 kHz
Info : Unable to match requested speed 500 kHz, using 200 kHz
Info : clock speed 200 kHz
Info : SWD DPIDR 0x0be12477
Info : [stm32wbax.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32wbax.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32wbax.cpu] Examination succeed
Info : [stm32wbax.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections

However as soon as I attach with gdb

Reading symbols from build/make.elf...
(gdb) target extended-remote localhost:3333
Remote debugging using localhost:3333
Remote communication error. Target disconnected.: Connection reset by peer.
(gdb)

And back in the openocd shell I now see

...  continuing from previous ...

Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Error: Failed to read memory at 0x40015800
Warn : Cannot identify target as an STM32C0/G0/G4/L4/L4+/L5/U0/U3/U5/WB/WL family device.
Error: auto_probe failed
Error: Connect failed. Consider setting up a gdb-attach event for the target to prepare target for GDB connect, or use 'gdb_memory_map disable'.
Error: attempted 'gdb' connection rejected

ST Fork of openocd

It doesn't contain stm32wbax.cfg so it fails.

~/repos/openocd_st/src/openocd -s ~/repos/openocd_st/tcl -f interface/stlink.cfg -f target/stm32wbax.cfg
Open On-Chip Debugger 0.12.0-00033-g0de861e21 (2025-10-10-14:21) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
embedded:startup.tcl:28: Error: Can't find target/stm32wbax.cfg
in procedure 'script' 
at file "embedded:startup.tcl", line 28
make: *** [Makefile:212: openocd] Error 1

If I try to use stm32wbx instead I get:

~/repos/openocd_st/src/openocd -s ~/repos/openocd_st/tcl -f interface/stlink.cfg -f target/stm32wbx.cfg
Open On-Chip Debugger 0.12.0-00033-g0de861e21 (2025-10-10-14:21) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "hla_swd". To override use 'transport select <transport>'.
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : clock speed 500 kHz
Info : STLINK V3J16M9 (API v3) VID:PID 0483:3754
Info : Target voltage: 3.267778
Warn : UNEXPECTED idcode: 0x0be12477
Error: expected 1 of 1: 0x6ba02477

^^^^ this would be expected of an unidentified ID.

Associate II
October 10, 2025

Build a debug version, and stepping in, fundamentally the issue appears to be that even though I specified an stm32wbax.cfg, internally this ends up resulting in a flash "driver" object based on stm32l4.

 

Looking through those sources src/flash/nor/stm32l4x.c, I see mention of:

/* STM32WBxxx series for reference.
 *
 * RM0493 (STM32WBA52x)
 * http://www.st.com/resource/en/reference_manual/dm00821869.pdf
 *
 * RM0434 (STM32WB55/WB35x)
 * http://www.st.com/resource/en/reference_manual/dm00318631.pdf
 *
 * RM0471 (STM32WB50/WB30x)
 * http://www.st.com/resource/en/reference_manual/dm00622834.pdf
 *
 * RM0473 (STM32WB15x)
 * http://www.st.com/resource/en/reference_manual/dm00649196.pdf
 *
 * RM0478 (STM32WB10x)
 * http://www.st.com/resource/en/reference_manual/dm00689203.pdf
 */

/* STM32WLxxx series for reference.
I don't see STM32WBA65 mentioned, so possibly the issue.