Skip to main content
Radiofan
Associate II
July 11, 2020
Question

How do I configure STM32CubeIDE to upload optimized code

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.

This topic has been closed for replies.

6 replies

TDK
July 11, 2020

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
RadiofanAuthor
Associate II
July 11, 2020

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?

TDK
July 11, 2020
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
RadiofanAuthor
Associate II
July 11, 2020

The run button has no defined configuration:

0693W000001shCRQAY.jpg

TDK
July 11, 2020

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
RadiofanAuthor
Associate II
July 11, 2020

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.