PlatformIO Community

PlatformIO does not create correct

I am attempting to port my Mbed Studio project over to platformio. When I try to build the project using PlatformIO, I get these errors:

Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/BusInOut.o
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp: In static member function 'static mbed::BlockDevice* mbed::BlockDevice::get_default_instance()':
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp:94:9: error: 'MBED_CONF_SPIF_DRIVER_SPI_MOSI' was not declared in this scope; did you mean 'MBED_CONF_APP_LORA_SPI_MOSI'?
   94 |         MBED_CONF_SPIF_DRIVER_SPI_MOSI,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         MBED_CONF_APP_LORA_SPI_MOSI
Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/BusOut.o
Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/CAN.o
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp:95:9: error: 'MBED_CONF_SPIF_DRIVER_SPI_MISO' was not declared in this scope; did you mean 'MBED_CONF_APP_LORA_SPI_MISO'?
   95 |         MBED_CONF_SPIF_DRIVER_SPI_MISO,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         MBED_CONF_APP_LORA_SPI_MISO
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp:96:9: error: 'MBED_CONF_SPIF_DRIVER_SPI_CLK' was not declared in this scope; did you mean 'MBED_CONF_DRIVERS_QSPI_CSN'?
   96 |         MBED_CONF_SPIF_DRIVER_SPI_CLK,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         MBED_CONF_DRIVERS_QSPI_CSN
Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/DigitalIn.o
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp:97:9: error: 'MBED_CONF_SPIF_DRIVER_SPI_CS' was not declared in this scope; did you mean 'MBED_CONF_DRIVERS_QSPI_CSN'?
   97 |         MBED_CONF_SPIF_DRIVER_SPI_CS,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |         MBED_CONF_DRIVERS_QSPI_CSN
Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/DigitalInOut.o
/home/drfay/.platformio/packages/framework-mbed/features/storage/system_storage/SystemStorage.cpp:98:9: error: 'MBED_CONF_SPIF_DRIVER_SPI_FREQ' was not declared in this scope
   98 |         MBED_CONF_SPIF_DRIVER_SPI_FREQ
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compiling .pio/build/nucleo_h743zi/FrameworkMbeddrivers/source/DigitalOut.o
*** [.pio/build/nucleo_h743zi/FrameworkMbedfeatures/storage/system_storage/SystemStorage.o] Error 1

When I investigate further, it appears that the mbed_config.h generated by PlatformIO is not generating macros to define these items. Mbed CLI, on the other hand does create an mbed_config.h with these items defined.

Any help would be greatly appreciated.

Thanks,

-Dan Fay

What version of mbed-os is your project using in Mbed Studio?

I’m using Mbed OS 5.15. I’m actually using a modified version of it.

The github link for the project is at: GitHub - faydr/QMesh: QMesh: a synchronized flooded mesh network for voice over LoRa

The github link to the modified Mbed OS is at: GitHub - faydr/mbed-os-qmesh: Mbed OS with modifications specific to QMesh

Thanks,

-Dan Fay

I can reproduce your compile error in the platformio branch but I couldn’t figure out why the default values in e.g. mbed-os-qmesh/mbed_lib.json at main · faydr/mbed-os-qmesh · GitHub are not showing up in the mbed_config.h, which is the source of the problem. It seems either PlatformIO or mbed is under the impression that the component is not in use. Please file a bug in Issues · platformio/platform-ststm32 · GitHub for the developers. Due to the war, answers will however take a while.