提前对您的支持表示感谢,我还在尝试EDMA来搬运数据,现在我使用region的ESR和ICR可以实现触发,表现为运行的时候,相应的寄存器EDMACC0_CCSTAT 在0x00000110和ox0之间跳转,这说明TR已经传输,并且通道也开始工作,并且IPR = 0x00000001,这是否已经说明EDMA完成了传输的所有的流程,但是我在目标地址没有看到搬运来的数据,后面我将源地址进行修改,都在L2上进行搬运,目的地址还是没有对应的数据,我将代码附在下面,希望得到您的支持~
初始化代码
void COhwDMAInit(void) { unsigned int count = 0; // General EDMA Initial memory protection is unlocked MPPA0 = 0x000004B3; MPPAG = 0x000004B3; /* Step 1: EDMA initialization */ QUEPRI = 0x10; //芯片级设置 ok QWMTHRA =(16<<8u)|(16 & 0xFF); //ok /* Clear the Event miss Registers */ EMCR = 0xFFFFFFFF; //事件丢失寄存器清除 No EMCRH = 0xFFFFFFFF; // NO QEMCR = 0xFFFFFFFF; //No /* Clear CCERR register */ CCERRCLR = 0xFFFFFFFF; //No /* FOR TYPE EDMA*/ /* Enable the DMA (0 - 64) channels in the DRAE and DRAEH register shadow region open */ DRAE1 = 0xFFFFFFFF; //影子区域 如果配置了则需要操作影子区域的寄存器来实现控制 Yes DRAEH1 =0xFFFFFFFF; //NO /* Step 2: Programming DMA Channel (and Param set) */ /* All events are one to one mapped with the channels 64个事件 64个通道 事件映射通道 */ DCHMAP0 = 0 <<5; // 0 event mapped with the channel No DCHMAP1 = 1 <<5; // 1 event mapped with the channel NO DCHMAP2 = 2 <<5; // 1 event mapped with the channel No DMAQNUM0=0x0; //全部放在队列0中进行 Yes // EESR =0x20000000; //29 // COhwDMA_Disable(); return; }
参数集设置代码 其中up和down数据都在0x008位置内,
void COhwDMA_rxConfig() { /*----------------------------------------------------------------------*/ /* Initialize EDMA for Receive Samples for RX0 */ *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_OPT ) = 0x0010000C; //| (1<<12) ; 选择AB传输 防链接 Yes *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_SRC ) =(uint32_t)&COexEmOutPktBuf.up; // L2的0x yes(uint32_t)COexSqInputPtr *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_CNT ) = (0x00120000 | 0x00000002); // in bytes BCNT ACNT yes 2A *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_DST ) = (uint32_t)&COexEmInPktBuf.dn; // Dst Yes (uint32_t)&COexEmInPktBuf.dn; *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_IDX ) = (0x00020000 |0x00000002); //dstcidx srccidx yes *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_LNK ) = 0x0000FFFF; // null //Bcntrld yes *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_CIDX) = 0; // *(volatile uint32_t *) (EVENT1_PARAMS + EDMA_PARAMS_CCNT) = 0x00000001; // Important!!! }
采用CPU手动触发