6 years, 2 months ago.  This question has been closed. Reason: Duplicate question

SDBlockDevice.h not found

Hi:

Trying to do some test with a NUCLEO_F446RE and a SD card breakout. I installed MBED Cli, and when I create a new project, I get the version 5.10 of mbed OS.

But can't get to compile the code because SDBlockDevice.h file is not found.

I tried creating a custom_target.json file on the project folder, with the following content

{ "CUSTOM_F446RE": { "inherits": ["NUCLEO_F446RE"], "components_add":["SD"], "features_add":["STORAGE"] } }

But no luck, always the same message:

[Fatal Error] main.cpp@2,10: SDBlockDevice.h: No such file or directory [ERROR] ./main.cpp:2:10: fatal error: SDBlockDevice.h: No such file or directory

  1. include "SDBlockDevice.h" ^~~~~~~~~~~~~~~~ compilation terminated.

Any clue?

2 Answers

6 years, 2 months ago.

Hello Daniel,

You should import the sd-driver library into your project.

Is what I did at the beginning, but then I got this message

[Error] SDBlockDevice.cpp@157,2: #error "Started from version 5.10.0 SDBlockDevice external repo is deprecated. please use the SDBlockDevice component inside mbed-os."

Shame on me, I just realised that I had the following lines on mbed_app.json file:

    "target_overrides": {
        "*": {
            "target.components_remove": ["SD"]
        },

I copied it from another project .... Really sorry to bother you

posted by Daniel MAIORANO 02 Oct 2018

Oops, I did not know about that. Unfortunately I do not use Cli. So I tried the online compiler with the latest mbed-os 5.10.0 and I was successful after adding an mbed_app.json file with the following content:

{
    "target_overrides": {
        "NUCLEO_F446RE": {
            "target.components_add": ["SD"]
        }
    }
}
posted by Zoltan Hudak 02 Oct 2018

Please note that the sd-driver project is now deprecated as of Mbed OS 5.10, the SD driver can now be included as a component within Mbed OS by creating a custom_targets.json file with the following information (with the target information changed depending on your board):

{
    "CUSTOM_F446RE": {
            "inherits": ["NUCLEO_F446RE"],
            "components": ["SD"],
            "features_add": ["STORAGE"]
        }
}

This can similarly be accomplished with an mbed_app.json.

- Jenny, team Mbed

posted by Jenny Plunkett 02 Oct 2018
6 years, 2 months ago.

Hi Daniel,

Please see my response on your duplicate question here: https://os.mbed.com/questions/82585/SDBlockDeviceh-not-found/

- Jenny, team Mbed