Including mbed os component

I’m trying to use the mbed built in drivers. How can I include either Blockdevice.h or SPIFBlockDevice.h into my project.
I’ve enabled Storage and SPIF by adding the code below to mbed_app.json

{
    "target_overrides": {
        "*": {
            "target.components_add": ["SPIF"],
            "target.features_add": ["STORAGE", "BOOTLOADER"]
        }
    }
}

But I can’t seem to be able include either file of the following files in main.cpp

#include <SPIFBlockDevice.h>
#include <BlockDevice.h>

@valeros, please help

In addition to your mbed_app.json you need to enable RTOS, e.g.:

[env:nucleo_f401re]
platform = ststm32
framework = mbed
board = nucleo_f401re
build_flags = -DPIO_FRAMEWORK_MBED_RTOS_PRESENT
1 Like