SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world.
And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download two short videos (registration required) highlighting:

System Workbench for STM32

Connect to custom board STM32L053 - STLINK-V2 - SWD

Hi ST world,

I have issues connecting to a STM32L053 using openstm32.

The connection configuration is: STLINK-V2 // SWD

I’ve created a project with appropriate parameters and tried many configuration for the debug configuration (changing Mi protocol)

But I only could get this error at debug session start (stopping at 93 %):

Error in final launch sequence
Failed to execute MI command:
load C:\projects\micropos_proto1\Debug\micropos_proto1.elf

Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet

What did I do wrong ? Any ideas ?

For note, it’s possible to connect to my board using STLINK32 utility and flash/verify of the binary I want to debug was succesful.

Thanks and regards,


Can “STM32 ST-Link Utility” connect and program your chip ?

Can you verify that no debug session has been already launched. Go to the Debug perspectie (Windows > Open Perspective > Debug (or Other... > Debug)) then terminate every opened sessions.

Then relaunch the debug. If the same error is displayed, please copy the openocd process output (on the Debug perspective, select the openocd process under your debug session, the output should be displayed on the console view).

If OpenOCD initialization fail in reset procedure, you might modify your OpenOCD custom configuration script (*.cfg under the project) as following

reset_config none (instead of “reset_config srst_only srst_nogate”)

It did work for me when the Reset pin of the ST-Link is not linked.


Hi Kevin,
I uninstall the “install_sw4stm32_win_64bits-latest” version, and install the ” install_sw4stm32_win_64bits-v1.3” version, then modify my OpenOCD custom configuration script, it works perfectly, so I think it‘s a version of the problem, the last version has bugs.
Thank you!



Can you please Update the plugins and let us know the result with the latest plugins ? Without modifying the cfg script.
And tell us which mcu.debug plugin version you have.

What is your board config ? STLINK V2 ?
Which STM32 device ?

There has been a change recently in the cfg files to connect under reset.
It should reconnect better for applications that are going in low power mode.


You have to select “Use local script” in debug configuration debugger tab and point to a new file with this content :

source find interface/stlink-v2.cfg

transport select “hla_swd”

source find target/stm32f1x_stlink.cfg

  1. use hardware reset, connect under reset

reset_config srst_only srst_nogate

I had the same problem and I removed “srst_only” from last line and it seems it’s working great.

You should in Configuration Debug set:

Open OCD command:
”${openstm32_openocd_path}\openocd.exe” -s ${openstm32_openocd_script_path} -f interface/stlink-v2.cfg

Configuration Script:

See attached image.


I updated AC6 framework to the last compiler + openOCD.
I can’t connect anymore to my stm32l476 based board. (Modifying stm32l4.cfg reset configuration is no longer working)

It seems the reset configuration is forced elsewhere:
srst_only separate srst_nogate srst_open_drain connect_assert_srst

here is the complete openocd log.
Open On-Chip Debugger 0.9.0-dev-00418-g9afb8b4-dirty (2015-09-28-12:09)
Licensed under GNU GPL v2
For bug reports, read
none separate
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
Warn : use ‘STM32L476.cpu’ as target identifier, not ‘0’
adapter_nsrst_delay: 100
srst_only separate srst_nogate srst_open_drain connect_assert_srst
adapter speed: 1800 kHz
Info : clock speed 1800 kHz
Error: read version failed
in procedure ‘init’
in procedure ‘ocd_bouncer’

Please help, I’m stuck in a rut !!
Thanks for your help,
Best regards,



Can you tell us the config ?
ST-Link V2 and STM32L476 ?
Did you connect Reset line from ST-link to the L4 target ?

The change has been done to connect to the target under reset so you can reconnect to a device that is in low power mode for example.
The reset config changed is in stm32l4.cfg file.

Are you using SWD mode ?
If not, can you try in SWD.



I just tried to connect an external STLink V2 on a STM32L476 Eval Board (STLink V2 connected to the 25 pins HE10 connector) and i made 2 custom board with STLINK V2 in SWD or JTAG mode and i can debug with the 2 configs.

Can you add the arg -d to the openocd command and give the result of the log ?


Hello Laurent,

many thanks for these tests.
I’ve updated the AC6 framework and for some reason I can’t start a debug session now :

The following error occurs: OpenOCD Binary not found

FYI I made a post on another topic about this.

Thanks for your help,
Best regards,

Did you install in a directory with a space character ? Like in “Program Files” ?
Or you installed the soft in the default dir “AC6” ?


Hello Laurent,

Thanks for your help, it worked.
Nevertheless this implies I have to reinstall my eclipse plugin to ensure everything works fine...

Well, that’s not the first time I have to do this operation for an update of the compiler or openOCD and it’s a bit “sad” ...

I don’t believe having done wrong operation in the update process (simple clicks on update buttons .... )

Thanks for your help again anyway,
best regards,

Glad to hear the good news.

And can you confirm you didn’t change the cfgs or an other thing at the end ?
To know if there is still an update to do.


I just have to comment line 71 of stm32l4.cfg file and reset_config default options are used.
I don’t know if it’s an expected operation but it’s like this since the beginning as far as I know...

Then it works fine without other modifications

thanks and regards

Maybe it was valid before but the connect_assert_srst has been added to reconnect under reset.

So, can you try putting back the original line 71 and give the openocd log (with the -d arg) if it is not working.

Do you connect the reset line to the STM32L476 ?


I find a solution for nucleo f303k8
I downloaded the last openocd (0.9)
I replace openocd script in workbench by openocd0.9 script

and now its work


STM32F103C8T6 and st-link v2
st-link v2 works STM32 ST-LINK Utility

System Workbench for STM32

Error in final launch sequence
Failed to execute MI command:
load “C:\C++\CUBE MX32\Progekt1\LedTime\SW4STM32\LedTime\Debug\LedTime.elf”

Error message from debugger back end:
Error erasing flash with vFlashErase packet
Error erasing flash with vFlashErase packet

how to solve it?

its works

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

source find interface/stlink-v2.cfg

transport select “hla_swd”

source find target/stm32f1x_stlink.cfg

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

reset_config none

I am using the STM32L051 with the ST-LINK-V2

I seem to have this problem with the reset line - reset_config srst_only srst_nogate

I change the .custom.cfg file to remove srst_only

When I launch the debugger, it modifies the .custom.cfg file and puts it back

Where is this modification coming from?

Thanks in advance


SW4STM32 need to connect under reset to not loose connection if the application uses low power modes or uses SWD lines as ios.

So yo must connect the reset line from the STlink to the STM32 device nRst pin.


Modification of the .cfg come from the Openocd Template File.
Template is located in:

Make changes of reset_config in this file and it works !! biggrin


Same problem. After all kinds of efforts and struggling I just unplugged it and plugged it back in to fix the error.

“Did you try turning it off then back on again?”

SMH rule number one of debugging.

I’m having this issue on my up to date install. Changing the reset doesn’t seem to help.


You need to check all the used .cfg files for the correct reset configuration. Sometimes the wrong reset config is repeated in the used config scripts.


There has been an update for custom L0 boards in the latest version 1.12.0.
Nothing changed on reset but a correction has been done to access 2nd bank on L0 double bank flash devices.
There is also a correction for all L0 custom boards that was writing a few registers on L1 addresses but it was not blocking debug.

So, please, update the software with menu Help => Check For Updates
And recreate your custom L0 board.

Also, precise on which OS you are working and if you have connected all the lines on the STLink ?
(Vdd appli, Reset, SWD Clk and Data and GND).


Page: 2/3  [Next]
1  2  3