ARMmbed / mbed-cli

Arm Mbed Command Line Interface
https://os.mbed.com
Apache License 2.0
334 stars 176 forks source link

Wrong RAM/flash usage reported by Mbed CLI #998

Open swapnilsayansaha opened 3 years ago

swapnilsayansaha commented 3 years ago

Sample resource usage of program compiled “claimed” by GCC_ARM via Mbed CLI for STM32F746ZG NUCLEO board:

image

Sample resource usage of program compiled “claimed” by ARM compiler via Mbed Studio for the same program and same hardware: image

Why is the output different? GCC_ARM completely ignores the contribution coming from model.o and also underreports the overall flash and RAM contributions of each component. Note that the program runs fine in both cases on the target hardware. This is important for me because I need to profile how much flash and RAM a tensorflow lite micro model consumes. I tried using ARM compiler with CLI but it wants license.

It seems like a well-known issue: https://forums.mbed.com/t/code-size-reporting-does-not-take-into-account-rodata/15269 https://github.com/ARMmbed/mbed-os/issues/12541