Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: PlatformIO: 'BUILTIN_SDCARD' was not declared in this scope

  1. #1
    Junior Member
    Join Date
    Jan 2023
    Posts
    8

    PlatformIO: 'BUILTIN_SDCARD' was not declared in this scope

    Hey All,

    I have been having difficulties with PlatformIO and Teensy 4.1 lately. I solved some of my issues by reinstalling Windows, but now I am having other problems.

    - When compiling my code, I get the following error: "'BUILTIN_SDCARD' was not declared in this scope." When using the SD.h library that I installed. I thought the Teensy used a special SD.h, but I can't find it.

    - I've re-installed Teensyduino and the Arduino IDE 2 and 1.

    - The code compiles and uploads in the Arduino IDE 2 and 1 without issue.

    - I was previously getting the following error: "Teensy's SD library uses a custom modified copy of SdFat. Standard SdFat was mistakenly used. Arduino should print multiple libraries found for SdFat.h. To resolve this error, you will need to move or delete the copy Arduino is using, or otherwise take steps to cause Teensy's special copy of SdFat to be used."

    Any help would be greatly appreciated! I really don't want to switch from PlatformIO to either of the IDEs... PIO is much faster to work with.

    Thanks!

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    27,966
    Quote Originally Posted by MopeyMilie View Post
    I thought the Teensy used a special SD.h, but I can't find it.
    Yes, Teensy uses a special SD library which is really just a thin wrapper for SdFat. Teensy also uses a customized copy of SdFat. Normally these are supposed to come automatically with the platform, at least when using Arduino IDE. Can't say how PlatformIO works. But I can give you links to both libraries on github.

    https://github.com/PaulStoffregen/SD

    https://github.com/PaulStoffregen/SdFat

    If you have installed Arduino IDE 1.8.19 and Teensyduino 1.57, these libraries should be in {Arduino}/hardware/teensy/avr/libraries. Or if using MacOS, control-click Teensyduino and look in Contents/Java for the hardware/teensy/avr/libraries folder.

  3. #3
    Junior Member
    Join Date
    Jan 2023
    Posts
    8
    Thank you so much!!! That fixed it!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •