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.

DSP2833x_PieCtrl.h error



A minor error caused big (hard to figure-out) bugs.

 

In DSP2833x_PieCtrl.h, the line:

extern struct PIE_VECT_TABLE PieVectTable;

really should be:

extern volatile struct PIE_VECT_TABLE PieVectTable;

---

Curiously, this header file for some other chips are also missing the volatile keyword.

  • Thanks for letting us know about this. Can you please let us know the context in which you observed the failure. My assumption is once you initialize the PieVectTable you don't need to mess with it. So, the keyword volatile isn't necessary.

    Regards,

    Manoj

  • This was one of the code that volatile affected.

     


    /* Trigger USER1 interrupt */
    #define trap_USER1()    asm("    TRAP #20        ; USER1")


    /* Force an interrupt service routine to run. 
     * This is useful for testing and debugging ISRs.
     ==============================================================================*/

    static inline void trap_ForceIsr( PINT isrPointer )
    {
        volatile PINT * const vectUser1 = &(PieVectTable.USER1);
        PINT oldVector;

        // volatile PINT pointer is used because optimizer will mess up the code without
        // it.  TI's header code did not declare PieVectTable as volatile.

        oldVector = *vectUser1;
        EALLOW;
        (*vectUser1) = isrPointer;    // Load new vector
        asm("  RPT #8 || NOP ");      // Flush the pipeline
        trap_USER1();                 // Trigger the interrupt
        (*vectUser1) = oldVector;     // Restore old vector
        EDIS;
    }

  • We also have code where the vector value gets changed depending on the state of the system.  This allowed different ISRs to be triggered.