I have implemented an SD/FAT combination on a Renesas RL78/G13 processor. The SD card is being driven using SPI.
The code has been proven to work on two custom target boards using a 2GB card - the SD can initialise properly via the FAT middleware and a file can be created on the card and written to. The result can be confirmed by plugging the card into a Windows machine and reading the file.
Suddenly, as if by magic, the SD card stopped working recently. Using a debugger, I tracked the problem down to the first time the FAT initialisation sequence tries to do a data read operation.
The sending of CMD17 (Read Single Block) and its response are handled correctly, but when the data packet is clocked-in (dummy 0xFF clocked-out on SO), the processor seems to reset (I get pre-main code being run, which I can confirm through my debug log).
I am wondering whether SD power is an issue. Due to other aspects of the board design, we're seeing ~2.9V for SD power and SPI comms. I can only ever see references to 3.3V for SD SPI, but does it really need to be exactly that? Could this be causing the issue, or is this a red herring and there's another reasoning?
Any help would be greatly appreciated.
transfer_data
method, so I can't imagine that would be any issue. I tried setting a breakpoint in the interrupt after the command to transfer the data is called and I can't even get there - the processor resets before this point. \$\endgroup\$