Hello.
I’ve been trying to implement MCUboot as per recommendation of a forum user here, following this demo: GitHub - AGlass0fMilk/mbed-mcuboot-demo: Demo of mcuboot with Mbed I’ve already run into some issues such as the board we’re using not supporting the FlashIAPBlockDevice class. So I chose to just use that demo as a guideline as much as possible.
It uses GCC_ARM to compile code the code, now, when I try to use GCC_ARM with a very simple program:
#include "UnbufferedSerial.h"
#include <cstring>
mbed::UnbufferedSerial pc(P2_1, P2_0, 115200);
int main()
{
const char* string = "\r\nIN USER PROGRAM!!";
pc.write(string, std::strlen(string));
while (true)
{
}
}
The resulting file size is absolutely gigantic! 540kB for the .bin file.
See the compilation output here. Something weird is going on for sure:
Space used after regions merged: 0x87000
Merging Regions
Filling region application with .\BUILD\MAX32630FTHR\GCC_ARM\Bootloader_application.bin
Space used after regions merged: 0x87000
| Module | .text | .data | .bss |
|----------------------|-----------|---------|----------|
| [fill] | 68(+0) | 0(+0) | 140(+0) |
| [lib]\c_nano.a | 2634(+0) | 100(+0) | 21(+0) |
| [lib]\gcc.a | 760(+0) | 0(+0) | 0(+0) |
| [lib]\misc | 180(+0) | 4(+0) | 28(+0) |
| main.o | 126(+0) | 0(+0) | 152(+0) |
| mbed-os\cmsis | 7178(+0) | 168(+0) | 5956(+0) |
| mbed-os\connectivity | 32(+0) | 0(+0) | 0(+0) |
| mbed-os\drivers | 3034(+0) | 0(+0) | 0(+0) |
| mbed-os\hal | 1662(+0) | 8(+0) | 115(+0) |
| mbed-os\platform | 5304(+0) | 260(+0) | 1172(+0) |
| mbed-os\rtos | 240(+0) | 0(+0) | 0(+0) |
| mbed-os\targets | 3718(+0) | 260(+0) | 384(+0) |
| Subtotals | 24936(+0) | 800(+0) | 7968(+0) |
Total Static RAM memory (data + bss): 8768(+0) bytes
Total Flash memory (text + data): 25736(+0) bytes
Are there any optimisation options, and if so, how do I use these?