I have installed the STM32SD library and am trying to get the Datalogger example to work. I am using a STM32F401CC generic board with an off-board eBay SD applique. The STM32F401CC is looking for MOSI to be on Pin 17, MISO on Pin 16 and SCK on pin 14.
During compile, there is a slew of errors
In file included from C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/Sd2Card.h:40,
from C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/STM32SD.h:22,
from C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\examples\Datalogger\Datalogger.ino:13:
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:58:40: error: variable or field 'BSP_SD_GetCardInfo' declared void
58 | #define HAL_SD_CardInfoTypedef HAL_SD_CardInfoTypeDef
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:115:28: note: in expansion of macro 'HAL_SD_CardInfoTypedef'
115 | void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:58:40: error: 'HAL_SD_CardInfoTypeDef' was not declared in this scope; did you mean 'HAL_SD_CardInfoTypedef'?
58 | #define HAL_SD_CardInfoTypedef HAL_SD_CardInfoTypeDef
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:115:28: note: in expansion of macro 'HAL_SD_CardInfoTypedef'
115 | void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo);
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:115:52: error: 'CardInfo' was not declared in this scope; did you mean 'SD_CardInfo'?
115 | void BSP_SD_GetCardInfo(HAL_SD_CardInfoTypedef *CardInfo);
| ^~~~~~~~
| SD_CardInfo
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:120:24: error: variable or field 'BSP_SD_MspInit' declared void
120 | void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:120:24: error: 'SD_HandleTypeDef' was not declared in this scope; did you mean 'SPI_HandleTypeDef'?
120 | void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
| SPI_HandleTypeDef
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:120:42: error: 'hsd' was not declared in this scope
120 | void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:120:47: error: expected primary-expression before 'void'
120 | void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:121:31: error: variable or field 'BSP_SD_Detect_MspInit' declared void
121 | void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:121:31: error: 'SD_HandleTypeDef' was not declared in this scope; did you mean 'SPI_HandleTypeDef'?
121 | void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
| SPI_HandleTypeDef
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:121:49: error: 'hsd' was not declared in this scope
121 | void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:121:54: error: expected primary-expression before 'void'
121 | void BSP_SD_Detect_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:122:26: error: variable or field 'BSP_SD_MspDeInit' declared void
122 | void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:122:26: error: 'SD_HandleTypeDef' was not declared in this scope; did you mean 'SPI_HandleTypeDef'?
122 | void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~~~~~~~~~~~~~
| SPI_HandleTypeDef
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:122:44: error: 'hsd' was not declared in this scope
122 | void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:122:49: error: expected primary-expression before 'void'
122 | void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:58:40: error: 'HAL_SD_CardInfoTypeDef' does not name a type; did you mean 'HAL_SD_CardInfoTypedef'?
58 | #define HAL_SD_CardInfoTypedef HAL_SD_CardInfoTypeDef
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/bsp_sd.h:64:21: note: in expansion of macro 'HAL_SD_CardInfoTypedef'
64 | #define SD_CardInfo HAL_SD_CardInfoTypedef
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\Richard\Documents\Arduino\libraries\STM32duino_STM32SD\src/Sd2Card.h:62:5: note: in expansion of macro 'SD_CardInfo'
62 | SD_CardInfo _SdCardInfo;
| ^~~~~~~~~~~
exit status 1
Error compiling for board Generic STM32F4 series.
Anyone had similar problems, or can help with solving this?
Problem compiling SD example on STM32SD Library
Post here all questions related to STM32 core if you can't find a relevant section!
Return to “General discussion”
Jump to
- Announcements
- New users start here
- ↳ Forum rules, FAQs and HowTo's
- ↳ Let us know a bit about you and your projects
- Arduino for STM32
- ↳ General discussion
- ↳ Ideas & suggestions
- ↳ Cores
- ↳ STM32 Core
- ↳ Builds and Announcements
- ↳ Code snippets
- ↳ Ideas & suggestions
- ↳ General discussion
- ↳ Installation and OS related
- ↳ Libraries & Hardware
- ↳ PR's bugs and enhancements
- ↳ LibMaple
- ↳ Builds and Announcements
- ↳ Code snippets
- ↳ General discussion
- ↳ Ideas & suggestions
- ↳ Installation and OS related
- ↳ Libraries & Hardware
- ↳ PR's bugs and enhancements
- ↳ Steve's LibMaple core
- ↳ General discussion
- ↳ PR's bugs and enhancements
- ↳ Projects
- ↳ IDE's
- ↳ Off topic
- Arduino for STM8
- ↳ General discussion
- ↳ Cores
- ↳ STM8 Core
- ↳ Other
- Boards
- ↳ Custom design boards
- ↳ Maple & Maple mini etc
- ↳ STM boards (Discovery, Eval, Nucleo, ...)
- ↳ All other boards
- ↳ STM32F0 based boards
- ↳ STM32F1 based boards
- ↳ STM32F2 based boards
- ↳ STM32F3 based boards
- ↳ STM32F4 based boards
- ↳ STM32F7 based boards
- ↳ STM32G0 based boards
- ↳ STM32G4 based boards
- ↳ STM32H7 based boards
- ↳ STM32L0 based boards
- ↳ STM32L1 based boards
- ↳ STM32L4 based boards
- ↳ STM32L5 based boards
- ↳ STM32MP1 based boards
- ↳ STM32WB based boards
- Bootloaders
- ↳ STM32 HID bootloader
- ↳ USB bootloader
- ↳ STM32 SD-Bootloader
- ↳ STM32 USB CDC bootloader
- Uploaders and debuggers
- ↳ STLink
- ↳ USB to Serial adaptors
- ↳ Black Magic Probe & other
- Dead Thread Graveyard
- ↳ Dead Thread Graveyard