ARMmbed / mbed-cli

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

mbed cli - compile - module size output failing #670

Closed JanneKiiskila closed 6 years ago

JanneKiiskila commented 6 years ago

The module size printout is failing with Mbed OS 5.7.6 (and 5.8.0).

mbed cli version 1.5.1.

Repro steps

git clone git@github.com:ARMmbed/mbed-bootloader.git
mbed deploy
mbed compile -m UBLOX_C030_U201 -t GCC_ARM --profile=tiny.json -c

Correct output

Link: mbed-bootloader
Elf2Bin: mbed-bootloader
+-----------------------------------------------+-------+-------+-------+
| Module                                        | .text | .data |  .bss |
+-----------------------------------------------+-------+-------+-------+
| [fill]                                        |    53 |     3 |    22 |
| [lib]/c_nano.a                                |   740 |   100 |    12 |
| [lib]/gcc.a                                   |   832 |     0 |     0 |
| [lib]/misc                                    |   252 |    16 |    28 |
| fix-mbed-os-compile/pal_polyfill.o            |     4 |     0 |     0 |
| mbed-cloud-client/factory-configurator-client |  1212 |     0 |    76 |
| mbed-cloud-client/mbed-client-pal             |   648 |     4 |     4 |
| mbed-cloud-client/update-client-hub           |  2275 |     4 |    16 |
| mbed-os/drivers                               |  1446 |     4 |   120 |
| mbed-os/features                              |  1494 |     0 |     0 |
| mbed-os/hal                                   |  1447 |     4 |    66 |
| mbed-os/platform                              |   692 |     4 |    14 |
| mbed-os/targets                               | 15998 |     4 |   692 |
| minimal-printf/mbed_printf_implementation.o   |  1124 |     1 |    36 |
| minimal-printf/mbed_printf_wrapper.o          |    32 |     0 |     0 |
| sd-driver/SDBlockDevice.o                     |  3074 |     0 |     0 |
| source/active_application.o                   |   858 |     4 |     4 |
| source/bootloader_common.o                    |   246 |     4 | 16385 |
| source/bootloader_platform.o                  |    46 |     0 |     0 |
| source/main.o                                 |   779 |     8 |   328 |
| source/sotp_rot.o                             |    92 |     0 |     1 |
| source/upgrade.o                              |  1379 |     0 |     8 |
| Subtotals                                     | 34723 |   160 | 17812 |
+-----------------------------------------------+-------+-------+-------+
Total Static RAM memory (data + bss): 17972 bytes
Total Flash memory (text + data): 34883 bytes

Image: ./BUILD/UBLOX_C030_U201/GCC_ARM/mbed-bootloader.bin

just change the Mbed OS to a newer version.

cd mbed-os
git checkout mbed-os-5.7.6
cd ..
mbed compile -m UBLOX_C030_U201 -t GCC_ARM --profile=tiny.json -c

and you get this instead of the correct output.

Elf2Bin: mbed-bootloader
Text 30.3KB Data 164B BSS 17.4KB                   ROM 30.5KB RAM 17.5KB
ROM [|                                                   ]    30.5KB/1MB
RAM [||||                                                ]  17.5KB/192KB
Image: ./BUILD/UBLOX_C030_U201/GCC_ARM/mbed-bootloader.bin

Seems to me the parsing is somehow failing when the Mbed OS is updated.

JanneKiiskila commented 6 years ago

Tried deleting the BUILD folder completely to avoid some "left-behind" things, but that doesn't help either.

screamerbg commented 6 years ago

@cmonr and @theotherjimmy can provide more information on this

screamerbg commented 6 years ago

@JanneKiiskila what about one of the least mbed OS 5.8?

cmonr commented 6 years ago

@JanneKiiskila This particular problem was fixed with 5.7.7.

A PR was mistakenly merged into mbed-os because oddly enough there's no test to verify that the compiled output structure does not change.

Can you share the steps you did to test this with 5.8.0, because as it stands, I actually can't compile the example with mbed-os checked out to mbed-os-5.8.0, and want to know how you verified this.

JanneKiiskila commented 6 years ago

Just tried mbed-os-5.8.0 and it's OK.