Altera_Forum
Honored Contributor
18 years agoNIOS inb does 4 byte accesses to UART
I'm using the OpenCores 16550 UART and found the NIOS processor does 4 sequential byte accesses when I read a single byte. I've setup the serial.h file to use UPIO_PORT so that eventually calls inb from serial_in.
I've traced the UART accesses with Signal Tap and I see 4 sequential accesses for each inb call (i.e. inb(addr + 1) will read from addr+0, addr+1, addr+2, and addr+3). outb works fine and does a single byte write as expected. Setting the MSB address bit to bypass cache had no effect. Also using a volatile char ptr yields the same results as inb accesses. We have the UART working fine in the same FPGA when it is connected to an external master which can do byte accesses to the Avalon Bus. In this setup there is no NIOS and I can send and receive a single byte of data as expected. The UART address space shows up as 8 bytes in both instances. Any ideas why the NIOS turns a single byte read into 4 but an external master does not? Thanks, Stefan