cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMX broke SDIO DMA in latest update

Posted on November 12, 2015 at 15:04

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.

#f4
5 REPLIES 5
stm32cube-t
Senior III
Posted on November 13, 2015 at 11:29

Dear user,

Thank you for pointing out this issue. Shall be fixed asap.

Best regards
jasonp4113
Associate II
Posted on November 28, 2015 at 02:22

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??

Jason

Posted on November 30, 2015 at 19:17

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.

stm32cube-t
Senior III
Posted on December 01, 2015 at 11:49

Dear users,

Please note this issue will be solved in STM32CubeMX next release: 4.12.0
jasonp4113
Associate II
Posted on December 09, 2015 at 02:26

Copied from errata sheet for F4:

2.9 SDIO peripheral limitations

2.9.1 SDIO HW flow control

Description

When 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 into

the SD/MMC card or into the SDIO device. As a consequence, a CRC error will be reported

to the SD/SDIO MMC host interface (DCRCFAIL bit set to ‘1’ in SDIO_STA register).

Workaround

None.

Note: Do not use the HW flow control. Overrun errors (Rx mode) and FIFO underrun (Tx mode)

should be managed by the application software.