System Workbench for STM32

Create script failure: fail to retrieve target


I have created project using STM32 Cube MX. I have specifically selected Nucleo F7 46ZGx board. I have configure whatever was required and generated the code. Then I open Workbench(Eclipse) and imported the project which was created by CubeMx. I have set up Build target in properties of project under C/C++ Build > setting >Target. Pressed “Apply” and then “Ok”. I build my project and it was successful. Now I want to run and debug it hence I tried to configure debugger but in Debugger configuration, Target mcu and board in blank. Please refer attachment. whenever I open Run configuration, I always get error “Create script failure: fail to retrieve target”. could you please tell me where I did mistake. If information is not sufficient then please let me know.

Same probleme for me with “fail to retrieve target” message.

Exactly the same problem here, when trying to flash and to clear STM32L4R9I-DISCO

The issue seems to be caused due to an error while generating the openOCD script (It just creates an empty file).

I worked around the issue by manually defining a script for my board. (Just modify the script from an other board)

I reached the same conclusion and used the same workaround... Except that I retrieved a cfg file from trash.
This bug appeared here last Friday (MAR/8th), out of the blue. Tried to reinstall everything from scratch 3 times, did not have time to downgrade versions to discover wich restablishes .cfg generation functionality... You guys owe me a weekend ;)
My environment:
- Windows 10 fully updated.
- STM32CubeMX - V 5.1.0
- Board: STM32L152C-Discovery
- Eclipse IDE for C/C++ Developers, Version: Neon.3 Release (4.6.3), Build id: 20170314-1500
- Java Version 8, Update 201.


Can you give the versions of software used ?
SW4STM32 and CubeMX versions.



I have resolved the issue by recreating project from CubeMX. There is unkown reason that .cproject file doesn’t have right configuration which was created by CubeMX for systemworkbench. If you go to plugin--> debug in AC6’s location, you can find all scripts related to boards and microcontrollers. When Eclipse could not reach out to this location, then it can not load any of the boards or target MCUs. If configuration is correct then you can select boards and target from build setting. Even though you have selected right target and board in build setting, sometimes, it couldn’t read by RUN or Debug configuration because there is possibility/bug(?) that it doesn’t update details of target and board in .cproject. I am not sure that above information is correct or not.

So, restart everything and recreate the project(you just need to generate code in cubeMX in different location and also state the location of third party library properly) and magic happens. Now, everything is alright.

I am using:

System Workbench for STM32 - C/C++ Embedded Development Tools for MCU

System Workbench for STM32 - C/C++ Debugging Tools for MCU

Eclipse IDE for C/C++ Developers
Version: Neon.3 Release (4.6.3)

Version: 4.25.1



I faced to a similar problem (by an OpenOCD set-up) and found this post.

I’m using SW4STM32 v2.8 for Windows.

In my case, I could resolve the problem by once removing (project-name).xml file in the project folder, delete the debug configuration (Run -> Debug Configurations..., and delete one), re-generated the debug configuration and relaunch debug. (The XML file will be generated if not exist, but doesn’t seem to be updated if the information in it is outdated.)

In my case, the XML file, which was copied from other project, contained wrong information in it.

I hope it helps.


I also have a similar problem, generated project through CubeMX but unable to flash or debug. For me it worked editing the .cproject file.
All i needed to do was to change any entries of fr.ac6.managedbuild.option.gnu.cross.board, from 32F769IDISCOVERY to STM32F769I-DISCO.
Of course you have to modify yours accordingly.

Hope this might help someone as I really lost quite long time finding what the issue was.

Thank you for posting this. After not doing any STM32F4 development for about a year I’ve returned just this morning, using a new install of CubeMX and System Workbench and ran into this exact problem. My problem: I could not flash and debug apparently b/c the MCU and board settings (on the “main” tab of the debug configuration) were missing. The debug cfg file was missing, also, I updated my .cproject file with board and mcu as you did - however, still no luck. I ended up copying the debug configuration of an older project and now it is working... Frustrating.... But not sure I would have realized what was going on without the help from your post and others. Thank you for the help. I’m using an STM32F411-DISCO by the way.

This worked for me too. I am using a STM32L476G-DISCOVERY Board.

Opened .cproject file in Notepad++
Edited the field “fr.ac6.managedbuild.option.gnu.cross.board” from “32L476GDISCOVERY” --> “STM32L476G-DISCO”
Saved .cproject file

Then it worked properly. Thanks for your help!