I can't get SdFat to work.
Setup:
• STM32F103C8 BluePill clone
• Official ST Core
• Arduino IDE 1.8.13
• SD module wired to SPI1 (SS = PA4, SCK = PA5, MISO = PA6, and MOSI = PA7)
• SdFat v2.0.4
The standard Arduino SD example "Cardinfo.ino" (uses SD.h) works, so my wiring and power are correct:
(I printed the various SPI pins to check their value)
Code: Select all
SD Example Program Cardinfo uses SD.h
Changed 4 to SS
const int chipSelect = SS;
SPI 1 Settings
MISO is:26 PA6 is:26
MOSI is:27 PA7 is:27
SCK is:25 PA5 is:25
SS is:24 PA4 is:24
SPI 2 Settings
SPI2 MISO/PB14 is:14
SPI2 MOSI/PB15 is:13
SPI2 SCK/PB13 is:15
SPI2 CSS/PB12 is:16
Initializing SD card...Wiring is correct and a card is present.
Code: Select all
Use a freshly formatted SD for best performance.
Type any character to start
FreeStack: 17576
begin() failed
Do not reformat the SD.
SdError: 0XC,0X7F
Code: Select all
SPI 1 Settings
MISO is:26 PA6 is:26
MOSI is:27 PA7 is:27
SCK is:25 PA5 is:25
SS is:24 PA4 is:24
SPI 2 Settings
SPI2 MISO/PB14 is:14
SPI2 MOSI/PB15 is:13
SPI2 SCK/PB13 is:15
SPI2 CSS/PB12 is:16
Use a freshly formatted SD for best performance.
Type any character to start
FreeStack: 17576
begin() failed
Do not reformat the SD.
SdError: 0XC,0X7F
Thanks in advance for any suggestion or help.