Arm Mbed OS support forum

Mbed Baremetal - Static Functions


I’m trying to build an application with the baremetal profile and I am including some of the BlockDevice components. My program calls the mbed::BlockDevice::get_default_instance() API but when compiling I get the following build error:

[ERROR] /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: BUILD/NRF52840_DK/GCC_ARM/flash_map.o: in function `__static_initialization_and_destruction_0':
[snipped]/./flash_map.cpp:10: undefined reference to `mbed::BlockDevice::get_default_instance()'
collect2: error: ld returned 1 exit status

Is there some way to use static class member functions while using the baremetal profile? Could this be because my declaration is global?

Answered my own question… must add system-storage to the list of requires in mbed_app.json…

1 Like