Page 1 of 1

SDMMCv1 with DMAv1?

Posted: Tue Dec 15, 2015 10:49 pm
by szego
I'm trying to use the SDMMCv1 driver on the STM32L476, but doesn't appear to work with DMAv1. Is my understanding correct?

So far in terms of just compilation, the issues I've found:

1) In sdc_lld_wait_transaction_end(), this code:

Code: Select all

/* Wait until DMA channel enabled to be sure that all data transferred.*/
  while (sdcp->dma->stream->CR & STM32_DMA_CR_EN)
    ;


is DMAv2 specific. From what I can tell DMAv1 equivalent would be more like:

Code: Select all

 while (sdcp->dma->channel->CCR & DMA_CCR_EN )
    ;


Is there something at the higher level that could abstract this? If not, is it ok to add it? Something like dmaStreamIsEnabled(), alongside the dmaStreamEnable() macro perhaps?

2. In sdc_lld_start(), the #if 1 code doesn't compile with DMAv1.

Code: Select all

#if 1
  sdcp->dmamode |= STM32_DMA_CR_PFCTRL |
                   STM32_DMA_CR_PBURST_INCR4 |
                   STM32_DMA_CR_MBURST_INCR4;
#endif


Code: Select all

#if 1
    dmaStreamSetFIFO(sdcp->dma, STM32_DMA_FCR_DMDIS | STM32_DMA_FCR_FTH_FULL);
#endif


Is that why someone put it inside a #if? Is there a more correct #define symbol that could be used here? Or could this be abstracted out into the DMA interface? What does it do?

Any help appreciated, Paul.

Re: SDMMCv1 with DMAv1?

Posted: Tue Dec 15, 2015 11:49 pm
by Giovanni
Hi,

The driver used to work with F1 devices which have DMAv1. Could you try comparing with the driver in 2.6.9? that should work. Tomorrow I will test on F1 but I don't have L4 HW with SDIO connector.

Giovanni

Re: SDMMCv1 with DMAv1?

Posted: Wed Dec 16, 2015 4:02 pm
by Giovanni
Hi,

I made adjustments, now the SDMMCv1 driver can be compiled on the L4 however it is not tested.

Note that mcuconf.h changed because clock settings, please update from the demo.

Giovanni