SD Library in PlatformIO (VS Code)

Davidelvig

Well-known member
I'm been using SD functions on my Teensy 3.2-based board for a couple of years without known issues...
Until this last week.
Turns out I have a library dependency to the SparkFun SD library.
I removed that.
I tried to find the Teensy SD library within PlatformIO's library search and could not find a clear choice.

I downloaded the code from
https://github.com/PaulStoffregen/SD

It all seems to work, and the bug I was seeing is gone.

It's the first library I've had to manually install when using PlatformIO.

My platformIO.ini file looks like the snip below.
Should I be able to find a Teensy SD library within PlatformIO?
(or not need it explicitly due to inclusion of some more general Teensy library)

Thanks!

Code:
[env:teensy31]
platform = teensy
board = teensy31
framework = arduino
build_flags = -D USB_MIDI_SERIAL -D TEENSY_PLATFORM
lib_deps = 
	sstaub/TeensyID@^1.3.1
	sparkfun/SparkFun 9DoF IMU Breakout - ICM 20948 - Arduino Library@^1.1.2
	adafruit/Adafruit GFX Library@^1.10.4
	adafruit/Adafruit ST7735 and ST7789 Library@^1.6.0
	adafruit/Adafruit BusIO@^1.7.1
	robtillaart/RunningMedian@^0.3.7
	ivanseidel/LinkedList@0.0.0-alpha+sha.dac3874d28
	arduino-libraries/Madgwick@^1.2.0
lib_extra_dirs = 
	../dbLibraries
 
Davidelvig:
Did you try simply adding #include "SD.h" at the top of your code or in the .h file?
This works fine for me in PlatformIO.

Regards,
Ed
 
Indeed, I can remove the SD subdirectory, and it compiles without error.
I was lost in the debugging permutations.
Thanks, Ed!
 
Back
Top