Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot compile fatfs on STM32F407VE (stm32duino framework) #716

Open
Split7fire opened this issue Aug 6, 2023 · 1 comment
Open

Cannot compile fatfs on STM32F407VE (stm32duino framework) #716

Split7fire opened this issue Aug 6, 2023 · 1 comment

Comments

@Split7fire
Copy link

As usual add STM32SD library to project and try to compile. Error message:

.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:240:3: error: unknown type name 'BSP_SD_CardInfo'; did you mean 'SD_CardInfo'?
  240 |   BSP_SD_CardInfo CardInfo;
      |   ^~~~~~~~~~~~~~~
      |   SD_CardInfo
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:255:24: warning: passing argument 1 of 'BSP_SD_GetCardInfo' from incompatible pointer type [-Wincompatible-pointer-types]
  255 |     BSP_SD_GetCardInfo(&CardInfo);
      |                        ^~~~~~~~~
      |                        |
      |                        int *
In file included from .pio/libdeps/black_f407ve/STM32duino STM32SD/src/ffconf.h:9,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff.h:29,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff_gen_drv.h:58,
                 from .pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:49:
.pio/libdeps/black_f407ve/STM32duino STM32SD/src/bsp_sd.h:178:52: note: expected 'HAL_SD_CardInfoTypeDef *' but argument is of type 'int *'
  178 | void    BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:257:29: error: request for member 'LogBlockNbr' in something not a structure or union
  257 |     *(DWORD*)buff = CardInfo.LogBlockNbr;
      |                             ^
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:267:24: warning: passing argument 1 of 'BSP_SD_GetCardInfo' from incompatible pointer type [-Wincompatible-pointer-types]
  267 |     BSP_SD_GetCardInfo(&CardInfo);
      |                        ^~~~~~~~~
      |                        |
      |                        int *
In file included from .pio/libdeps/black_f407ve/STM32duino STM32SD/src/ffconf.h:9,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff.h:29,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff_gen_drv.h:58,
                 from .pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:49:
.pio/libdeps/black_f407ve/STM32duino STM32SD/src/bsp_sd.h:178:52: note: expected 'HAL_SD_CardInfoTypeDef *' but argument is of type 'int *'
  178 | void    BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:268:28: error: request for member 'LogBlockSize' in something not a structure or union
  268 |     *(WORD*)buff = CardInfo.LogBlockSize;
      |                            ^
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:278:24: warning: passing argument 1 of 'BSP_SD_GetCardInfo' from incompatible pointer type [-Wincompatible-pointer-types]
  278 |     BSP_SD_GetCardInfo(&CardInfo);
      |                        ^~~~~~~~~
      |                        |
      |                        int *
In file included from .pio/libdeps/black_f407ve/STM32duino STM32SD/src/ffconf.h:9,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff.h:29,
                 from .pio/libdeps/black_f407ve/FatFs/src/ff_gen_drv.h:58,
                 from .pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:49:
.pio/libdeps/black_f407ve/STM32duino STM32SD/src/bsp_sd.h:178:52: note: expected 'HAL_SD_CardInfoTypeDef *' but argument is of type 'int *'
  178 | void    BSP_SD_GetCardInfo(HAL_SD_CardInfoTypeDef *CardInfo);
      |                            ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
.pio/libdeps/black_f407ve/FatFs/src/drivers/sd_diskio.c:279:29: error: request for member 'LogBlockSize' in something not a structure or union
  279 |     *(DWORD*)buff = CardInfo.LogBlockSize / SD_DEFAULT_BLOCK_SIZE;
      |                             ^
*** [.pio/build/black_f407ve/lib7df/FatFs/drivers/sd_diskio.c.o] Error 1

Platformio config:

platform = ststm32
board = black_f407ve
framework = arduino
build_flags = 	-D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC
				-D configMEMMANG_HEAP_NB=3
lib_deps = 
	stm32duino/STM32duino FreeRTOS@^10.3.2
	stm32duino/STM32duino STM32SD@^1.3.1 

I also tried to enable -D HAL_SD_MODULE_ENABLED but with no luck. It was already defined. Example sdfat project successfully compiles in ArduinoIDE btw.

Any help?

@Split7fire
Copy link
Author

Update: seems to compile with STM32SD version 1.2.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant