ST意法半导体
直播中

胡丹

8年用户 170经验值
私信 关注
[问答]

SPC560B eDMA故障

使用SPC560B-DIS板我遇到了eDMA问题。


我有一个非常基本的功能设置,使用eDMA从一个阵列到另一个阵列写一连串32位字。

但它似乎没有进入第二次(或次要的)主循环迭代(如在CITER中描述一次但不是再次)
如果我手动重置TCD.START,则会发生下一次迭代(如果我继续这样做,迭代将继续,直到CITER为零且激活完成标志)

但是我假设应该由硬件启动子环'循环'。

任何帮助都将不胜感激。
#discovery #iter #dma

以上来自于谷歌翻译


以下为原文




using the SPC560B-DIS board I'm having trouble with eDMA.


I've got a very basic function set up to write a succession of 32bit words from one array to another using the eDMA.

but it doesn't seem to ever get on to the second (or subsiquent) major loop iterations (as in CITER decriments the once but then not again)
If i manually reset the TCD.START, the next iteration happens (and if I keep doing this the iterations continue till CITER is zero and the done flag is activated)

However I assume that subsiquent 'loops' should be started by hardware.

Any help with this would be appreciated.  
#discovery #iter #dma

回帖(3)

胡丹

2018-11-5 10:40:41
(参考手册RM0037)EDMA_ERQRL下有一节说
 
 “在接受通道的硬件服务请求之前,必须先断言eDMA请求输入信号和此使能请求标志。”
 
 但是除了''设置位1(CERQ [0])提供全局清除功能,强制EDMA_ERQRL的全部内容归零,禁用所有eDMA请求时,我找不到任何其他对“请求输入信号”的引用输入。“”
 
 
 这表明它们是一回事?
 
 如果没有,我是否应该做任何事情让它产生硬件请求?
 
 (顺便说一下:我正试图通过DMA运行SPI,但无论有没有SPI代码,似乎都有完全相同的问题,所以我现在假设这是一个DMA问题)

以上来自于谷歌翻译


以下为原文





(Reference Manual RM0037) Has a section under EDMA_ERQRL saying

  ''Both the eDMA request input signal and this enable request flag must be asserted before a channel’s hardware service request is accepted.''
  
But I can't find any other references to a 'request input signal' other than ''Setting bit 1 (CERQ[0]) provides a global clear function, forcing the entire contents of the EDMA_ERQRL to be zeroed, disabling all eDMA request inputs.''

  
Which suggests that they are the same thing??
  
If not, should I have to do anything to let it produce Hardware requests?
  
(BTW: I'm trying to run SPI via DMA but seem to be having exactly the same issues both with and without the SPI code, so am currently assuming it's a DMA problem)
举报

刘鑫

2018-11-5 10:59:03
你好Patrick,
 
 
如果您想使用eDMA硬件,您应该注意:
 
TCD.D_REQ
禁用硬件请求。如果设置了此标志,则为eDMA硬件
当自动清除相应的EDMA_ERQRL位时
当前主要迭代计数达到零。
0通道的EDMA_ERQRL位不受影响。
1当外部主循环时,通道的EDMA_ERQRL位清零
很完美
 
在SPC5studio中,Giovanni提供了一个很好的edma设置示例;-)
DSPI应用程序
spi和edma(cf spc5_edma.c和spi_lld.c)
 
 
 
 
 
 
 
 
 最好的祝福
 
 二万

以上来自于谷歌翻译


以下为原文





Hello Patrick ,


If you want to use eDMA Hardware , you should take care of  :

TCD.D_REQ
Disable hardware request. If this flag is set, the eDMA hardware
automatically clears the corresponding EDMA_ERQRL bit when the
current major iteration count reaches zero.
0 The channel’s EDMA_ERQRL bit is not affected.
1 The channel’s EDMA_ERQRL bit is cleared when the outer major loop
is comple   

in SPC5studio , there is a nice example of edma settings made by Giovanni ;-)
DSPI Applications
spi and edma (cf spc5_edma.c and spi_lld.c)




  • /**






  • * @brief   EDMA driver initialization.






  • *






  • * @special






  • */



  • void

  • edmaInit(

  • void

  • ) {



  •   


  • unsigned i;





  •   


  • SPC5_EDMA.CR.R    = SPC5_EDMA_CR_SETTING;



  •   


  • SPC5_EDMA.ERQRL.R = 0x00000000;



  •   


  • SPC5_EDMA.EEIRL.R = 0x00000000;



  •   


  • SPC5_EDMA.IRQRL.R = 0xFFFFFFFF;



  •   


  • SPC5_EDMA.ERL.R =   0xFFFFFFFF;



  • #if SPC5_EDMA_NCHANNELS > 32



  •   


  • SPC5_EDMA.ERQRH.R = 0x00000000;



  •   


  • SPC5_EDMA.EEIRH.R = 0x00000000;



  •   


  • SPC5_EDMA.IRQRH.R = 0xFFFFFFFF;



  •   


  • SPC5_EDMA.ERH.R =   0xFFFFFFFF;



  • #endif



  •   


  • /* Initializing all the channels with a different priority withing the



  •      


  • channels group.*/



  •   


  • for

  • (i = 0; i < 16; i++) {



  •    


  • SPC5_EDMA.CPR.R = g0;



  • #if SPC5_EDMA_NCHANNELS > 16



  •    


  • SPC5_EDMA.CPR[i + 16].R = g1;



  • #endif



  • #if SPC5_EDMA_NCHANNELS > 32



  •    


  • SPC5_EDMA.CPR[i + 32].R = g2;



  •    


  • SPC5_EDMA.CPR[i + 48].R = g3;



  • #endif



  •   


  • }











  • /**




  • * @brief   Starts or restarts an EDMA channel.





  • *





  • * @param[in] channel   the channel number





  • *





  • * @api





  • */



  • #define edmaChannelStart(channel) (SPC5_EDMA.SERQR.R = (channel))





  • /**





  • * @brief   Stops an EDMA channel.





  • *





  • * @param[in] channel   the channel number





  • *





  • * @api





  • */



  • #define edmaChannelStop(channel) {                                          


  •   


  • SPC5_EDMA.CERQR.R = (channel);                                            


  •   


  • SPC5_EDMA.CDSBR.R = (channel);                                            



  • }


Best regards

          Erwan
举报

胡丹

2018-11-5 11:10:16
Erwan感谢您的回复,
 
 我(/ am)已经使用该代码作为参考,并且通常发现它非常有用。
 
 原来我遇到的问题是我用DMA_MUX将DMA通道链接到源。
 我现在已经修好了,所以谢谢你的帮助。
 
 帕特里克

以上来自于谷歌翻译


以下为原文





Erwan thanks for the reply,

I was (/am) already using that code as a reference, and in general finding it very useful.

Turns out the issue I was having was with my linking of the DMA channel to the source with the DMA_MUX.
I've fixed it now, so thankyou for the assist.  

Patrick
举报

更多回帖

×
20
完善资料,
赚取积分