#1548 closed defect (fixed)

ERC32 console stops working when UART error flags are set

Reported by: Gerardo Puga Owned by: Gedare Bloom
Priority: normal Milestone: 4.11
Component: bsps Version: 4.11
Severity: normal Keywords:
Cc: cynt6007@…, chirayudesai1@… Blocked By:



The console works fine when only transmitting data from the ERC32, but stops working after a while when receiving data.

"Stops working" means, bytes are neither sent nor received from the UART, but the rest of the system keeps functioning (task are executing, the operative system is responsive, etc).


Working with RTEMS 4.8, and compiling the OS with the option CONSOLE_USE_INTERRUPTS.

I haven't compiled RTEMS 4.10 from the cvs, but I saw the code for the HEAD revision and saw there are significant changes to the console driver.
However, the code seems to have the same bug.

I tracked the problem and found that:

  • When an RX error occurs, the ERC32 UARTS stop generating RX/TX interrupts until the corresponding error flag in the UART_STATUS are cleared.
  • The console.c code currently cleans the error flags from the console_isr_x subroutines, but those are NOT called when an RX error occurs. Thus the error flag is never cleaned and then the UARTs stop generating interrupts indefinitely.
  • The ERC32 UARTs generate a different interrupt when an RX error occurs.

I solved the problem by:

  • Adding a third interrupt service routine console_isr_error to handle the UART_ERROR trap. This isr cleans the error flags of the channels.
  • Cleaning the error flags manually just after having initialized the interrupt vectors. This is because if the error flag was already set by the time the interrupt vectors are configured, the interrupts might never be called.

Attachments (2)

error.interrupt.patch (2.6 KB) - added by Gerardo Puga on Jun 10, 2010 at 12:10:30 PM.
Modification to add UART error handling.
0001-PR-1548-ERC32-console-stops-working-when-UART-error-.patch (2.9 KB) - added by Chirayu Desai on Dec 23, 2013 at 2:34:31 PM.
Patch for rtems4.11

Download all attachments as: .zip

Change History (6)

Changed on Jun 10, 2010 at 12:10:30 PM by Gerardo Puga

Attachment: error.interrupt.patch added

Modification to add UART error handling.

Changed on Dec 23, 2013 at 2:34:31 PM by Chirayu Desai

Patch for rtems4.11

comment:1 Changed on Dec 23, 2013 at 2:38:04 PM by Chirayu Desai

Cc: Chirayu Desai added

comment:2 Changed on Jan 8, 2014 at 4:42:45 AM by cynt6007

Cc: cynt6007 added
Owner: changed from Joel Sherrill to Gedare Bloom

comment:3 Changed on Jan 9, 2014 at 1:45:52 PM by Gedare Bloom

Resolution: fixed
Status: newclosed

Patch applied to 4.11. Back-port to 4.10?

comment:4 Changed on Nov 24, 2014 at 6:58:28 PM by Gedare Bloom

Version: HEAD4.11

Replace Version=HEAD with Version=4.11 for the tickets with Milestone >= 4.11

Note: See TracTickets for help on using tickets.