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.

Concerto ILLEGAL_ISR

Other Parts Discussed in Thread: CONTROLSUITE

Hi,

We are developing a project with concerto. Our software that is in the c2000 side branches to illegal_isr strangely. We are using the QEI timer interrupt. But weird things happen. When I change a line of code it branches to illegal_isr. To solve it I change the optimization level from 2 to 1 and it is working. Then I changed another line of code that has nothing to do with the interrupt. Then does the same thing. Then I changed the optimization level  from to 2 to 1 and it works again. Sometimes when the optimization level is 0 it doesn't work. I am playing with the optimization to make the code run after changing a few lines of code. How can I find the reason of illegal_isr? I can not turn off the optimizations.  When I do that, illegal_isr happens more frequently.It was happening sometimes before I started to use the QEI timer interrupt.

If anyone has an idea, please help.

Thanks.

  • Unal

    looks like memory corruption. stack over flow or data array over flow.

     

    Best Regards

    Santosh

  • Santosh,

    I don't use arrays in the code that I change.  Also my stack is too large, the value of the stack size is 0x1000. What do you mean by memory corruption ? How can I find the reason?  

    Also I don't understand, why the code works after changing optimizations? Is it normal ?

  • yeah, turning on different level of optimizations produces different code.  If your code already has a problem of memory corruption different optimizations could produce different symptoms, code could fails at different times as well.

    in your iTRAP handler can you findout the address where illegal instruction is fetched? you can do this by stepping through the iTrap handler once it is hit and see where it returns if your handler is coded to so (for debug). Once you get this address you refer to the map file see whats loaded in there and step through the function which has the actual problem.

     

    hope it helps.

     

    Best Regards

    Santosh

     

     

     

  • Hi Santosh,

    Thank you for your reply. What do you mean by iTrap handler? Do you mean the illegal_isr function? It is the default handler function that is inside controlsuite. There is an infinite loop inside. If I delete the infinite loop and look at the address returning from the function, is it the right thing to do ? Also do I have to do debug in assembly or in c? 

    Best Regards

  • Unal,

    sorry, by iTrap I mean the exception vector 19 (below NMI) in the vector table shown in Table 1-13 page 116 of the device TRM.

    if it is same as above then yes, you can modify the routine for debug and see where it returns.

     

    Best Regards

    Santosh