cancel
Showing results for 
Search instead for 
Did you mean: 

How can I find SDIO problem?

Arman Ilmak
Senior

Hey guys.

Im using stm32f103rct6 and sdio for sd card.

My problem is that when using fatfs functions i get different errors that are random. For example once it gives me disk error but the next time it gives me disk not ready in a same operation.

How can i see if its hardware error or software?

Are SDIO pins high frequency and need high frequency specifications? Someone told me you should not have vias on sdio connections.

7 REPLIES 7
Arman Ilmak
Senior

Here is the schematic.

Arman Ilmak
Senior
 

The 1K pulls look a tad aggressive, 33K or 47K would be more appropriate.

I'd be surprised if you're clocking the interface above 24 MHz, but no configuration is mentioned.

For short traces, I'd probably back-off the slew-rate (SPEEDR, not 100 MHz edges), the use of 27R or 33R series resistors can help stop ringing.

You'd ideally want all the traces of a relatively uniform length and similar trace/via profiles end to end, you want to avoid skewing on the data pins, clock

Failure tends to cascade, if you break the interface/protocol subsequent commands will continue to fail.

You should instrument DISKIO to see what sequences/error occur, FATFS sometimes doesn't propagate errors efficiently, and users often ignore error returns.

Perhaps use a logic analyzer if you suspect the hardware, have the DISKIO instrumentation trigger the LA when it detects failure.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I changed the resistors to 40.2k that i had but still i get errors and files are not created.

The clk pin signal is attached.

 Mount_SD("/"); gives disk not ready and sometimes disk error.

 Format_SD(); gives disk error.

 Create_File("FILE1.TXT"); gives disk error.

 Create_File("FILE2.TXT"); gives disk error.

 Unmount_SD("/"); gives ok.

Whaere can i find diskio for f103 hal?

I just get fr_invalid_drive from this function.

fresult = f_mount(&fs,0,0);

I wonder why your CLK signal is a sine wave. Usually logic signals are square waves.