2024-09-25 04:37 AM
Hello Team,
We have been using the STM8 series for the low level Application projects. Due to Obsolete of the STM8, we have been moved to STM32C0 chips. But we are facing a problem with the program memory which the code generator occupies more space only for the Simple ADC, GPIO, Timer Initializations. We used 8KB chips in STM8 series for the same application. Now we changed to STM32C011F4P6 chip 16KB chip. This STM32 Cube IDE code generator itself takes the 75% of the memory for simple Initialization. Please help me out of this problem and provide a solution to it.
Kind Regards,
Nishanth M
Solved! Go to Solution.
2024-09-25 04:42 AM
What optimisation level are you using?
Try at least 'Optimise for Debug'
2024-09-25 04:42 AM
What optimisation level are you using?
Try at least 'Optimise for Debug'
2024-09-25 04:46 AM
HAL is not designed with small memory footprints in mind. The most you can do is increase your optimization settings for size.
2024-09-25 07:43 AM
Hi,
Thanks for the support... :)
What are difference between the Optimization levels for the -O0, -Og, -O1, -O2, -O3, -Os, -Ofast. What is the pros and cons of these optimization levels. Is this will affect the any other part of the code. When are these levels used?
Kind Regards,
Nishanth M.
2024-09-25 07:52 AM
See the GCC documentation:
https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html
Another thing you can do is use the code generator to get you started and then, if you need to, go through the code manually to see what can be pruned out ...
2024-09-25 10:03 AM
A recent thread on the same subject: