polaris0327 发表于 2014-6-17 10:35

DSP5509a使用dma只能响应一次中断

DSP使用dma传输数据,只能响应一次中断,第二次情况是:读取数据个数未达到1帧(4096个)就停止读取数据,然后不能达到中断条件
具体程序如下:
#include <csl.h>
#include <csl_irq.h>
#include <csl_dma.h>
#include <csl_pll.h>
#include <csl_emif.h>
#include <csl_chip.h>
#include <stdio.h>
#include <_csl_pgpio.h>
#include <csl_gpio.h>
#include "port5509Adma.h"
#define N 4096
#pragma DATA_SECTION(databuffer,"dmaMem")
unsigned int databuffer,sj;
#pragma DATA_SECTION(src,"shuju")
unsigned int src;
interrupt void dma1_int();
extern void VECSTART(void);
PLL_ConfigmyConfig      = {
}
EMIF_Config emiffig = {
}
void init_dma1(unsigned int * src_data,unsigned int * dst_data)
{
unsigned long int temp;
//此处为DMA传输设置,一帧4096个数据,从EMIF接口到daram,中断条件是完成一帧并且同步事件发生,同步事件为int1
*DMA_CCR1=0x4370;

*DMA_GCR=0x0008;
*DMA_GSCR=0x0001;
*DMA_GTCR=0x0000;

*DMA_CICR1=0x0008;
*DMA_CSDP1=0x0209;
*DMA_CEN1=0x1000;
*DMA_CFN1=0x0001;
*DMA_CSEI1=0x0000;
*DMA_CSFI1=0x0000;
*DMA_CDEI1=0x0000;
*DMA_CDFI1=0x0000;

*DMA_CSSA_L1=(unsigned int)(src_data)<<1;
temp=((unsigned long int)(src_data))>>15;
*DMA_CSSA_U1=(unsigned int)(temp);

*DMA_CDSA_L1=(unsigned int)(dst_data)<<1;
temp=((unsigned int)(dst_data))>>15;
*DMA_CDSA_U1=(unsigned int)(temp);


*DMA_CCR1=0x43f0;

}
main()
{
      /*初始化CSL库*/      
    CSL_init();
   
    /*EMIF为全EMIF接口*/
    CHIP_RSET(XBSR,0x0a01);
   
    /*设置系统的运行速度为144MHz*/
    PLL_config(&myConfig);
      EMIF_config(&emiffig);

      IRQ_globalDisable();
      IRQ_setVecs((Uint32)(&VECSTART));
      IRQ_clear(IRQ_EVT_DMAC1);
      IRQ_enable(IRQ_EVT_DMAC1);
      IRQ_plug(IRQ_EVT_DMAC1,&dma1_int);
      IRQ_globalEnable();
      

      _PGPIO_pinEnable(GPIO_PIN6);
      _PGPIO_pinDirection(GPIO_PIN6,1);
      _PGPIO_pinWrite(GPIO_PIN6,1);
         delay();
      _PGPIO_pinWrite(GPIO_PIN6,0);
         delay();
      _PGPIO_pinWrite(GPIO_PIN6,1);
         delay();
      init_dma1(src,databuffer);
      while(1);               
}
interrupt void dma1_int()
{
   }向量表:
      .sect ".vectors"



*------------------------------------------------------------------------------

* Global symbols defined here and exported out of this file

*------------------------------------------------------------------------------



      .global _VECSTART



*------------------------------------------------------------------------------

* Global symbols referenced in this file but defined somewhere else.

* Remember that your interrupt service routines need to be referenced here.

*------------------------------------------------------------------------------

      .ref _c_int00


                .ref _dma1_int
      .def nmi, int0, int1, int2, int3, int4, int5, int6

      .def int7, int8,int10, int11, int12, int13

      .def int14, int15, int16, int17, int18, int19, int20

      .def int21, int22, int23, int24, int25, int26, int27

      .def int28, int29



_VECSTART:

      .ivec _c_int00,c54x_stk

nmi   .ivec no_isr

      nop_16

int0    .ivec no_isr

      nop_16

int1    .ivec no_isr

      nop_16

int2    .ivec no_isr

      nop_16

int3    .ivec no_isr

      nop_16

int4    .ivec no_isr

      nop_16

int5    .ivec no_isr

      nop_16

int6    .ivec no_isr

      nop_16

int7    .ivec no_isr

      nop_16

int8    .ivec no_isr

      nop_16

dmac1    .ivec _dma1_int
      nop_16

int10   .ivec no_isr

      nop_16

int11   .ivec no_isr

      nop_16

int12   .ivec no_isr

      nop_16

int13 .ivec no_isr

      nop_16

int14   .ivec no_isr

      nop_16

int15   .ivec no_isr

      nop_16

int16   .ivec no_isr

      nop_16

int17   .ivec no_isr

      nop_16

int18   .ivec no_isr

      nop_16

int19   .ivec no_isr

      nop_16

int20   .ivec no_isr

      nop_16

int21   .ivec no_isr

      nop_16

int22   .ivec no_isr

      nop_16

int23   .ivec no_isr

      nop_16

int24   .ivec no_isr

      nop_16

int25   .ivec no_isr

      nop_16

int26   .ivec no_isr

      nop_16

int27   .ivec no_isr

      nop_16

int28   .ivec no_isr

      nop_16

int29   .ivec no_isr

      nop_16



*------------------------------------------------------------------------------

* This is a dummy interrupt service routine used to initialize the IST.

*------------------------------------------------------------------------------

      .text

      .def no_isr

no_isr:

      b #no_isr

zhangmangui 发表于 2014-6-17 21:03

顶顶   不知道什么原因

polaris0327 发表于 2014-6-18 09:41

zhangmangui 发表于 2014-6-17 21:03 static/image/common/back.gif
顶顶   不知道什么原因

有人说是中断函数用IRQ挂的原因,是IRQ只能挂硬中断么?

zhangmangui 发表于 2014-6-18 13:46

polaris0327 发表于 2014-6-18 09:41 static/image/common/back.gif
有人说是中断函数用IRQ挂的原因,是IRQ只能挂硬中断么?

不可能只是硬件中断啊
用过定时器的也没什么问题

polaris0327 发表于 2014-6-18 15:13

zhangmangui 发表于 2014-6-18 13:46 static/image/common/back.gif
不可能只是硬件中断啊
用过定时器的也没什么问题

关键如果把irq那几条注释掉,会直接一次中断都不能进入。
相当于向量表中挂的中断函数没起作用?

zhangmangui 发表于 2014-6-18 17:08

polaris0327 发表于 2014-6-18 15:13 static/image/common/back.gif
关键如果把irq那几条注释掉,会直接一次中断都不能进入。
相当于向量表中挂的中断函数没起作用? ...

下来再看看 mark

polaris0327 发表于 2014-6-20 10:53

zhangmangui 发表于 2014-6-18 17:08 static/image/common/back.gif
下来再看看 mark

版主有什么结果么。。

polaris0327 发表于 2014-6-24 10:12

谁帮忙解决一下呢。。

cer1991 发表于 2014-6-24 12:09

CMD文件确定没问题么?

polaris0327 发表于 2014-6-30 22:22

cer1991 发表于 2014-6-24 12:09 static/image/common/back.gif
CMD文件确定没问题么?

cmd肯定没问题吧?
MEMORY
{
    PAGE 0:

      MMR   : origin = 0000000h, length = 00000c0h
      SPRAM   : origin = 00000c0h, length = 0000040
      VECS    : origin = 0000100h, length = 0000100h
      DARAM   : origin = 0000200h, length = 000FE00h



      SARAM: origin = 0010000h, length = 0040000h
   

      CE0   : origin = 0050000h, length = 03b0000h
      CE1   : origin = 0400000h, length = 0400000h
      CE2   : origin = 0800000h, length = 0400000h
      CE3   : origin = 0c00000h, length = 03f0000h

      PDROM   : origin = 0ff0000h, length = 08000h
/*       VECS    : origin = 0ffff00h, length = 00100h */ /* reset vector */
}      


SECTIONS
{
      .vectors: {} > VECS   PAGE 0         /* interrupt vector table */
      .cinit   : {} > SARAM PAGE 0
      .text    : {} > SARAM PAGE 0

      .stack   : {} > DARAM PAGE 0
      .sysstack: {} > DARAM PAGE 0
      .sysmem: {} > DARAM PAGE 0
      .cio   : {} > DARAM PAGE 0
      .data    : {} > DARAM PAGE 0
      .bss   : {} > DARAM PAGE 0
      .const   : {} > DARAM PAGE 0

      .csldata:{} > DARAM   PAGE 0
      dmaMem:    {} > DARAM   PAGE 0
                shuju:            {} > CE1 PAGE 0
}

polaris0327 发表于 2014-6-30 22:22

数据地址只用了头地址0x400000
页: [1]
查看完整版本: DSP5509a使用dma只能响应一次中断