cancel
Showing results for 
Search instead for 
Did you mean: 

sdcard not working

Sansel
Associate

we are using stm32f103c8t6 and stm32f407vet6 microcontrollers. we were able to communicate with sandisk and other brand sdcards but hp sdcard (Class 10, UHS-I, U1) is not communicating . hp sdcard working with card reader and we have formatted in FAT32 format in hp sdcard. please provide the solution for this issue. we are using stm32cube ide and hall librarysdcards hp.png.

 

 

3 REPLIES 3
Saket_Om
ST Employee

Hello @Sansel 

 What is the error you are getting? Are you using SDIO or SPI driver? 

Could you please share with us the content of SDIO or SPI register when getting the error? 

 

If your question is answered, please close this topic by clicking "Accept as Solution".

Thanks
Omar
AScha.3
Chief II

>we were able to communicate with sandisk and other brand sdcards but hp sdcard (Class 10, UHS-I, U1) is not communicating

Solution : dont use this "hp" card.

Where you buy it ? (google shows no source for sd-cards by hp ! )

So maybe same fake product, like my "Lenovo" sd-card from aliexpress (google shows no source for sd-cards by Lenovo ! )

AScha3_0-1717061329505.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Hi [Saket_Om],

Thank you for your inquiry regarding the error we are encountering.

### Driver in Use We are using the **SDIO driver** to interface with the SD Card.

 

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 = 5;

if (HAL_SD_Init(&hsd) != HAL_OK) { Error_Handler(); } // Enable wide bus operation (4-bit mode)

if (HAL_SD_ConfigWideBusOperation(&hsd, SDIO_BUS_WIDE_4B) != HAL_OK)

{ Error_Handler(); }

}