I’m pretty new to PlatformIO. I’m trying to run the example below.
/*
Portenta - TestSDCARD
The sketch shows how to mount an SDCARD and list its content.
The circuit:
- Portenta H7 + Vision Shield
- Portenta H7 + Portenta Breakout
This example code is in the public domain.
*/
#include "SDMMCBlockDevice.h"
#include "FATFileSystem.h"
SDMMCBlockDevice block_device;
mbed::FATFileSystem fs("fs");
void setup() {
Serial.begin(9600);
while (!Serial);
Serial.println("Mounting SDCARD...");
int err = fs.mount(&block_device);
if (err) {
// Reformat if we can't mount the filesystem
// this should only happen on the first boot
Serial.println("No filesystem found, formatting... ");
err = fs.reformat(&block_device);
}
if (err) {
Serial.println("Error formatting SDCARD ");
while(1);
}
DIR *dir;
struct dirent *ent;
int dirIndex = 0;
Serial.println("List SDCARD content: ");
if ((dir = opendir("/fs")) != NULL) {
// Print all the files and directories within directory (not recursively)
while ((ent = readdir (dir)) != NULL) {
Serial.println(ent->d_name);
dirIndex++;
}
closedir (dir);
} else {
// Could not open directory
Serial.println("Error opening SDCARD\n");
while(1);
}
if(dirIndex == 0) {
Serial.println("Empty SDCARD");
}
}
void loop() {
// Empty
}
This is example code from inside the framework. For some reason the Portenta_SDCard library in the same directory as all the others isn’t included when starting a project.
I tried modifying the .ini and adding the includes the code c_cpp_properties.json. All no luck.
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:portenta_h7_m7]
platform = ststm32
board = portenta_h7_m7
framework = arduino
lib_deps =
lasselukkari/aWOT@^3.4.0
Portenta_SDCARD
monitor_speed = 115200
Any ideas on how to get that library in?