Im using an Arduino Mega and an Ethernet shield v1. In the shield I use both the network and SD card capabiltiies
Right after powerup, first thing I do is initialize the sdcard. 9/10 times I get things going on perfectly.
But then, suddenly, one SD initialization fails.
This happens, with basically same “rate”, in 3 complete prototypes I have assembled.
With this I mean it’s not related to wiring or using a wrong CS pin or so. It works, I read my config file from the card, write logs to the card, but then suddenly, once a day, it fails to initilize during startup
I’ve tried the usual startup:
I’ve tried this first:
if (card.init(SPI_FULL_SPEED, 4))
if (card.init(SPI_HALF_SPEED, 4))
if (card.init(SPI_QUARTER_SPEED, 4))
I found that function to (I guess) low-level initialize the card at different SPI speeds so I try to use the highest one that wors…I basically get the same result, it randomly fails to init
Any hint on what it could be?
PD: It’s not the ethernet shield, tried v2 and got the exact same result