FatFS / STM32SD cannot compile examples
Posted: Sat Jul 04, 2020 11:23 am
Getting started trying to use FatFS and/or STM32SD. I have to say I find the lack of documentation and working examples very difficult. I see in another thread that someone has the same compile errors and this was because his board did not have SDIO.
I have a NUCLEOF429ZI which I *know* has SDMMC - is this the same as SDIO? if not, how do I get around this? Are there any working examples? Is it too much to ask to provide a list of supported boards in the documentation? Or maybe at least *one* example in FatFS. I am happy and experienced enough to get most things working if I can find documenation for them - is there a guide anywhere?
Making it harder is this:
I tried the Cardinfo example from STM32SD using boards/core 1.9.0 and:
Using library STM32SD-master at version 1.2.2 in folder: C:\Users\phil\Documents\Arduino\libraries\STM32SD-master
Using library FatFs-master at version 2.0.3 in folder: C:\Users\phil\Documents\Arduino\libraries\FatFs-master
I get the following errors:
I have a NUCLEOF429ZI which I *know* has SDMMC - is this the same as SDIO? if not, how do I get around this? Are there any working examples? Is it too much to ask to provide a list of supported boards in the documentation? Or maybe at least *one* example in FatFS. I am happy and experienced enough to get most things working if I can find documenation for them - is there a guide anywhere?
Making it harder is this:
- but neither of those files exist in the version of FatFS I just downloaded.FatFs
The FatFs has several user defined options, which is specified from within the ffconf.h file.
This library provides a default user defined options file named ffconf_default.h
I tried the Cardinfo example from STM32SD using boards/core 1.9.0 and:
Using library STM32SD-master at version 1.2.2 in folder: C:\Users\phil\Documents\Arduino\libraries\STM32SD-master
Using library FatFs-master at version 2.0.3 in folder: C:\Users\phil\Documents\Arduino\libraries\FatFs-master
I get the following errors:
Code: Select all
In file included from C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\src/Sd2Card.h:40,
from C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\src/STM32SD.h:22,
from C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\examples\CardInfo\CardInfo.ino:12:
C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\src/bsp_sd.h:120:47: error: expected primary-expression before 'void'
120 | void BSP_SD_MspInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~
C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\src/bsp_sd.h:122:49: error: expected primary-expression before 'void'
122 | void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params);
| ^~~~
C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\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\phil\Documents\Arduino\libraries\STM32SD-master\src/bsp_sd.h:64:21: note: in expansion of macro 'HAL_SD_CardInfoTypedef'
64 | #define SD_CardInfo HAL_SD_CardInfoTypedef
| ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\phil\Documents\Arduino\libraries\STM32SD-master\src/Sd2Card.h:62:5: note: in expansion of macro 'SD_CardInfo'
62 | SD_CardInfo _SdCardInfo;
| ^~~~~~~~~~~