DSP:TMS320C6457
中断源:GPIO 15,对应到INT4.
从硬仿的结果看,GPIO管脚状态没有问题,IFR的中断位也被置1,但就是不能跳转到需要的_c_int04服务程序。个人有点怀疑的是ISTP的配置有问题,请各位大侠看看,问题出在哪儿?
空间分配如下:其中0x00800000是L2SARM的起始位置,我把中断向量表放在这个位置。
MEMORY
{
VECTORS: o = 0x00800000 l = 0x00000400 /*vectors*/
L2RAM: o = 0x00800400 l = 0x001FFC00 /* 2MB L2 Internal SRAM */
L1PRAM: o = 0x00E00000 l = 0x00008000 /* 32kB L1 Program SRAM/CACHE */
L1DRAM: o = 0x00F00000 l = 0x00008000 /* 32kB L1 Data SRAM/CACHE */
EMIFA_CE2: o = 0xA0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE3: o = 0xB0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE4: o = 0xC0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
EMIFA_CE5: o = 0xD0000000 l = 0x00800000 /* 8MB EMIFA CE2 */
DDR2_CE0: o = 0xE0000000 l = 0x20000000 /* 512MB EMIFB CE0 */
}
.global_vectors
.global_c_int00
.global_vector1
.global_vector2
.global_vector3
.global_c_int04
.global_vector5
.global_vector6
.global_vector7
.global_vector8
.global_vector9
.global_vector10
.global_vector11
.global_vector12
.global_vector13
.global_vector14
.global_vector15
VEC_ENTRY .macro addr
STW B0,*--B15
MVKL addr,B0
MVKH addr,B0
B B0
LDW *B15++,B0
NOP 2
NOP
NOP
.endm
_vec_dummy:
B B3
NOP 5
.sect".vecs"
.ref _c_int00
.ref _c_int04 ;ref the function defined in C file
.align 1024
_vectors:
_vector0: VEC_ENTRY _c_int00 ;RESET中断
_vector1: VEC_ENTRY _vec_dummy ;NMI不可屏蔽中断
_vector2: VEC_ENTRY _vec_dummy ;保留中断1
_vector3: VEC_ENTRY _vec_dummy ;保留中断2
_vector4: VEC_ENTRY _c_int04 ;对应于c_int04 ISR
_vector5: VEC_ENTRY _vec_dummy ;外部中断INT5
_vector6: VEC_ENTRY _vec_dummy ;外部中断INT6
_vector7: VEC_ENTRY _vec_dummy ;外部中断INT7
_vector8: VEC_ENTRY _vec_dummy ;外部中断INT8
_vector9: VEC_ENTRY _vec_dummy ;JTAGRTDX中断
_vector10: VEC_ENTRY _vec_dummy ;EMIF_SDRAM_Timer中断
_vector11: VEC_ENTRY _vec_dummy ;McBSP_0_Receive中断
_vector12: VEC_ENTRY _vec_dummy ;McBSP_1_Transmit中断
_vector13: VEC_ENTRY _vec_dummy ;Host_Port_Host_to_DSP中断
_vector14: VEC_ENTRY _vec_dummy ;Timer0中断
_vector15: VEC_ENTRY _vec_dummy ;Timer1中断
void InitInterrupt(void)
{
unsigned int temp;
*IECRH = 0xFFFFFFFF; // IECRH (disable high interrupts enable)
*EECRH = 0xFFFFFFFF; // EECRH (disable high events enable)
*ICRH = 0xFFFFFFFF; // ICRH (clear high interrupts pending)
*ECRH = 0xFFFFFFFF; // ECRH (clear high events pending)
*IECR = 0xFFFFFFFF; // IECR (disable low interrupts enable)
*EECR = 0xFFFFFFFF; // EECR (disable low events enable)
*EICR = 0xFFFFFFFF; // ICR (clear low interrupts pending)
*ECR = 0xFFFFFFFF; // ECR (clear low events pending)
*EVTMASK0 = 0xffffffff;//disable combine
*EVTMASK1 = 0xffffffff;
*EVTMASK2 = 0xffffffff;
*EVTMASK3 = 0xffffffff;
*INTMUX1 |= 0x00000042;//INT04 responding to event 66,GPIO 15
*INTMUX1 &= 0xffff0042;
*EVTCLR2 |= 0x0004;//clear event 66 flag before the new interrupt come
temp = *EVTFLAG2;
ICR = 0x00000010;
asm( " NOP");
asm( " NOP");
IER |= 0x00000012; // IE4=1,NMIE=1
ISTP = 0x00800080;
// *EVTSET2 |= 0x00000004;//set interrupt 66,only for test,zdx
CSR |= 0x00000001; // enable GIE
//*EVTSET2=0x0000;
}
interrupt void c_int04(void)
{
unsigned int temp;
temp = *EVTFLAG2;
Init_DMA_In();
} |