Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
5 years, 3 months ago.
Running the SDBLOCKDEVICE example code
Hello, i'm using the NUCLEO F411RE board, together with a DIGILENT PMODSD card board. To access this SD card I'm trying to compile the example present in the following link: https://os.mbed.com/docs/mbed-os/v5.13/apis/sdblockdevice.html
However this code does not compile, and the only error I get is: "Internal Error", with no other details. I'm stumped. I've also attached the code files/media/uploads/ryudas/main.cpp , as well as the images of the json objects and project structure
I've tried changing quite a few things, to no avail
1 Answer
5 years, 3 months ago.
Hello John,
Because you have the mbed
library attached to your project you are trying to build an Mbed OS-2 (aka Mbed Classic) program. However, the SDBlockDevice
is designed for Mbed OS-5:
- Delete your current
SDCardTest
project from the online compiler. - When creating a new one, make sure you select an Mbed OS-5 template. For example
Blinky example for mbed OS 5.0 ...
. Once created, you should see thembed-os
library attached to the newSDCardTest
project rather than thembed
one. - Replace the
main.cpp
with the one from theSDBlockDevice
example. - Add the
mbed_app.json
file (with the same content as before). - Do not add the
targets.json
file.
For more examples have a look at:
Thank you very much for your response. I dont get an internal error anymore, however I do get : Error: Could not parse mbed app configuration from /tmp/chroots/ch-1ba86681-6b4b-4fc3-9638-df40ede89799/src/mbed_app.json, although I followed the examples yet again.
Would you know why this json is not being parsed?
Thanks again for all your help
posted by 19 Aug 2019Copy & paste
the following text into the mbed_app.json
file. It worked fine for me:
mbed_app.json
{ "target_overrides": { "*": { "target.components_add": ["SD"], "sd.SPI_MOSI": "D11", "sd.SPI_MISO": "D12", "sd.SPI_CLK": "D13", "sd.SPI_CS": "D9" } } }
Repeat compilation until it succeeds.
posted by 19 Aug 2019