cancel
Showing results for 
Search instead for 
Did you mean: 

RUN/Debug configuration & toolbar buttons with STM32CubeIDE

Vincent Grennerat
Associate II

Before STM32CubeIDE, I used AC6 SystemWorkbench IDE. I had no problems with the run and debug configuration for STM32 MCU C/C++ Applications.

On STM32CubeIDE, I don't get the run button in the toolbar nor the run command in the RUN drop-down menu ( I only tested Linux and OSX versions, I can see on some video tutorials that this problem doesn't seem to be present on windows 10 versions). I don't have any problem with the debug function which is present both on the toolbar and in the RUN drop-down menu.

If I use the CTRL + F11 shortcut, debug works fine, whereas the Shift + CTRL + F11 shortcut (RUN) only rebuilds and then stops. I deduced that the button and the command in the drop-down menu are not present because the run functionality is somewhere disabled.

I thought that it might be a missing running/debug configuration for the RUN command, but It seems that only one run configuration is used for both run and debug (That's the way it is on SW4STM32 if I understand correctly the settings)

Is there some manual configuration to do when using STM32CubeIDE on Linux or OSX ?

Thanks,

Vincent.

9 REPLIES 9
FSTKMARO
Associate II

I am on the same boat as you. Hopefully someone will respond soon.

FSTKMARO
Associate II

By the way, I can confirm that the Windows 10 version has the same problem. No run configuration to flash the device.

FSTKMARO
Associate II

I just read this

https://community.st.com/s/question/0D50X0000Ap3MRRSQ2/features-and-known-issues-in-stm32cubeide

The run is not implemented. No indication on how to overcome it either. At this point, it is just a nice debugger. :sad_but_relieved_face:

Vincent Grennerat
Associate II

Thank you very much jdevarie for your answer.

I hadn't noticed that in the release notes (although it's in the first line of the known problems !) and I know why.

When you watch the official ST video demo, it shows all along it the run button in the toolbar, and at 2'11", you can even see the dropping menu with the run function !!!

It is unbelievable that ST dares to show such a video, with a version of software which is not the public release :pouting_face:

mattias norlander
ST Employee

There is not yet any menu options for flash / erase operations. Reason being that in SW4STM32 world only OpenOCD was supported. Hence easy to implement a menu for just one probe. In CubeIDE case there is right now support for SEGGER / OpenOCD and ST-LINK GDB-server. Three different debugger back-ends, all of them are slightly different requiring an abstraction layer. It is on the roadmap, but currently not high prio.

For the time being you can probably rely on CubeProgrammer which is bundled with CubeIDE (provided that you are using ST-LINK and not SEGGER, for SEGGER use J-Flash?). Write up a bat-file that you place in your project root folder. Then just double-click it each time you want CubeProg to carry out flash/reset. Let's call it an intermediate solution, but a flexible one 🙂

Example script using SWD mode to connect (assumes bat-file in project root):

C:\ST\STM32CubeIDE_1.1.0.19w36\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.0.0.201904021149\tools\bin\STM32_Programmer_CLI.exe -c port=SWD -d Debug/stm32l475vg.elf

Not ideal, but quite flexible. Read more in the CubeProg user manual if you need to connect under reset or use other ports.

https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/76/3e/bd/0d/cf/4d/45/25/DM00403500/files/DM00403500.pdf/jcr:content/translations/en.DM00403500.pdf

Vincent Grennerat
Associate II

Thank you Mattias for this comprehensive answer.

The scripting solution seems an acceptable workaround, even for teaching situations I am dealing with at the University Grenoble Alpes. I am going to test it and I'll then do some feedback here.

Vincent Grennerat
Associate II

Solution works fine with a bash script (running Linux Ubuntu), but is not handy for beginners, because it requires to open a terminal to the debug project directory, and type the ./MyRunScript

In order to simplify the launch I would appreciate to have some way to run the bash script directly from the eclipse environment. The External tools configuration can be used for this purpose, but it seems it is also deactivated in STM32CubeIDE. Is there a way to activate it ?

Could there be there another method to launch my run script directly from the IDE ?

Sorry, no way to activate it currently.

I would add the bash script to my project root so that I can double-click it in the "Project Explorer" view. How to make that possible in Ubuntu I guess depends on which desktop environment used, but should not be to hard. With this it is just a double-click to load and reset the MCU. One script for each use case and you have both flexibility and efficiency.

Still just intermediate solution though..

JLope.11
Associate III

To add/remove buttons in the toolbar it must be done in Windows->Perspective->Customize perspective

To add buttons to debug toolbar must be done that after push the "debug" button.

I should add the very important button "Run to line" as default