Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Bug in altera_16550_uart_init.c (altera_16550_uart_init function)

Altera_Forum
Honored Contributor II
1,143 Views

Hello, 

 

I had a problem with interrupt handling with the 16550 core. 

Presumably a programming error in the C code of the component: 

The uart did not process receive interrupts properly from the start. 

What follows is an exact copy of the nios code for the uart: 

 

altera_16550_uart_init.c line 439: 

/* enable interrupts at the device */ 

regs = iord_altera_16550_uart_ier(sp->base); 

regs |= altera_16550_uart_ier_erbfi_msk | altera_16550_uart_ier_etbei_msk; 

iowr_altera_16550_uart_ier(base, sp->ctrl); 

 

 

Should be: 

 

altera_16550_uart_init.c line 439: 

/* enable interrupts at the device */ 

sp->ctrl = iord_altera_16550_uart_ier(sp->base); 

sp->ctrl |= altera_16550_uart_ier_erbfi_msk | altera_16550_uart_ier_etbei_msk; 

iowr_altera_16550_uart_ier(base, sp->ctrl); 

 

 

=> reading the interrupt enable register, modifying the read contents and then writing the result back using a different value does not make sense. 

 

Best Regards, 

Johi.
0 Kudos
0 Replies
Reply