5 years, 7 months ago.

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
 #include "SDBlockDevice.h"
          ^~~~~~~~~~~~~~~~~
compilation terminated.

Any clue?

Hi Daniel, Can you share the library that you are using? I am learning to use a SD Card module, I used the one like this: https://www.sparkfun.com/products/544 is it the same one that you are using? If so, it will be great if you can share the library that you are using.

Thank you so much! Stanley

posted by Stanley Setiawan 05 Oct 2018

I'm not using the same breakout, but I think that the functionality is the same. The library I used on MBED 5.9 (and previous) is this one https://github.com/ARMmbed/sd-driver But on MBED 5.10 the library is included on mbed-os

posted by Daniel MAIORANO 06 Oct 2018

Yes it works! thank you so much for your kind answer! best regards, Stanley

posted by Stanley Setiawan 10 Oct 2018

Hi again, sorry to bother you, maybe this is a really stupid question, but where do we put the custom_targets.json file in our folder? I tried to use mbed_app.json as well in the root folder but still, I got the same error as you did. can you help? Thanks!

posted by Stanley Setiawan 10 Oct 2018

Hi Stanley: usually json files are on the same folder where the main.cpp file is.

  • Which version of mbed-os are you using?
  • Are you using the online or the offline compiler?
  • Do you have a mbed_app.json file? if so, have you chech that you don't have a "target override" that removes the SD driver?

Cheers

posted by Daniel MAIORANO 11 Oct 2018

Hi Daniel, yes sorry for not giving the full information, 1. I'm using the offline compiler, and use Mbed 5.10, with the mbedCLI version of 1.8 2. for the mbed_app.json, I copied it from an example that I found on github. It has a target override but it does not consist a "remove SD driver".

However, when I tried to add the one that is similar to what Jenny gives, It failed and said that "CUSTOM_F407VG" does not exist in the board that mbedOS supports.

But I tried to edit the .json file inside the targets folder inside, and add whatthe SD card etc and it works.

But is it okay though?

Thanks!

posted by Stanley Setiawan 12 Oct 2018

2 Answers

5 years, 7 months ago.

Hi Daniel,

I was able to successfully reproduce this issue. I'm looking into it now, I'll comment here with updates.

Thank you for your patience!

- Jenny, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Accepted Answer

Hi again Daniel,

Please change your custom_targets.json file to the following:

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

We will also update the SDBlockDevice API documentation to reflect this information.

Please let me know if you have any questions!

- Jenny, team Mbed

posted by Jenny Plunkett 02 Oct 2018

Sorry, but even doing the mods that you suggested, I get the same error. Now my custon_targets.json file looks like this

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

posted by Daniel MAIORANO 02 Oct 2018

And in the Mbed CLI are you then using the following command? mbed compile -t <toolchain> -m CUSTOM_F466RE

posted by Jenny Plunkett 02 Oct 2018

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

No worries! I'm glad you were able to figure out your issue.

- Jenny, team Mbed

posted by Jenny Plunkett 02 Oct 2018
5 years, 7 months ago.

Hi Jenny, I have the same problem that was described by Daniel, but I do not have any "custom_targets.json" file. I'm trying to compile and test the example "example-DISCO_L475_IOT-mbed-Cloud-connec" and I'm following the guide suggested here https://cloud.mbed.com/guides/connect/1?board=ST-Discovery-L475E-IOT01A

Please see below the error message I've got Error: #error directive: "Started from version 5.10.0 SDBlockDevice external repo is deprecated. please use the SDBlockDevice component inside mbed-os." in "sd-driver/SDBlockDevice.cpp", Line: 157, Col: 3

Would you give me some advise about how to solve the issue?

Thanks in advance, Gerardo

Are you using the sd-driver library? Try deleting it

posted by Daniel MAIORANO 05 Oct 2018