2018-01-31 03:48 AM
Hello,
A while I used stm32cubemx for generating a code for SD card connection to my stm32f4 with SDIO and FATFS middleware and it worked fine but after the recent cube update the similar code does not works for sd card. Luckily i found out the problem. It seems they have not initialized the card in SD_DISKIO.c in SD_initialize() function change the function to
DSTATUS SD_initialize(BYTE lun){ Stat = STA_NOINIT;if(BSP_SD_Init() == MSD_OK)
{ Stat &= ~STA_NOINIT; }return Stat;
}and it works fine also pull up the SDIO PINS.@@@
NOTE: DISABLE DMA IN FATFS IF NOT USING DMA IN SDIO. IT IS ENABLED BY DEFAULT IN FATFS contrary to previous versions.♯
#tipsandtricks2018-01-31 06:22 AM
There isn't an inherent problem using SDIO+DMA on the STM32F4 platform.
Would be interested in read/write statistic you're seeing in your implementation, say 32MB file in 32KB blocks?
2018-06-28 04:05 AM
No, this issue is in Middleware Generated by newer version of Cube .
2018-06-28 11:54 AM
Hello
altamash.ar96
This is known issue is already reported for fix and a
workaround
is suggested there:-
https://community.st.com/0D50X00009bMM8bSAG
You can test it. Then, let us know if it is working for you or i
f you still have problems.
With Regards,
Imen
2019-03-01 01:15 AM
@ Altamash Abdul Rahim: It is really helpful if you can mention in your post "which version" of stmcubemx you had been used.
I actually, have the similar problem. I am using stmcubemx version 4.21.0. and stm32f407vgt discovery. I could attach the micro SD slot, create file and write to it. But I couldn't see its contents by PC using usb device mass storage!! Now, post probably, I think that SD initialization is not truly done! This really blocks me this week:((
Do you guys know whether this problem is solved in stmcubemx version 4.21.0 or not? Or perhaps, do you know any better version?
Thank you,
Edmond
2019-03-01 10:31 PM
Hello,
The issue which i mentioned above, appeared in an CubeMx update which was 2-3 releases behind the current version (I do not remember the exact version). The issues were resolved in the newer versions.
2019-03-03 12:54 PM
Thank you all for your comments!
The problem is solved; this time in STMcubemx, I didn't check the Middlware/FATFS/SD! Only check the Middleware/USB/Mass Storage!
I think when FATFS is included (initialized), then USB mass storage doesn't work properly!
Do you guys have some suggestions how to use both (FATFS & USB device mass storage) in a single project (in a way that at first use FATFS to store data into SD card and then de-initialize FATFS and active USB MS)? Is it possible by STM32Cubemx?
Regards
Edmond