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.

rts430x_lc_sd_eabi.lib trap

Other Parts Discussed in Thread: MSP430F5308

Hi,

I've created a new project in CCS 6.0.1 for MSP430F5308.

I've inserted an interrupt handler for a button. 

When tested the button I've found the interrupt is working & arrive to the designated code, when exiting the interrupt 

The interrupt call:

#pragma vector=PORT1_VECTOR
__interrupt void port1ISR(void)
{
          if (P1IFG & BIT5)
          {
     	        //INFO: bottom clicked move to configure MSC.
		LPM3_EXIT; //INFO: exit LPM3 
		configureMSC();
	  }
	  P1IFG = 0;
}

I see the configureMSC function been called & the interrupt handler ends OK.

After a few click (calling over & over to the same function which toggles a led so it is easy to know what works), i've found the system doesn't responds. Than I paused and found out that something is VERY wrong:

in the map file:

                  0000d0a6    0000000c     nwkManagers.obj (.text:spiReadFifo)
                  0000d0b2    00000006     rts430x_lc_sd_eabi.lib : isr_trap.obj (.text:__TI_ISR_TRAP)
                  0000d0b8    00000006     main.obj (.text:_isr:Port_2)

I didn't insert the rts430x_lc_sd_eabi.lib  to the project so I assume the creation of a new project for MSP430F5308 added this by default. 

just to cover the case that id don't respond to interrupt I've created an empty port2 interrupt handler for testing:

// Port 2 interrupt service routine for timing test
#pragma vector=PORT2_VECTOR
__interrupt void Port_2(void)
{
  P2IFG =0;
}

This didn't helped.

  1. When I look at the call stack in the pic above I can't understand what caused the trap, please advice on that. 
  2. in this link this a similar issue? [I don't think so since I didn't imported ANY project etc']
  3. Any advice of what I'm doing wrong will be good.. 

 

  • I found the missing interrupt handler, by looking at the map file & seeing which interrupts are directing to rts430x_lc_sd_eabi.
    Is there a way to know which interrupt caused the trap? [without going over the map file, looking at stack trace or something at run time]

  • Hi Avi,

    This issue is caused by an interrupt being enabled and then firing, that has no ISR included in your code. By default, the compiler will point all unused interrupt vectors to this Trap ISR so that your part doesn't crash.

    One way to debug which interrupt caused the trap, would be to:

    1. Let the code run until it ends up in the Trap ISR
    2. Pause the debug.
    3. Open the register view in CCS and check all of the interrupt enable registers for each module (start with modules used by your code).
      1. Are there any interrupt enable bits set that also have the interrupt flag IFG bit also set?
      2. If so, does your code have an ISR to handle this interrupt?
      3. If there is no ISR to handle the interrupt, this is likely the source of your problem.

    Another way to debug which interrupt caused the trap, would be to create your own trap ISRs. You could basically define an ISR for every interrupt vector that exists on your device - inside each ISR, just put a while(1) with a no operation inside the ISR to trap your code there. Now if you run your code and it gets trapped, you can pause it and see which ISR it is trapped in - this will tell you which module is causing the problem.

    Hope this helps and best of luck!

    Regards,

    Katie


  • Katie hello,

    Well I think that the approach I used is faster.

    I hopped for some generic & automatic tool/register.. 

    Thank you. 

**Attention** This is a public forum