Topic : No interrupt on UART

Forum : ST7/STM8

Original Post
Post Information Post
April 8, 2009 - 11:04am
Guest

The code I use works fine with COSMIC, but when using raisonance I don't get interrupt on UART.
My timer interrupt works fine.

The interrupt is enabled like this:

UART1_ITConfig(UART1_IT_RXNE_OR, ENABLE);

and the interrupt handler (which isn't reached) looks like this:

void UART1_RX_IRQHandler (void) interrupt 18
{
   /* In order to detect unexpected events during development,
       it is recommended to set a breakpoint on the following instruction.
    */
    /* Read one byte from the receive data register */
      uint8 Data;
      while (UART1_GetFlagStatus(UART1_FLAG_RXNE) != RESET)
      {
         Data = UART1_ReceiveData8();
         if (Data == '\n') 
         {
            RxBuffer.DataPresent = COM_STATUS_OK;
         }
         else
            RxBuffer.Buffer[RxBuffer.WritePos++] = Data;
         if (RxBuffer.WritePos == BUFFER_SIZE) RxBuffer.WritePos = 0;
      }
    while (UART1_GetFlagStatus(UART1_FLAG_OR) != RESET)
         Data = UART1_ReceiveData8();
}

I'm using a STM8/128-Eval board.
What can be wrong?

Replies
Post Information Post
+1
0
-1
April 8, 2009 - 1:52pm
Raisonance Support Team

Hello Peande,

Indeed your code looks right to me. Debugging the interrupts is always a pain...
Do you have the latest RKit-STM8 version (a free update has been released last week and may fix some problems)? If not, try to update it.

Check that the STM8 is properly configured:
1) Can you check that the interrupt vector is properly set? At 0x8050 you should see a 0x82, then the 3-byte address of your function.
2) Try to place a breakpoint on the fonction entry, checking whether the interrupt happens or not.
3) Check that your interrupt is not masked by the ITC controller.

You should check is that the UART_IRQ example from the ST Firmware Library works before trying to dig out this bug.

You can also check with the ST support guys, they might have some more help for you.

I hope this helps, let us know if you find out what happens.
Bruno