SDMMCv1 with DMAv1?

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
szego
Posts: 20
Joined: Wed Sep 02, 2015 7:51 pm

SDMMCv1 with DMAv1?

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SDMMCv1 with DMAv1?

Post 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
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: SDMMCv1 with DMAv1?

Post 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
Post Reply