2022-12-23 05:49 AM
I have a STM32F407 with an SD card wired in 4-bytes mode and FATFS middleware to manage the files.
I upgraded to STM32CubeIDE 1.11 two weeks ago, but since then the SD card stopped working. The initialization fails in the SD_WideBus_Enable function, since scr[1] is read as 0 (file stm32f4xx_hal_sd.c).
I noticed that this behavior disappears when I set hsd.Init.BusWide = SDIO_BUS_WIDE_1B in MX_SDIO_SD_Init (file sdio.c). This, however, was changed in SDIO_BUS_WIDE_4B in the newer version of the IDE, breaking the functionality.
I was not able to check whether the SD actually works in 4-bits mode when initialized to SDIO_BUS_WIDE_1B, but I think so, since the HAL_SD_ConfigWideBusOperation gets called with 4 bytes.
So, is it correct to continue using SDIO_BUS_WIDE_1B? If so, how can I preserve it, since every time I let Cube to generate the files the modification gets overwritten?
Solved! Go to Solution.
2023-01-02 06:31 AM
Hi @FRugi.1 & @DDi S.1 ,
An explanation of what was updated is provided by @Ghofrane GSOURI in this thread: SDCARD does not work (FR_NOT_READY) when migrating from FW_F4 V1.27.0 to newer FW_F4 V1.27.1.
Could you please refer to it?
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2022-12-26 06:47 AM
Hi.
I did it this way and I hope it helps you.
in main.c put the following line:
/* USER CODE BEGIN 2 */
hsd.Init.BusWide = SDIO_BUS_WIDE_1B;
2023-01-02 06:31 AM
Hi @FRugi.1 & @DDi S.1 ,
An explanation of what was updated is provided by @Ghofrane GSOURI in this thread: SDCARD does not work (FR_NOT_READY) when migrating from FW_F4 V1.27.0 to newer FW_F4 V1.27.1.
Could you please refer to it?
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-10-29 08:43 PM
thunks, however you are!!