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


Unable to debug on custom STM32 board

I’ve been using System Workbench to try to build and debug code to a custom STM32 board that I have made. The code builds fine, but I get the following error after I start debug:

System Workbench Error

I am currently using a STM32F303RE chip and the following debug configuration:

System Workbench Debug Config

I’ve tried using the custom config file and other ST-Link version, but to no avail. Any help is greatly appreciated.

France

Hi,

On your custom board, do you connect the reset line to the debug probe? By default OpenOCD expect to be able to connect to the board when it is in reset mode, using the reset line to place the MCU in reset state.

Please could you check that?

Please also try to start the debug session by adding option “-d” to the script other options and send what was displayed on the OpenOCD console?

Bernard (Ac6)


Usually when I see this error (vFlashErase) it is because some of the falsh areas are write, pcrop, and/or rop protected.
I would recommend looking at the options bytes in ST-Link Utility (ctrl+b).


Yestuday I have similar error and solve this problem. The main problem is the many people uses ST-Link Programmer/Debuger clone from Aliexpress. But this clone have no nReset signal pin, like in 15 pin of original ST-Link. There are only jReset & SWIM_Reset pins.
To solve the problem, I need connect Reset pin of target MCU to 18 pin (PB0) programmer MCU.


I had this problem and the solution layed in another thread. It was to remove no-srst from OpenOCD .cfg file for my target (STM32F0).
This is the full path to the file I had to edit:
C:\Ac6\SystemWorkbench\plugins\fr.ac6.mcu.debug_1.11.2.201612060912\resources\openocd\scripts\target\stm32f0x.cfg
The no-srst is also redifned in a project specific file but I’m not sure which one of them has prevalence:
C:\Users\myuser\stm32wb_workspace\RFOutput_cube\RFOutput_cube.cfg
Which is obviously the path to my workspace and the current project.


Fix it in software! :-D

Before you can debug, the IDE has to send the binary image to the MCU’s flash memory (or SRAM, if you’ve set it up for that). Before it can write the new image, it has to erase the existing image, if any. That’s where you’re getting the error message - at the very beginning of the process.

Your present configuration is telling OpenOCD that there is a reset wire attached from the ST-Link to your target board. That is in addition to the SWCLK and SWDIO lines, ground and Vtarget. OpenOCD is trying to use the reset line to undeniably get the MCU’s attention. This is not necessary.

Change your reset configuration from “reset_config srst_only srst_nogate” to “reset_config none”. I just added a “#” in front of the line, which causes it to be considered as a comment, so I can go back when I need to later.

  1. use hardware reset, connect under reset
  2. reset_config srst_only srst_nogate

reset_config none

PS: someone explain to me in words I can understand how to properly format code in this forum. Please! The “Help” button has a bad link to the Wiki syntax help page. The actual page gives terse examples that I can’t seem to follow.

I hope this helps.


Dale


void main(void) {
	char s[] = "Vetch";
	printf("Thank you, %s!\n", s);
}

biggrin Excellent!
Happy new year.


 

Newest Forum Posts

  1. Analog servomotors with nucleo f334r8 by SkelePaw, 2025-11-01 05:57
  2. STM32 MCU model shortlisting for Making RC remote by Palvish, 2025-07-07 15:05
  3. SPI on Nucleo_STMH533RE by royjamil, 2025-05-04 20:13
  4. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-25 07:37
  5. SPI on Nucleo_STMH533RE by royjamil, 2025-03-23 11:31
  6. SPI on Nucleo_STMH533RE by higginsa1, 2025-03-23 09:33
  7. Configuring DMA for ADC in SW? by sam.hodgson, 2025-03-04 12:58
  8. Build a project in "release" mode by info@creosrl.it, 2025-02-20 18:12
  9. Build a project in "release" mode by info@creosrl.it, 2025-02-20 17:05
  10. Build a project in "release" mode by tang, 2025-02-20 10:36

Last-Modified Blogs