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

Thread: Intermittent SD initialization with Teensy 4.1

  1. #1
    Junior Member
    Join Date
    Oct 2020
    Posts
    2

    Intermittent SD initialization with Teensy 4.1

    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?

  2. #2
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,710
    what version of TeensyDuino?

    last tried here was with sdFat-Beta library that worked multiple times, tested with TD 1.54b2. So the T_4.1 hardware works - with a good SD Card.

    The card in use and how formatted could be an issue. Also assuring Teensy isn't low on supply power if anything else starting up from shared Teensy power ...

    More details could lead to better ideas ...

  3. #3
    Junior Member
    Join Date
    Oct 2020
    Posts
    2
    Quote Originally Posted by defragster View Post
    what version of TeensyDuino?

    last tried here was with sdFat-Beta library that worked multiple times, tested with TD 1.54b2. So the T_4.1 hardware works - with a good SD Card.

    The card in use and how formatted could be an issue. Also assuring Teensy isn't low on supply power if anything else starting up from shared Teensy power ...

    More details could lead to better ideas ...

    Thanks for the reply. I am using TD 1.53 with the Arduino 1.8.13 IDE.
    SD cards are new, formatted for Fat32, and work fine in a PC with a USB card R/W.
    Power is from the USB - no external. Seems to have plenty of power as the app also drives a tricolor LED from time to time at full brightness. No noticeable voltage drop either.

  4. #4
    Member
    Join Date
    Oct 2019
    Location
    Calgary
    Posts
    85
    This is how I start things up with SdFat-beta (in use since June of this year with no issues):
    Code:
    SD SdFat;
       .
       .
       .
    if (SD.begin(SdioConfig(FIFO_SDIO))) {
       .
       .
       .

  5. #5
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Posts
    12,710
    To test everything and for fast SD usage if that is all that is needed this should work:

    github.com/greiman/SdFat-beta

    it has example sdinfo and formatter

Posting Permissions

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