2015-11-02 11:31 PM
Hi,
I use FreeRTOS and FatFS. Sometimes f_write() or f_close() return FR_DISK_ERR error, because of SD_TX_UNDERRUN error in BSP_SD_WriteBlocks(). Tested with 2Gb and 4Gb micro SD cards. How to solve this problem? I use ''stm32cubef7'' libraries, ''stm32f746g-discovery'' board and ''System Workbench for STM32'' IDE. I have read: https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/FreeRTOS%20%2b%20FatFs%20%28STM3240G%29%20-%20FR_DISK_ERR¤tviews=67 https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/SDIO%20Hardware%20Flow%20Control&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=256 https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=https%3a%2f%2fmy.st.com%2fpublic%2fSTe2ecommunities%2fmcu%2fLists%2fSTM32Java%2fCube%20F4%20v4.3%20and%20SDIO%20SD_TX_UNDERRUN%20error&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209... How to slow down clock (ClockDiv) or use DMA mode? #stm32f746discovery-fatfs-sd-card2015-11-03 12:19 AM
2015-11-03 05:55 AM
Thank you for the IOC file. Don't you have to set Maximum Output Speed of SDIO Pins
to Fast? Now Low is selected. Regards Werner2015-11-03 07:04 AM
2015-11-05 06:00 AM
Hi,
I still unable to get DMA working. I've attached *.ioc project, generated sources, and test function. Execution stops in HAL_SD_CheckReadOperation() waiting for DMA transfer complete. Can anyone help me? ________________ Attachments : sd_card3.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htnx&d=%2Fa%2F0X0000000aX8%2FDZKD9j3DrQC_NNB2tTSXdJlWADW_Sh6rcFabr51NmkA&asPdf=falsesd_card3.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HtYF&d=%2Fa%2F0X0000000aRf%2FDmoGnLpDOwrB2sJJzNbNIH2_O4m1PRfZKGR6Lz0g4Zs&asPdf=false2015-12-03 11:30 AM
Andrew,
Double check that the interrupt priority for the SDIO interrupt is logically higher (numerically lower in these ST chips) than the priorities for the DMA RX/TX interrupts.