I am using the built in SD card on the Teensy 4.1, and it frequently fails to initialize with SD.begin. Sometimes it works and sometimes it doesn't.

chipSelect is set to BUILTIN_SDCARD

Pins 0-23 are used to support the application, pins 24-41 are open.

I have three different Teensy 4.1 units, two of which have 16MB RAM addd and one without. All will sometimes properly initialize a SD card, and all will often fail to initialize.

I have used both the example programs in the SD area, as well as my own code. The result is the same either way.

I have tried multiple SD cards including Sandisk 32GB and Onn 16GB. Same results.

I want to use the SD card to save data from an instrumentation interface application so I can later read it with a PC for analysis.

Any idea what is happening and what to do about it?