As I mentioned in my previous few forum posts, i'm implementing the FreeMODBUS library on the TM4C123GH6PM. I managed to get it working, and successfully tested it with Modbus Poll on Windows. Now i'm implementing the Modbus diagnostics function, and I need to enable UART overrun interrupts to count the number of overrun errors. However, something unexpected happens.
The Modbus application periodically calls the following code, in order to enable and disable UART Rx/Tx interrupts:
When running the application with this code in debugging mode, I can pause the execution of the code or stop at a breakpoint, and then resume the application as normal. Everything still works as expected - the controller continues to receive and send Modbus messages. Now I want to add the following mask to the UARTIntEnable function calls, in order to enable UART overrun error interrupts:
If I add this code, the application initially works as expected. However if I pause the application, or stop and resume from a breakpoint, the application stops working. The UART interrupts are no longer triggered, and Modbus messages are no longer sent or received. I have no idea why this happens, and I would be hesitant to use this code in the final controller build. The UART ISR currently looks as follows - I haven't even tried to handle the overrun error interrupts yet:
Any help would be greatly appreciated.
Many thanks,
Ksawery



