This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C64x+ interrupt selector not firing

Hi,

I'm trying to get the HPI interrupt event (#47 on my DM6437) to trigger a CPU interrupt (#4).

I have:

- setup a vector table

- set ISTP to point to it

- set INTMUX1.INTSEL4 to event 47

- enabled IER.IE4 and IER.NMIE

- enabled CSR.GIE

- set EVTSET1.ES47

and nothing happens.

However, if I set the interrupt directly with ISR.IS4, the interrupt works and it branches to my handler! So my interrupt is enabled and my vector table is correct (verified by emulation).

So, is there anything more required to use the C64x+ interrupt selector? Is it possible that the HPI interrupt simply cannot be triggered with the EVTSET register? Unfortunately, there's no way to test it from the HPI module without a host to control the HPIC.DSPINT bit remotely.

Thanks!

- Craig


TestCode.cpp

extern far unsigned int        vectors;
extern cregister volatile unsigned int    ISTP, ITSR, TSR, IER, ISR, ICR, IFR, CSR;
interrupt void    HPIHostInt(void);

//***********************************************************************************//
int main(void)
//***********************************************************************************//
{
    // set interrupt vectors (must be 256-word / 1KB aligned)
    // ISTP: [ISTB (bits 31:10)] [HPEINT (bits 9:5)] [0 0 0 0 0]
    ISTP = ((unsigned int)(&vectors) & INT_ISTB);

    // disable interrupts and clear any pending events
    IER = 0;
    ICR = ICR_IC_ALL;

    // enable HPI interrupt (event 47)
    // map to CPUINT4
    INTMUX1_R = (INTMUX1_R & (~INTMUX1_INTSEL4_BITS)) | (47 << INTMUX1_INTSEL4_POS);

    // enable global interrupts
    IER |= (IER_IE4 | IER_NMIE);
    CSR |= CSR_GIE;

    // manual test interrupt
//    ISR = ISR_IS4;
    EVTSET1_R = 0x00008000u;

    // run primary loop
    while (1)
    {
       //
    }
}

//***********************************************************************************//
// HPIHostInt is the HPI HPIC.DSPINT host ISR.
//***********************************************************************************//
interrupt void HPIHostInt(void)
//***********************************************************************************//
{
    g_RegRead = 0x12345678u;
}


LinkerCmd.cmd


MEMORY

{
    VECTOR_TABLE        : origin = 0x10800000,    len = 0x00000200    /* interrupt vector table */

... (other entries)

}

SECTIONS
{

    .text:vecs    > VECTOR_TABLE        /* interrupt vector table */

... (other entries)


}


 

vectors.asm


*
* Copyright (C) 2003 Texas Instruments Incorporated
* All Rights Reserved
*
*
*---------vectors.asm---------
*
* Assembly file to set up interrupt service table (IST)
*

*------------------------------------------------------------------------------
* Global symbols defined here and exported out of this file
*------------------------------------------------------------------------------
   .global _vectors    ; table start
   .global _c_int00    ; RESET
   .global _vector1    ; NMI
   .global _vector2    ; reserved
   .global _vector3    ; reserved
   .global _vector4    ; INT4
   .global _vector5    ; INT5
   .global _vector6    ; INT6
   .global _vector7    ; INT7
   .global _vector8    ; INT8
   .global _vector9    ; INT9
   .global _vector10    ; INT10   
   .global _vector11    ; INT11
   .global _vector12    ; INT12
   .global _vector13    ; INT13
   .global _vector14    ; INT14
   .global _vector15    ; INT15

*------------------------------------------------------------------------------
* 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 _HPIHostInt__Fv

*------------------------------------------------------------------------------
* This is a macro that instantiates one entry in the interrupt service table.
*------------------------------------------------------------------------------
VEC_ENTRY .macro addr
    STW   B0,*--B15
    MVKL  addr,B0
    MVKH  addr,B0
    B     B0
    LDW   *B15++,B0
    NOP   2
    NOP  
    NOP  
   .endm

*------------------------------------------------------------------------------
* This is a dummy interrupt service routine used to initialize the IST.
*------------------------------------------------------------------------------
_vec_dummy:
  B    B3
  NOP  5

*------------------------------------------------------------------------------
* This is the actual interrupt service table (IST). It is properly aligned and
* is located in the subsection .text:vecs. This means if you don't explicitly
* specify this section in your linker command file, it will default and link
* into the .text section. Remember to set the ISTP register to point to this
* table.
*------------------------------------------------------------------------------
 .sect ".text:vecs"
 .align 1024

_vectors:
_vector0:   VEC_ENTRY _c_int00        ; RESET
_vector1:   VEC_ENTRY _vec_dummy    ; NMI
_vector2:   VEC_ENTRY _vec_dummy    ; reserved
_vector3:   VEC_ENTRY _vec_dummy    ; reserved
_vector4:   VEC_ENTRY _HPIHostInt__Fv    ; INT4: HPI interrupt (event 47)
_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    ; INT9
_vector10:  VEC_ENTRY _vec_dummy    ; INT10
_vector11:  VEC_ENTRY _vec_dummy    ; INT11
_vector12:  VEC_ENTRY _vec_dummy    ; INT12
_vector13:  VEC_ENTRY _vec_dummy    ; INT13
_vector14:  VEC_ENTRY _vec_dummy    ; INT14
_vector15:  VEC_ENTRY _vec_dummy    ; INT15

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