cancel
Showing results for 
Search instead for 
Did you mean: 

Microcontroller STM32L452RET6 using to interface SD card with SDIO(4bit bus) fatfs, freertos and dma by STMCube generated code. But generated code is not working and even Card Mount is not possible. What is the reason?? Please answer ASAP

KPras.2
Associate III
 
6 REPLIES 6
Ghofrane GSOURI
ST Employee

Hello @KPras.2​ 

First let me thank you for posting.

To be able to push further the analysis could you please provide your file .ioc which show the problem.

I'll be waiting for your feedback.

Thx

Ghofrane

KPras.2
Associate III

I am using STMCubeMx ver 6.6.1.

Ghofrane GSOURI
ST Employee

Hello @KPras.2​ 

I tried to reproduce the behavior you encountered but it works fine from my side.

I activated the SD card with SDIO(4bit bus) fatfs, freertos and dma then i generated the code

using STM32CubeIDE.

I put below my file ioc please have a look .

If you supply the ioc-file, we can try to re-produce the issue with your exact configuration.

I'll be waiting for your feedback.

Thx

Ghofrane

KPras.2
Associate III
void sd_card_mount_card_capacity (void)
{
    if(f_mount(&SDFatFS, (TCHAR const*)SDPath, 1) != FR_OK)
    {
       SendString("SD card mounting error");//  Display capacity 
        Error_Handler();
    }
    else
    {
#if 1
	{
	    uint8_t buf[30];
	   sprintf(buf,"SD_Cap %llu \n\r", ((unsigned long 
                       long)hsd1.SdCard.BlockSize * hsd1.SdCard.BlockNbr));
	   SendString(buf);
	}
#endif
    }
}

Dear Sir,

Sorry for the late reply. Actually i was on the leave due to some personal work.

I have seen your ioc.

Please find attached our ioc and check the configuration.

I have tested. It is not working.

Also please see the our function of the mounting of the SD card and Total space available of the SD card.

This function reply to us - SD card mounting error.

Please suggest any modifications required for the working ok.

Regards

Kameshwar Prasad

Might not be a software issue​, your hardware implementation is not shown or described.

I​ssue isn't with superficial top level code, you're going to have to dig into the DiSKIO and SDIO code, perhaps instrumenting that to understand how it flows and breaks.

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

Thanks for your reply.

With same h/w SD fatfs is working ok with sdio 4bits in interrupt and poling mode without dma and freertos. So H/W is ok.