SD卡和TF卡管脚定义有区别,需要注意。
* +-------------------------------------------------------+
* | Pin assignment |
* +-------------------------+---------------+-------------+
* | STM32 SPI Pins | SD | Pin | TF Pin
* +-------------------------+---------------+-------------+
* | SD_SPI_CS_PIN | ChipSelect | 1 | 2
* | SD_SPI_MOSI_PIN / MOSI | DataIn | 2 | 3
* | | GND | 3 (0 V) |
* | | VDD | 4 (3.3 V) | | 4
* | SD_SPI_SCK_PIN / SCLK | Clock | 5 | 5
* | | GND | 6 (0 V) | 6 | 6
* | SD_SPI_MISO_PIN / MISO | DataOut | 7 | 7
* +-------------------------+---------------+-------------+
来源:https://www.cnblogs.com/glguan/archive/2011/08/25/2153124.html