Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Workbench keeps changing the STLink type for a custom board project

I’m using the latest OpenSTM32 build (Version: 1.13.2.201703061529) under Ubuntu 14.04 64-bit. I generated the project under STM32CubeMX 4.20.1.

Target MCU is an STM32F100 with a few LEDs and a serial port. JTAG probe is an STLink/V2. My code is a dead-simple blink-the-lights application that builds successfully.

When I attempt to debug, I get a failure in final launch sequence (I’ve seen this error in several forum topics indicating incorrect STLink type):
Failed to execute MI command: -target-select remote localhost:3333

Examination of the project XML file reveals that when I build the project or start to debug, the debugger setting ST-LinkV2 in my XML file is being automagically changed to ST-LinkV2-1, overwriting my manual changes.

I cannot find where the incorrect default debugger type selection is coming from, and I don’t see where the debugger type is configured. Can anyone suggest where I may be going wrong?

Project .cfg file contents are below:

  1. This is an ITB_Unchained board with a single STM32F100CBTx chip.
  2. Generated by System Workbench for STM32


source find interface/stlink-v2.cfg

set WORKAREASIZE 0x2000
transport select “hla_swd”

set CHIPNAME STM32F100CBTx

source find target/stm32f1x_stlink.cfg

  1. use hardware reset, connect under reset

reset_config srst_only srst_nogate


Project XML file contents are below:




ITB_Unchained
stm32f100cbtx
SWD
ST-LinkV2

I’ve identified a way to make the debugger work properly on my Ubuntu system. I’m still not sure what the cause, or the “clean fix” would be, but this is what worked for me:

Open the menu item Run -> Debug Configurations.
Select the output .elf name under Ac6 STM32 Debugging.
In the Debugger tab, go to the “Script:” item, select “Manual spec,” and manually set the “Debug device” and “Debug interface” to the necessary values (in my case, these are STLink-V2” and “SWD”).
Click “Debug” and off you go.

I have also messed around with the settings in the project .cfg file, but I’m uncertain whether this has had any effect.

The .xml file in my project directory is still being reset to “ST-LinkV2-1” when I build, but as nothing else is paying attention to this setting, I am ignoring it.


 

Newest Forum Posts

  1. SPI on Nucleo_STMH533RE by royjamil, 20:13
  2. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  5. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  6. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  7. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  8. Build a project in "release" mode by tang, 2025-02-20 10:36
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-19 17:35
  10. Fail to debug in Win 11 C/C++ by mortenlund, 2024-12-26 20:27

Last-Modified Blogs