2023-10-31 01:01 AM
i get `FR_NOT_READY`, `HAL_SD_ERROR_REQUEST_NOT_APPLICABLE` errors .
/* If requested card supports wide bus operation */
if((scr[1U] & SDMMC_WIDE_BUS_SUPPORT) != SDMMC_ALLZERO)
{
//...
return HAL_SD_
return HAL_SD_ERROR_REQUEST_NOT_APPLICABLE;
}ERROR_NONE;
}
else
{
How do I fix this and make SD card work with 4bits wide bus?
sd card scematic (part number-GTFP08431BEU)
Microcontroller scematic -
2023-10-31 03:59 AM
Hello @Rushikesh1234
I'm not sure if it's related to the same issue discussed in this thread.
Solved: SDIO interface not working in 4Bits with STM32F4 F... - STMicroelectronics Community
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-31 06:24 AM
i do the changes , but still it not fix
thanks regards,
2023-11-02 03:08 AM
this same problem i have , i am using stm cubeide version 1.12.1
2023-11-06 03:00 AM
Hello again @Rushikesh1234
Which cube firmware version do you use? You need to update the CubeIDE as well... Have you managed to initialize the FAT filesystem with single wide bus? Additional context about the use case and sharing your project would be helpful to investigate further.
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-11-06 04:05 AM - edited 2023-11-06 04:44 AM
hello,
i am using stmcubeide version 1.12.1, and both 1 and 4 bit wide bus are not work
when i use 4 bir mode it returns (FR_NOT_READY) error and for 1 bit mode it returns (FR_DISK_ERR) error.
code -
2023-11-06 04:45 AM
Hi,
Does it work in 1 bit bus mode?
I had a bug when I configured it in the config .IOC to 4bit, it didn't work. However if I configured it as 1 bit, and in user-code of SDMMC init, added one extra function to turn it back to 4 bit, it worked.
static void MX_SDMMC1_SD_Init(void)
{
hsd1.Instance = SDMMC1;
hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING;
hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE;
hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B;
hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE;
hsd1.Init.ClockDiv = 4;
if (HAL_SD_Init(&hsd1) != HAL_OK)
{
Error_Handler();
}
if (HAL_SD_ConfigWideBusOperation(&hsd1, SDMMC_BUS_WIDE_4B) != HAL_OK)
{
Error_Handler();
}
}
Another Question is:
- What is the clock frequency? (See you are using clock divide factor of 0) Maybe it is too high. (I am using 96MHz with CK.DIV=4)
- What SD card are you using? Class, and model
- How is your FATFS --> Platform settings --> Detect_SDIO pin configures and connected?
-
2023-11-06 05:11 AM
static void MX_SDMMC1_SD_Init(void) { hsd1.Instance = SDMMC1; hsd1.Init.ClockEdge = SDMMC_CLOCK_EDGE_RISING; hsd1.Init.ClockPowerSave = SDMMC_CLOCK_POWER_SAVE_DISABLE; hsd1.Init.BusWide = SDMMC_BUS_WIDE_1B; hsd1.Init.HardwareFlowControl = SDMMC_HARDWARE_FLOW_CONTROL_DISABLE; hsd1.Init.ClockDiv = 4; if (HAL_SD_Init(&hsd1) != HAL_OK) { Error_Handler(); } if (HAL_SD_ConfigWideBusOperation(&hsd1, SDMMC_BUS_WIDE_4B) != HAL_OK) { Error_Handler(); } }
i tried this but it not work, the clock frequency is 16 MHz, i use sandisk 8 gb sd card
and yes Detect_SDIO is configured and connected in FATFS Platform setting.
2023-11-06 05:19 AM
static void MX_SDIO_SD_Init(void)
{
hsd.Instance = SDIO;
hsd.Init.ClockEdge = SDIO_CLOCK_EDGE_RISING;
hsd.Init.ClockBypass = SDIO_CLOCK_BYPASS_DISABLE;
hsd.Init.ClockPowerSave = SDIO_CLOCK_POWER_SAVE_DISABLE;
hsd.Init.BusWide = SDIO_BUS_WIDE_1B;
hsd.Init.HardwareFlowControl = SDIO_HARDWARE_FLOW_CONTROL_DISABLE;
hsd.Init.ClockDiv = 4;
HAL_SD_DeInit(&hsd); //In case of re-initialization
if (HAL_SD_Init(&hsd) != HAL_OK)
{
return 1;
}
if (HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B) != HAL_OK)
{
return 1;
}
return 0;
}
You did rewrite it to look like this? Since you are using SDIO and not SDMMC1?
2023-11-06 05:26 AM
thanks for replying,
Yes i do changes according SDIO , still it won't work.