Skip to main content
Associate
May 30, 2024
Question

sdcard not working

  • May 30, 2024
  • 3 replies
  • 1842 views

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.

 

 

This topic has been closed for replies.

3 replies

ST Technical Moderator
May 30, 2024

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? 

 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Saket_Om
SanselAuthor
Associate
May 30, 2024

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(); }

}

 

 

 

 

AScha.3
Super User
May 30, 2024

>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 on " Best Answer ".