Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
821 Views

Bug in altera_16550_uart_init.c (altera_16550_uart_init function)

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