我是这样写的,但最后没有传输数据
#define CSDP 0x0c00
#define CCR 0x0c01
#define CICR 0x0c02
#define CSSAL 0x0c04
#define CSSAU 0x0c05
#define CDSAL 0x0c06
#define CDSAU 0x0c07
#define CEN 0x0c08
#define CFN 0x0c09
#define CEI 0x0c0b
#define CFI 0x0c0a
*(unsigned volatile int*)CSDP=0x0408;
*(unsigned volatile int*)CCR=0x40a0;
*(unsigned volatile int*)CICR=0x0008;
*(unsigned volatile int*)CSSAL=0x0000;
*(unsigned volatile int*)CSSAU=0x0060;
*(unsigned volatile int*)CDSAL=0x0000;
*(unsigned volatile int*)CDSAU=0x0002;
*(unsigned volatile int*)CEN=0xf000;
*(unsigned volatile int*)CFN=0x0001;
*(unsigned volatile int*)CEI=0x0000;
*(unsigned volatile int*)CFI=0x0000;
Shine:
你好,
你现在是一个数据都没搬吗? 我看到你在这条代码中*(unsigned volatile int*)CCR=0x40a0; 把SRCAMODE设成了00?在DMA搬数据前, EMIF寄存器都设置了吧?
gang zhao:
回复 Shine:
对啊,是一个数据都没搬,SRCAMODE是设成00,源地址是CE3接外部存储FIFO,地址是不变的,目的地址是CE0接SDRAM的
Shine:
回复 gang zhao:
对应FIFO, SDRAM的EMIF寄存器在启动DMA之前配置了吗?在用DMA之前, 先要确保EMIF寄存器的设置能正确读写FIFO和SDRAM
gang zhao:
回复 Shine:
EMIF我初始化过了,可能是地址错了吗?5509的dma手册中有一句话是
By default, the TMS320C55xx compiler assigns all data symbols word addresses. The DMA however, expects all addresses to be byte addresses. Therefore, we must shift the address by 2 in order to change the word address to a byte address forthe DMA transfer.
但是我地址设成双倍的还是错误啊
Shine:
回复 gang zhao:
你好,
你先把代码改成internal RAM<->internal RAM搬移看看, 这样可以确定是EMIF的问题还是DMA本身配置的问题.
gang zhao:
回复 Shine:
安你的方法,我设置从SARAM到SARAM传输成功了,但是只有在SARAM的地址为 SARAM : origin = 00014001h, length = 0005000h时成功,而将SARAM的地址改为 SARAM : origin = 00024001h, length = 0005000h时就不成功了,注意我是将高地址00001改为0002时就无法传输了,这个是什么问题呢?编译是成功的,只是无法传输。
Shine:
回复 gang zhao:
00014001h已经是byte address了, 不需要再移位了. SARAM的memory map在数据手册第32页Table 3−2. SARAM Blocks. http://www.ti.com/lit/ds/symlink/tms320vc5509a.pdf
gang zhao:
回复 Shine:
真心谢谢你的回答,但是如果我想起始地址设为00024001h,我如何改其他地方才能成功呢?