NMI problem

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Embos V3.50 Iar compiler V3.20 and

    Let me describe the context : I have a radio communication with another
    equipment that gives me CLOCK using the NMI, and DATA through the P5_7
    port.

    __regbank_interrupt void __NMI_handler( void )[/b]
    {
    rcBitArray[ rcBitCounter-- ] = P5_bit.P5_7;
    }

    The use of this NMI is essential, because I have to read the radio frames immediately when they are available.

    I have also to manage a communication via Uart4 to a PC :

    #pragma vector=(UART4_RX)
    __interrupt void Atlas::ISR_S4_Rx( void )
    {
    OS_EnterInterrupt();
    volatile Int16T rxWord = C_Uart::GetReceivedCharU4();

    .......elab.....

    OS_LeaveInterrupt();
    }

    The problem is that I see the micro stopping to communicate, after some minutes with the PC linked to the uart, and various errors of the OS, such as sometimes, OS_ERR_DICNT, OS_ERR_INV_TASK, OS_LEAVE_INT

    I think the problems is related to the use of NMI in this context, cause if I don't use it I don't see any problem

    May you help me ?
  • Hi fffromeo,


    I guess the problem could be that you cannot mask the NMI interrupt,so you cannot be sure when the interrupt occurs.

    Your C_Uart::GetReceivedCharU4() Method returns the bits you received with the NMI interrupt routine? Are you sure that your
    rcBitArray is big enough to store the data that you collected in the NMI interrupt routine? Which CPU do you use?
  • NMi problem

    Hi, I use Renesas M32C.
    I have 2 communication channels :
    - one RS232 that uses GetReceivedCharU4()
    - a proprietary one that uses NMI,.....rcBitArray is big enough because it uses just 24 bits, and then another interrupt ( int0) reads those, and clears rcBitArray
    The main error is , when I use the NMI, a OS_ERR_LEAVEINT.
    How can I avoid that
    Ciao
    Fabio