Search code examples
armembeddedstm32mbed

Why mbed generating bin file different size online compiler and off line compile (export gcc_arm makefile)


When build project on online ide genereted bin file size 21k but exported project that export settings Make-GCC-ARM, build with make command on linux terminal generated file size 52k.And how can reduce offline generated bin file size?

Thanks.


Solution

  • Online Mbed Compiler uses ARMC6 toolchain to compile the code. While you are using GCC_ARM to compile locally. Different toolchains compile code differently hence the binary size difference.

    If you use ARMC6 toolchain locally to compile, the binary size will be very close to the one generated by an online compiler.