Problem compiling SD example on STM32SD Library

Post here all questions related to STM32 core if you can't find a relevant section!
Post Reply
otter2016
Posts: 6
Joined: Wed Apr 15, 2020 8:38 pm

Problem compiling SD example on STM32SD Library

Post by otter2016 »

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?
Post Reply

Return to “General discussion”