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


Create script failure: fail to retrieve target

Hello,

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.

Hello
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.


Hello,

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

Rgds,
Laurent


Hello,

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
Version: 2.8.0.201902141520

System Workbench for STM32 - C/C++ Debugging Tools for MCU
Version: 2.4.0.201902141520

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

STM32CubeMX
Version: 4.25.1

Regards,
Fenil


Hello,

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.

Regards,
Atsushi


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!


I had the error as well. As additional error info there was an Java IO Exception error. I thought: Maybe this is just a folder rights problem on windows.

Then I changed the folder access rights on Windows Explorer and added the user “Everyone” to the granted users in the folder where the project is stored and gave the right to do “all” on folder and files inside.

This solved the problem.


See a difference between XML texts of a ‘.cproject’ files, generated with (different, Windows and Linux) versions of STM32CubeMX:

Failed with %subj message:


...
storageModule moduleId=”refreshScope” versionNumber=”2”
configuration artifactName=”${ProjName}” configurationName=”Debug”
resource resourceType=”PROJECT” workspacePath=”F103CAN”
configuration
storageModule
...



and, working as expected:


...
storageModule moduleId=”refreshScope” versionNumber=”2”
configuration configurationName=”Debug”
resource resourceType=”PROJECT” workspacePath=”F103CAN”
configuration
storageModule
...



(Deleted XML tag symbols, as this board srews up text with them)

This text is near the ent of ‘.cproject’. Offending part marked bold. Just deleting that words make me able to create new debug configuration using built-in script generator.


Hello
I just faced a similar issue about setting-up debug script automatically.

I cloned a project which is properly working and rename the project and board then I faced the same issue.
Creating a custom script by myself works fine as someone mentioned it, but I finally find another solution
for my custom board.

The procedure is as follows.

Step1 Confirm the project’s MCU and Board from project’s property (C/C++ Build->Setting) and make sure the BoardName.xml file is in the project folder.
Step2 Remove the project from workspace (Don’t delete the content).
Step3 Start creating a new AC6 C/C++ project and select same MCU and Board( you confirmed in step 1 ) but don’t proceed more.
Step4 In the MCU + Board select dialog Push the “Remove this Custom Board” Button to remove the board shown in Step1
Step5 Confirm the Board select menu and if the board still remains in the menu, cancel the creation procedure and restart from Step3
Step6 Close and Restart SW4STM32 and reimport the project removed in Step2.
Step7 Select the imported project and Debug As -> Ac6 C/C++ Application

This solved the issue at least in my case.


Sorry for my mistake.
BoardName.xls is not right.
I mean xml file named with the board name.