cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure STM32CubeIDE to upload optimized code

Radiofan
Associate II

A section of my code is CPU intensive and is starting to affect user interaction. I need to optimize this part, or build it optimized and upload it into the device from the IDE.

I know how to upload code using the STM32CubeProgrammer, but using 2 UIs in this manner during development is not productive.

I would like to configure a run target in the IDE, I am surprised it does not exist out of the box. Does anyone have pointers? FYI, I am using a STM32G031j6.

6 REPLIES 6
TDK
Guru

In the menu, choose Project -> Build Configuration -> Set Active -> Release

If you feel a post has answered your question, please click "Accept as Solution".
Radiofan
Associate II

That does the same thing as selecting "release" under the hammer icon. I have been able to build optimized, but how do I send it to the MCU?

You hit the “Run�? button to build and send the active configuration code to the device. Same way you send the unoptimized code. Maybe I’m missing something.
If you feel a post has answered your question, please click "Accept as Solution".
Radiofan
Associate II

The run button has no defined configuration:

0693W000001shCRQAY.jpg

TDK
Guru

That's the "External Tools" button. The run button is different, and hidden from your view.

It looks like you're on an old version of STM32CubeIDE which did not have the run button functionality. The latest is v1.3.1.

The "Debug" button will also upload the current configuration to the device.

If you feel a post has answered your question, please click "Accept as Solution".
Radiofan
Associate II

I updated to the latest version.

The download page doesn't show the latest version in the drop-down, but if you click the link, you get it.

Thanks, I have my button now.