This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Interrupt Acknowledging // System crashes after 300 interrupts (Cortex M3)

Hi,

I do use the KEIL Evaluation Board with the TMPM330 Cortex M3 processor.

I try to build a controller and have some issues with using interrupt with UART communication (INTRX0 to be precise). It is very rare as it only happens after around 300 interrupts in a row without any major breaks between them. (Sending data via Realterm).
It can be observed that it is also not stopping the whole system, it is more like that the interrupt is no longer working so as it would be disabled.

In addition, I am unsure if there might be a correlation that I do not acknowledge the interrupt in any way. I do know how to acknowledge interrupts on other systems but I do not have any idea how to do it on a Cortex M3. So I suppose this could be a reason why it is not working.

It would be great if anyone could give me a hint or tell me how I can acknowledge interrupts (if needed).

Thanks a lot!!

Below is the code I use for testing, it is very stripped down as I wanted to investigate that issue.

STATEMACHINE:

__task void stateMachine(void)          {
  uart0_init();
  uart0_rx();
  for(;;){
        os_evt_wait_and(0x0001, 0xFFFF);
        printf(" f...HAS A GO ");
        rxBufferUART0[0] = SC0->BUF;
    rxBufferUART0[1] = SC0->BUF;
        switch(rxBufferUART0[1])        {
          case _Setup:
            uart0_tx('e','2');
          break;
          case _Training:
        uart0_tx('t', '2');
          break;
          case _Break:
            uart0_tx('b', '2');
          break;
          default:              //Sleep
            uart0_tx('s','2');
          break;
        }
        uart0_rx();
        os_evt_clr (0x0001, t_fsm);
  }
}

 UART0: 
void uart0_init () {
  unsigned int volatile * const intReg1 = (unsigned int *) INTSETEN1_ADDR;
  PE_UART0_ENABLE
  UART0_ENABLE
  *intReg1 |= 0x0040;   //Enable the INTRX0
  rxMsgCounterUART0 = 0;
  txMsgCounterUART0 = 0;
}

void uart0_rx () {
  /* Running 24/7 after it is executed (has to be stopped)*/
  SC0->MOD0 |= 0x20;
}

void INTRX0_IRQHandler(void) __irq{
  /* New Byte recieved on UART0 */
  printf("\n rx UART0: msg #%d recieved", ++rxMsgCounterUART0);
  isr_evt_set(0x0001, t_fsm);
}

void uart0_tx(char first, char second)  {
  SC0->BUF = first;
  SC0->BUF = second;
  SC0->MOD1 |= 0x10;
  printf("\n tx UART0: msg #%d sent, %c, %c", ++txMsgCounterUART0,first,second);
}