Base mbed Firmware Size
The base mbed firmware size varies across platforms. For the blinky example project - with the FRDM-KL25Z it is as small as 1.8k whereas the LPC1768 is about 18k and LPC11U24 (mBuino/RETRO) about 10k.
The size of the above LPC device base firmware sizes can reduced by deselecting items from their device.h file. The following procedure can be used for your projects.
1. Remove the mbed library from your project.
2. Import the official mbed-src library to your project (from Import Library..., From Library Wizard...)
3. Adjust the device.h file for your platform (in a folder such as - targets/hal/TARGET_NXP/TARGET_LPC11UXX/TARGET_OC_MBUINO and targets/hal/TARGET_LPC1768/TARGET_NXP/TARGET_LPC176X/TARGET_MBED_LPC1768)
4. Set the #define values for components as desired (1 = desired, 0 = not desired) (for MBUINO - e.g. DEVICE_STDIO_MESSAGES, DEVICE_ERROR_PATTERN)
You'll know if it worked if the built code is much smaller.
Other notes: For the original mbed library I noticed that for mBuino, if the DigitalOut and timer references are removed the base code size is 940 bytes. As soon as the DigitalOut definition was readded the code grew to 9.5k. For LPC1768 the change was not so drastic - with DigitalOut and Timer references removed = 17.2k!
I think it shows how different the HALs can be.
Please log in to post comments.