Breakpoint inside interrupt C

I am using LCDK C6748 from Texas Intruments with Studio Composer Studio and TMDSEMU100V2U-14T - JTAG emulator for XDS100v2 .

The LCDK comes with many support functions, including a function that initializes the board and determines which callback functions are called for each interrupt.

I just implemented a callback function, so it does something when a new sample comes from the ADC.

I tried to set a breakpoint inside the interrupt, but during execution the "thread" program did not get there.

Also, I did something simpler:

volatile int flag = 0;


interrupt void interrupt4(void) // interrupt service routine
{
   flag = 1;
   return;
}

int main(){
    // board initializing function, defining sampling rate etc.
    L138_initialise_intr(FS_48000_HZ,ADC_GAIN_0DB,DAC_ATTEN_0DB);

    while(1){
       if (flag == 1){
          printf("interrupt entered");
          flag = 0;
       }
    }
}

      

but for some reason the while loop was only introduced once.

it surprised me because if I didn't set a breakpoint, the interrupt is injected continuously - I tried to just feed the samples to the loudspeaker line without doing anything else and I heard music.

I have a feeling that I am missing something very important about interrupts, I am completely new to this topic.

Can someone explain to me [or a link to a good source explaining how the mechanism in DSP works]:

1) why can't we set an interrupt inside an interrupt?

2) why even if I set a breakpoint in the main, it seems that the interrupt is not happening, and if I don't.

3) How should I have access to variables at runtime, in CCS?

thank

+3


source to share


2 answers


  • Try putting a breakpoint and then running. see if it hits at least once. If so, then your interrupt source will not be automatically cleared [because you don't explicitly do this inside the ISR]. in the TI controller, they expect you to clear the ISR path for the next one in my experience.
  • If you don't even get the 1st time interrupts, check the build generated for the ISR and the optimizations done by the compiler.

  • While you might need time and protection for globals in case of conflicts, for now the above 2 suggestions should do.



+2


source


I think your interrupt is a timer interrupt. In many jtag cases, when a breakpoint is hit, it stops many MPU / DSP modules, but the timer continues to run. This causes the timer to overflow, which means that the overflow flag is set and the interrupt will never be called until the flag is reset.



I don't know if you can set the jtag to stop the timers also when the breakpoint is triggered. With freescale MPU, IAR IDE and segger jtag, I can.

+2


source







All Articles