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.

TMS320C5517: Software interrupt examples

Part Number: TMS320C5517

Hi Experts,

According to the TRM, it seems there are 6 software interruptions available for the user.
SINT10, 27, 28, 29, 30 and 31.

Q1) Are all 6 software interrupts available for a user code?
Q2) Could you please share an example code for the software interruption?

I write the code below. I am not sure that it works or not.
I would to have an example code like this.


#define SINT10_EVENT 10

main(){
 ...
   config.funcAddr = & SWint10;
   IRQ_plug(SINT10_EVENT, config.funcAddr);
 ...
   INTR_FUNC ( SWint10 , SINT10_EVENT );


}

interrupt void SWint10 (void){
 ...
}

Thank you for your kind help.
Best regards,
Hitoshi

  • Hi Experts,

    I have made an example code as follows:

    #define SINT10_EVENT 10
    extern interrupt void SWint10();

    void main(void){

       /* Clear any pending interrupts */
       IRQ_clearAll();

       /* Disable all the interrupts */
       IRQ_disableAll();

       IRQ_plug(SINT10_EVENT, &SWint10);
       IRQ_enable(SINT10_EVENT);


       __asm("INTR #10");

     ...
    }

    interrupt void SWint10(void){

     ...
    }

    [E0003]
    Only labels and comments may begin in the first column. Make sure
    that the label name is not a reserved keyword.
    INTR #10


    [E0000]
    parse error
    INTR #10

    Could you please let me know the correct ISR call function?
    If INTR_FUNC () works, it is OK please let me know the right programing.

    Thank you and best regards,
    Hitoshi

  • Hi Sugarawara-san

    Here is what i got from one of the c55x experts

    Looks like syntax for calling asm from c is wrong:  __asm("INTR #10");

     

    It should look like below – with a  space after the “ – without the space, the asm instruction looks like a label.

     

    asm(" STM                         #0,SWWSR");

              ^--one or more space needed

     

    Once that is resolved, there could be a mismatch with algebraic vs mnemonic assembly.  

    Please see if this helps.

    REgards

    Mukul 

  • Hi Mukul,

    Thank you for your advise.
    I have added the spaces more than 20, however, it showed "parse error".

    I have checked the Runtime Model Options as attached.
    "Algebraic" is selected with this project.
    "INTR" is in Mnemonic Instruction Set.

    so I changed the code below and the error was disappeared.

    asm(" intr(10)");

    I am not sure if it could make a software interruption correctly or not.
    But I have asked a customer to try it.
    Will keep you informed.
    Best regards,
    Hitoshi 

  • Hi Mukul,

    Thank you for your support.
    Confirmed that everything worked fine.

    Best regards,
    Hitoshi