Teensy 4.0: Ethernet Library causing SD Errors

jimmie

Well-known member
This problem has been reported in:

http://forum.pjrc.com/threads/57478-Teensy-4-0-SD-Buggy-Implementation

I have been having lots of problems with my SD card attachment which is connected to a Teensy 4.0 along with a WIZ850IO.

I have followed all the guidelines regarding setup. I have also tried different SD cards. Using the SD library, the card would only be recognized about half the time.

After I gave up on the Teensy's SD library, I switched to the SDFat-Beta library. In this case, the card is recognized 100% of the time. However, after writing a couple of relatively small files (20kb), the card stops writing and the filesystem is corrupted with very large files (1 MB).

======================================================================

I have isolated the reason to the Ethernet side. When I did not use Ethernet.begin, the SD card worked 100% of the time.

When I executed the following statements before writing to the SD card, they did not help. I still got file corruption.

Code:
// disable Ethernet chip
pinMode(10, OUTPUT);
digitalWrite(10, HIGH);

I have tried both the Ethernet and the Ethernet2 libraries.

With my limited knowledge of the SPI bus, this leads me to believe that there is a bug in the Ethernet library when used with a Teensy 4.0.

BTW, in the absence of SD-card operations, the Ethernet library works fine. So this problem can only be duplicated by using an SD card in addition to starting the Ethernet interface.
 
Back
Top