• It could be interrupts I guess (especially on Serial IO). SPI is a little frustrating in that the hardware output buffer is effectively 2 bytes but the input buffer is 0ne byte, so it's amazingly easy to lose a byte if you don't service SPI immediately.

    However that's unlikely to be the problem, as you should get an SPI timeout in that case. Could you maybe try reformatting the card on your PC as FAT32 (it could be that there is something strange with the existing formatting).

    You could also try calling SPI2.setup({sck:B13,miso:B14,mosi:B15,baud:100000}) after you've first used the SD card. That should push SPI into a lower bit rate which may solve problems if they are to do with IRQs.

About

Avatar for Gordon @Gordon started