2015-11-12 06:04 AM
In the current release of CubeMX V4.11.0 using the latest F4 libraries, V1.9.0, a bug has been introduced that makes the SDIO DMA channels useless. In the previous library set, V1.8.0, when the DMA channels were selected for the SDIO peripheral, the DMA options were in a random state leaving it up to the user to figure out what parameters and modes were appropriate for the peripheral including DMA mode, FIFO functions and address incrementing. In the V1.9.0 this issue is addressed by having the tool automatically fill in what appear to be appropriate parameters for the tx and rx DMA channels when they are added. However on closer examination of the .ioc file produced by cube, even though in the configuration window the Mode is locked to ''Peripheral Flow Control'', which is appropriate for the SDIO DMA channels, in the .ioc file this parameter is set to ''DMA_NORMAL'' instead of ''DMA_PFCTRL''. There is no way to change this through the tool that I can find, but manually editing the .ioc file and restarting CubeMX resolves the problem. I have attached two .ioc files, F4_SD.ioc initially generated with the V1.8.0 F4 libraries that has the correct setting of this parameter for rx and tx (around lines 17 and 27) and SD_FAT.ioc generated with the V1.9.0 libraries which has the wrong setting in the .ioc file, but when this file is opened with Cube V4.11.0 the configuration screen for the DMA channels, both in the DMA config window and the SDIO config window shows the correct selection of Peripheral Flow Control.
#f42015-11-13 02:29 AM
Dear user,
Thank you for pointing out this issue. Shall be fixed asap. Best regards2015-11-27 05:22 PM
Hi all,
I may be wrong, but from memory, I think it is that you cannot use ''peripheral flow control'' for SDIO via DMA with the F4 as there is a silicon level bug??Jason2015-11-30 10:17 AM
Peripheral flow control works just fine with SDIO and DMA on the 32F407 on the F4 discovery board. In fact it is the only way the SDIO will work with DMA as far as I can see. It is just the CubeMX tool that is breaking this. In fact it correctly shows the configuration to the user, it just generates the wrong parameter in the .ioc file that it then creates.
2015-12-01 02:49 AM
Dear users,
Please note this issue will be solved in STM32CubeMX next release: 4.12.02015-12-08 05:26 PM
Copied from errata sheet for F4:
2.9 SDIO peripheral limitations2.9.1 SDIO HW flow controlDescriptionWhen enabling the HW flow control by setting bit 14 of the SDIO_CLKCR register to ‘1’,glitches can occur on the SDIOCLK output clock resulting in wrong data to be written intothe SD/MMC card or into the SDIO device. As a consequence, a CRC error will be reportedto the SD/SDIO MMC host interface (DCRCFAIL bit set to ‘1’ in SDIO_STA register).WorkaroundNone.Note: Do not use the HW flow control. Overrun errors (Rx mode) and FIFO underrun (Tx mode)should be managed by the application software.