cancel
Showing results for 
Search instead for 
Did you mean: 

Large compiled application size, is this normal?

Scott Dev
Senior
Posted on February 18, 2017 at 08:47

Hi

  I am just a beginner in the STM32, I have been designing for 8bit Freescale parts for years. I am using ST's Nuleo64 STM32L07 processor.

 Using STM32CubeMX I designed a very simple application that simply captures the system timer, GPIO interupt for the push button. I simply wrote some code (just for me getting used to the system) using Keil V5. I simply use the system timer interupt to blink the LED, pressing the button changes the speed of the LED . Within Cubemx I also selected RTC,LPUART but done nothing with the code yet. After building the application and ran it I noticed that the size of the code is 6420, and ram 1176. To me this seams a lot for what it does, I am used of having more tighter code. The application uses HAL library, does this put a large overhead to the size of code and ram used? And am I better stripping out some of the code that CubeMX creates?

Thanks

Scott

21 REPLIES 21
Posted on February 24, 2017 at 20:21

I guess Cortex M instruction set was designed to compete with 8 bit architecture. When code size is big, generate the MAP file to look into the details and which *.o file is bloated or which automatically linked ansi library file is attached.

Looking at the various teardowns (say from Ifixit) of popular consumer products should give some confidence level on the various flavours of the  STM32 family:

STM32 M0 : 

https://www.ifixit.com/Teardown/AirPods+Teardown/75578

  

STM32 M3 : 

https://www.ifixit.com/Teardown/Apple+Pencil+Teardown/52955

 

STM32M4 : 

https://www.ifixit.com/Teardown/AirPods+Teardown/75578

  
Posted on February 24, 2017 at 20:22

STM32M4: 

http://www.chipworks.com/about-chipworks/overview/blog/fitbit-alta-teardown