Skip to content

Commit f466b49

Browse files
authored
docs(sdcardio): clarify SD-first init rule for boards with floating CS pins
The existing "Important" note says the SD card must always be initialized before any other SPI peripheral. This is correct in most cases, but is misleading for boards like the Feather RP2040 RFM where the co-located peripheral (RFM95) has a floating CS pin with no hardware pull-up. On those boards the floating CS corrupts the SPI bus during SD init, so that peripheral's CS must be driven HIGH first. Added an exception paragraph to the important block to document this case.
1 parent 75659f7 commit f466b49

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

shared-bindings/sdcardio/SDCard.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@
4343
//| Failure to do so can prevent the SD card from being recognized until it is
4444
//| powered off or re-inserted.
4545
//|
46+
//| Exception: on boards where another SPI peripheral has a floating CS
47+
//| pin with no hardware pull-up (such as the Feather RP2040 RFM), that
48+
//| peripheral's CS must be driven HIGH before SD card initialization.
49+
//| Failure to do so will corrupt the SPI bus during SD card init. In
50+
//| these cases, initialize and drive the other peripheral's CS high
51+
//| first, then initialize the SD card.
4652
//| Example usage:
4753
//|
4854
//| .. code-block:: python

0 commit comments

Comments
 (0)