Example usage using STM32's arm-none-eabi-size executable:
# specify the `size` executable, .elf file, and 128 KiB max flash and # 20 KiB max RAM # The `--flash` and `--ram` arguments are optional. If not specified, # percent remaining and bytes remaining values will not be calculated. size_mcu arm-none-eabi-size my_program"STM32F103RB_Nucleo.elfelf" --flash 131072 --ram 20480 size_info = 'arm-none-eabi-size my_program.elf "STM32F103RB_Nucleo.elf"' = text data bss dec hex filename 2896 12 1588 4496 1190 STM32F103RB_Nucleo.elf FLASH used = 2908 bytes ( 2.219%). Remaining is 128164 bytes ( 97.781%). Max is 131072 bytes. SRAM used by global variables = 1600 bytes ( 7.813%). Remaining is 18880 bytes ( 92.187%) for local (stack) variables or RTOS stack & heap. Max is 20480 bytes.