利用DMA从L4向L5传输数据,为什么源地址和目的地址需要设为全局变量,不能设为局部变量,如下程序,将DMABuf1中的数据传输给DMABuf2,但是自己将DMABuf1和DMABuf2在main函数里设为局部变量是传输错误,设为全局变量就可以了,求解?
#include "DSP2833x_Device.h"
#include "DSP2833x_Examples.h"
#include "DMA.h"
#pragma DATA_SECTION(DMABuf1,"DMARAML4");
#pragma DATA_SECTION(DMABuf2,"DMARAML5");
Uint16 DMABuf1[2] = {0x0001, 0x0002};
Uint16 DMABuf2[2] = {0x0000, 0x0000};
Uint16 i;
void main ()
{
InitSysCtrl();
InitPieVectTable();
dma_init (DMABuf1, DMABuf2);
dma_interrupt_init();
dma_start ();
EALLOW;
DmaRegs.CH1.CONTROL.bit.PERINTFRC = 1;
EDIS;
while(1);
}