完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
C5509A的DMA传输,从SARAM到SARAM。在CMD中将SARAM的地址设置为 SARAM : origin = 00014001h, length = 0005000h时成功传输,而将SARAM的地址改为 SARAM : origin = 00024001h, length = 0005000h时就不成功了,我如何改才能成功啊,您上次没有告诉我怎么改啊,大神!
|
|
相关推荐
11 个讨论
|
|
主程序: #include //#include //#include #include //---------Global constants--------- /* Constant defines transfer length */ #define N 128 //---------Global data definition--------- /* Place src and dst of DMA transfer in seperate memory section */ /* to better control placement in user specified memory range */ #pragma DATA_SECTION(src,"dmaMem") Uint16 src[N]; #pragma DATA_SECTION(dst, "ba") Uint16 dst[N]; DMA_Config myconfig = [ DMA_DMACSDP_RMK( DMA_DMACSDP_DSTBEN_NOBURST, DMA_DMACSDP_DSTPACK_OFF, DMA_DMACSDP_DST_SARAM, DMA_DMACSDP_SRCBEN_NOBURST, DMA_DMACSDP_SRCPACK_OFF, DMA_DMACSDP_SRC_SARAM, DMA_DMACSDP_DATATYPE_16BIT ), /* DMACSDP */ DMA_DMACCR_RMK( DMA_DMACCR_DSTAMODE_POSTINC, DMA_DMACCR_SRCAMODE_POSTINC, DMA_DMACCR_ENDPROG_OFF, DMA_DMACCR_REPEAT_OFF, DMA_DMACCR_AUTOINIT_OFF, DMA_DMACCR_EN_STOP, DMA_DMACCR_PRIO_HI, DMA_DMACCR_FS_ENABLE, DMA_DMACCR_SYNC_NONE ), /* DMACCR */ DMA_DMACICR_RMK( DMA_DMACICR_BLOCKIE_OFF, DMA_DMACICR_LASTIE_OFF, DMA_DMACICR_FRAMEIE_ON, DMA_DMACICR_FIRSTHALFIE_OFF, DMA_DMACICR_DROPIE_OFF, DMA_DMACICR_TIMEOUTIE_OFF ), /* DMACICR */ (DMA_AdrPtr)&src, /* DMACSSAL */ 0, /* DMACSSAU */ (DMA_AdrPtr)&dst, /* DMACDSAL */ 0, /* DMACDSAU */ N, /* DMACEN */ 1, /* DMACFN */ 0, /* DMACFI */ 0 /* DMACEI */ ]; /* Define a DMA_Handle object */ DMA_Handle myhDma; int i, j; Uint16 err = 0; volatile Uint16 WaitForTransfer = TRUE; //---------Function prototypes--------- /* Function prototypes */ void taskFxn(void); //---------main routine--------- void main(void) [ /* Initialize CSL library - This is REQUIRED!!! */ CSL_init(); /* Initialize source and destination buffers */ for (i = 0; i <= (N - 1); i++) [ dst = 0; src = i + 1; ] /* Call Function For DMA Transfer */ taskFxn(); ] void taskFxn(void) [ /* Open DMA Channel 0 */ myhDma = DMA_open(DMA_CHA0, 0); /* 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. */ myconfig.dmacssal = (DMA_AdrPtr)(((Uint16)(&src)<<1)&0xFFFF); myconfig.dmacdsal = (DMA_AdrPtr)(((Uint16)(&dst)<<1)&0xFFFF); myconfig.dmacssau = (unsigned short int)(((unsigned long int)&src)>>15); myconfig.dmacdsau = (unsigned short int)(((unsigned long int)&dst)>>15); /* Write configuration structure values to DMA control registers */ DMA_config(myhDma, &myconfig); /* Enable DMA channel to begin transfer */ DMA_start(myhDma); /* Wait for FRAME status bit in DMA status register to signal */ /* transfer is complete. */ while (!DMA_FGETH(myhDma,DMACSR,FRAME)) [ ; ] /* Check data values to make sure transfer happened correctly */ for (i = 0; i <= (N - 1); i++) [ if (dst != src) [ ++err; ] ] printf ("%sn",err?"TEST FAILED" : "TEST PASSED"); /* We are through with DMA, so close it */ DMA_close(myhDma); ] CMD程序: MEMORY [ PAGE 0: MMR : origin = 0000000h, length = 00000c0h SPRAM : origin = 00000c0h, length = 0000040h VECS : origin = 0000100h, length = 0000100h DARAM0 : origin = 0000200h, length = 0003E00h DARAM1 : origin = 0004000h, length = 0004000h DARAM2 : origin = 0008000h, length = 0004000h DARAM3 : origin = 000c000h, length = 0004000h SARAM0 : origin = 0010001h, length = 0004000h SARAM1 : origin = 0014001h, length = 0004000h PDROM : origin = 0ff8000h, length = 07f00h /* VECS : origin = 0ffff00h, length = 00100h */ /* reset vector */ ] SECTIONS [ .vectors : [] > VECS PAGE 0 /* interrupt vector table */ .cinit : [] > SARAM0 PAGE 0 .text : [] > SARAM1 PAGE 0 .stack : [] > DARAM0 PAGE 0 .sysstack: [] > DARAM0 PAGE 0 .sysmem : [] > DARAM1 PAGE 0 .cio : [] > DARAM1 PAGE 0 .data : [] > DARAM1 PAGE 0 .bss : [] > DARAM1 PAGE 0 .const : [] > DARAM1 PAGE 0 .csldata: [] > DARAM0 PAGE 0 dmaMem: [] > SARAM0 PAGE 0 ba: [] > SARAM1 PAGE 0 ] |
|
|
|
|
|
vuywsdfwf 发表于 2018-7-27 10:38 但是用您给的文件,进行“Load Program…”时出现错误,提示“Data verification failed at address 0x48000 please verify target memory and memory map”。我确定不是硬件的问题,而且我也选择了-ml,库也选上了。会不会CMD文件不匹配啊 |
|
|
|
|
|
Xc_Y 发表于 2018-7-27 10:45 这个cmd文件不是针对vc5509a的, 我是在simulation下运行的, 所以不会报错. 你要根据你板子的硬件适当改一下cmd文件. DARAM0 : origin = 0000200h, length = 0003E00h DARAM1 : origin = 0004000h, length = 0008000h .text : [] >DARAM1 PAGE 0 |
|
|
|
|
|
用我给的例程还是不行吗? 你可以用你自己的cmd文件代替我的. 因为你没把整个工程文件贴出来, 所以我是在generic5509cslsimpledma1基础上改的, 这个例程是DARAM-DARAM之间的传输, 我把源和目的改成DMA_DMACSDP_DST_SARAM, DMA_DMACSDP_SRC_SARAM, 然后加了高位移位的语句. myconfig.dmacssau = (Uint32)(((Uint32)&src)>>15); myconfig.dmacdsau = (Uint32)(((Uint32)&dst)>>15); 但是运行下来不能搬0x24000以上的SARAM, 跟一下程序发现原来0x24000以上已超过64K, 所以需要改用large memory模式, 所以选了-ml, rts55x.lib和c5509x.lib, 改了之后就可以了. |
|
|
|
|
|
只有小组成员才能发言,加入小组>>
NA555DR VCC最低电压需要在5V供电,为什么用3.3V供电搭了个单稳态触发器也使用正常?
692 浏览 3 评论
MSP430F249TPMR出现高温存储后失效了的情况,怎么解决?
605 浏览 1 评论
对于多级放大电路板,在PCB布局中,电源摆放的位置应该注意什么?
1064 浏览 1 评论
755 浏览 0 评论
普中科技F28335开发板每次上电复位后数码管都会显示,如何熄灭它?
529 浏览 1 评论
请问下tpa3220实际测试引脚功能和官方资料不符,哪位大佬可以帮忙解答下
171浏览 20评论
请教下关于TAS5825PEVM评估模块原理图中不太明白的地方,寻求答疑
133浏览 14评论
在使用3254进行录音的时候出现一个奇怪的现象,右声道有吱吱声,请教一下,是否是什么寄存器设置存在问题?
129浏览 13评论
TLV320芯片内部自带数字滤波功能,请问linein进来的模拟信号是否是先经过ADC的超采样?
125浏览 12评论
GD32F303RCT6配置PA4 ADC引脚,将PA2代替key功能,PA2连接时无法实现预期功能,为什么?
62浏览 10评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-28 13:28 , Processed in 0.953395 second(s), Total 62, Slave 56 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号