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.

How to force System Software Interrupts(SSI)

Other Parts Discussed in Thread: HALCOGEN

Dear TI,

I had studied the Technical Reference Manual (Section 2.3.3) (SPNU515A)for SSI.

However, I still can't totally understand how to force System Software Interrupts(SSI).

Please help to solve my questions.

1. Could we use Halcogen to enable/setting SSI?

2. In TRM, it describes TMS570 provides generating up to four software interrupts, but I check the channel of VIM.  Just only 1 channel(No.21) is reserved for SSI. What about the other 3 interrupts?

3. Where can I find the location of ISR? For example, the ISR of PWM will be found in etpwm.c file.

4. In VIM RAM sheet of Halcogen  , why is the ISR name of SSI(No.21) is "phantomInterrupt"?

5. Could your describes the step by step tutorial for forcing SSI?

Best Regards,

Fan

  • Hi,

    1. Enable Channel 21 in 'VIM Channel 0-31' Tab as either IQR or FIQ. Also provide the ISR name in the 'VIM RAM' Tab. HALCoGen does not provide a default interrupt handler for SSI interrupt. Hence the default ISR name is given as 'phantomInterrupt'. You can change the name and define the handler in any of the files.

    2. Even though there are four registers used to force the software interrupt, all the four interrupts are mapped to 1 VIM Channel (No. 21). The ISR needs to check the SSIVEC register to check which one caused the interrupt.

    3 and 4. HALCoGen does not provide an ISR for SSI interrupt. Hence it is maped to 'phantomInterrupt by default. User needs to change the ISR name in the table and define it.

    5. Make sure you enable the interrupt in VIM and provide the correct ISR name in the VIM RAM Table. For forcing an SSI interrupt, write the key '0x75' in SSKEYx bit field in SSIRx register. This generates an interrupt immediately. Make sure you clear the SSIVEC register in the ISR.

    Hope this helps!

    Thanks and regards,

    Veena

  • Veena,

    It's useful to me.
    Thanks a lot your reply, I'll try it.

    Best Regards,
    Fan
  • Dear Veena,

    I had successfully forced SSI interrupt, but there are still some problems.

    Could you continue to solve my following question.

    1. When I enable the SSI interrupt, the PC will always running in ISR, even I had cleared the flag.

    SSICRT is a counter to count the how many times of PC go into ISR. 

    However, we can found the SSICRT is continuously to count.

    Please check my ISR.

    void ssiInterrupt(void)
    {
    	SSICRT++;
    	systemREG1->SSIF = 1; //Clear Flag
    }

    2. In TRM, it describes " A read from the SSIVECT bits clears the corresponding SSI_FLAG[4-1] bit in the SSIF register". Also, we can write 1 into SSIF to clear Flag. What's the difference between these two operation, when we want to clear the flag.

     

     

  • Hi,


    Please provide #pragma directives as follows to the ISR. This is needed for a clean return from the interrupt handler.

    #pragma CODE_STATE(ssiInterrupt, 32)
    #pragma INTERRUPT(ssiInterrupt, IRQ)

    void ssiInterrupt(void)

    {

    }

    Hope this helps!

    Thanks and Regards,

    Veena

  • Dear Veena,

    Thanks a lot for your help.
    Now, It's normally. Could you explain the two instructions? Or which documents can be found the regarded information?
    Thanks again.

    Fan
  • Hi Fan,

    #pragma CODE_STATE(ssiInterrupt, 32) makes the function to be compiled in 32-bit mode and #pragma INTERRUPT(ssiInterrupt, IRQ) tells the compiler that the function is an IRQ interrupt. This is needed because the context saving and restoring is different for different interrupts and normal function.

    Please refer the document ARM Optimizing C/C++ Compiler (www.ti.com/.../spnu151j.pdf) for more details on pragmas.

    Thanks and Regards,
    Veena
  • Dear Veena,

    Could you continue to solve my questions?

    As you know, I want to force an interrupt during write/read data through FEE.

    Now, I had achieved to force SSI and write/read data through FEE separately.

    However, I try to integrate it, but it cause some errors that I can't remove.

    Could you help to solve my problems?

    I attached my project as follow.3364.FEE_SSI.rar