My first contact with RT-Thread Studio was creating an application based on STM32H750VB. The automatic generated code with only a while loop (serial port print message and delay) has 70548 bytes on Flash. It's quite impressive. Normal? In an attempt to reduce the code size, such as in other plataforms, I tried to change the build mode to Release, but I didn't find how to do it. Can you help me?
If you use the full version of RT-Thread, the size compiled by GCC is generally large. It is recommended that you create a simplified version of RT-Thread nano type project, so that the size will be smaller. If you want to create a release build configuration, you need to create it based on the debug configuration. You need to know how to set the gcc compiler parameters to reduce the compiled size.
create a new build configuration by this menu
Thanks rcp for the detailed response. Meanwhile, I changed to "nano" and the code was reduced to 30.4 kB. But I can't identify, in the properties, as a Debug build. For example, there's no something like -DEBUG symbol in preprocessor.
Also, as you suggested, I've built a Release version based on Debug. But it seems to have the same properties as Debug and the same generated code size (just the name was changed to "Release"). Some additional suggestion?
Studio does not specially prepared the corresponding release build configuration for the project. All parameters need to be added according to your own needs, such as -Debug define symbol.
You can identify whether a build configuration is debug or release by the build configuration name. You can switch the debug configuration through some switching entries