Writing on a SD card, but nothing written
Hi,
you have to fill the function in user_diskio.c to initialize and use fatfs.
I adapted (?) the following files (I don’t remenber who told me that, sorry):
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Middlewares\Third_Party\FatFs\src\drivers\sd_diskio.c, it will be named as user_diskio.c
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c
- C:..\STM32Cube\Repository\STM32Cube_FW_L0_V1.8.0\Drivers\BSP\STM32L0xx_Nucleo\stm32l0xx_nucleo.c
I didn’t modify those files but only the headers (stm32_adafruit_sd.h,...) to connect have the right pins and settings on my board. I don’t know if you need to have a nucleo board to use the nucleo file but you can try.
My new bible is Carmine Norviello’s book : Mastering STM32. If what’s written here doesn’t work yet, try to use the initialization code given in this book (only in your main.c), I’ll try to find it if you need.