阅读:1017回复:0
关于C6203不能用扩展总线读取FIFO的说明
1、 故障描述
使用仿真器运行程序,dsp读取挂在扩展总线上的fifo没有问题;但是如果去掉仿真器由flash引导,则读fifo与加电状态有关。加电后如果能读fifo则一直能够正常读取;如果加电后第一次不能读fifo则一直不能正常读数据,此时测量扩展总线的XCLK(时钟)正常时钟输出,但是没有使能信号(XCE)和读信号(XRE),同时DMA不能停止,导致程序一直停留在DMA读FIFO的位置上。 本设计中共用到了2片C6203,其中一片使用了XBUS,出现了上述问题;一片没有使用XBUS,运行一直没有问题。 2、 软件描述 在软件使用中,对扩展总线主要做如下操作: dma_reset(); XBUS_XBGC = 0x6800; XBUS_CE0_CTRL = 0xFFFF3F53; XBUS_CE1_CTRL = 0xFFFF3F53; XBUS_CE2_CTRL = 0xFFFF3F53; XBUS_CE3_CTRL = 0x50; for (chan= 0;chan <= DMA_CH2; chan++) { *(unsigned int *)(DMA_PRIMARY_CTRL_ADDR(chan)) = 0x00; *(unsigned int *)(DMA_SRC_ADDR_ADDR(chan)) = 0x00; *(unsigned int *)(DMA_DEST_ADDR_ADDR(chan)) = 0x00; *(unsigned int *)(DMA_XFER_COUNTER_ADDR(chan)) = 0x00; } DMA_AUXCR = 0x00; DMA_GCR_A = 0x00; DMA_GCR_B = 0x00; DMA_GNDX_A = 0x00; DMA_GNDX_B = 0x00; DMA_GADDR_A = 0x00; DMA_GADDR_B = 0x00; DMA_GADDR_C = 0x00; DMA_GADDR_D = 0x00; DMA0_PRIMARY_CTRL = 0x1000000; DMA0_SECONDARY_CTRL = DMA0_SECONDARY_CTRL&0x00070000; DMA0_XFER_COUNTER =2000; DMA0_SRC_ADDR=FIFO_1_ADDR; DMA0_DEST_ADDR = (unsigned int)(p_DMA0_DEST_ADDR); LOAD_FIELD(DMA_PRIMARY_CTRL_ADDR(0),DMA_ADDR_INC,DST_DIR,DST_DIR_SZ); DMA0_PRIMARY_CTRL = 0x1000040; DMA1_PRIMARY_CTRL = 0x1000000; DMA1_SECONDARY_CTRL = DMA1_SECONDARY_CTRL&0x00070000; DMA1_XFER_COUNTER = 2000; DMA1_SRC_ADDR=FIFO_2_ADDR; DMA1_DEST_ADDR = (unsigned int)(p_DMA1_DEST_ADDR); LOAD_FIELD(DMA1_PRIMARY_CTRL_ADDR,DMA_ADDR_NO_MOD,SRC_DIR,SRC_DIR_SZ); LOAD_FIELD(DMA_PRIMARY_CTRL_ADDR(1),DMA_ADDR_INC,DST_DIR,DST_DIR_SZ); DMA2_PRIMARY_CTRL = 0x1000000; DMA2_SECONDARY_CTRL=0x00010080; DMA2_XFER_COUNTER = 2000; DMA2_SRC_ADDR=FIFO_3_ADDR; DMA2_DEST_ADDR = (unsigned int)(p_DMA2_DEST_ADDR); LOAD_FIELD(DMA2_PRIMARY_CTRL_ADDR,DMA_ADDR_NO_MOD,SRC_DIR,SRC_DIR_SZ); LOAD_FIELD(DMA_PRIMARY_CTRL_ADDR(2),DMA_ADDR_INC,DST_DIR,DST_DIR_SZ); DMA_START(0); while((DMA0_PRIMARY_CTRL&0xc)!=0){} DMA0_SECONDARY_CTRL=(DMA0_SECONDARY_CTRL&0xFFF9FFFF)|0x00010000; DMA_START(1); while((DMA1_PRIMARY_CTRL&0xc)!=0){} DMA_START(2); while((DMA2_PRIMARY_CTRL&0xc)!=0){} 其中:FIFO_1_ADDR对应扩展总线xce0空间 FIFO_2_ADDR对应扩展总线xce1空间 FIFO_3_ADDR对应扩展总线xce2空间 DMA的目的地址为外部的SBSRAM |
|
|