Altera_Forum
Honored Contributor
20 years agoFYI: Avalon Uart Baud Rate Bug
This problem is already solved, I'm just posting in case it helps anyone else.
There is an enumeration of 'standard' baud rates in packages/io/serial/current/include/serialio.h called cyg_serial_baud_rate_t. You are supposed to use these baud rates to setup any serial port under eCos with the cyg_io_set_config call. The underlying driver is supposed to map these enumerated values to the correct baud rate divisor. This gets done in /packages/devs/serial/sopc/altera_avalon_uart/current/src/altera_avalon_uart.c. The problem is that if you index this table with the cyg_serial_baud_rate_t values, the baud rate will not be correct. The 0th entry of the array altera_avalon_uart_speed is 50, but the enumeration CYGNUM_SERIAL_BAUD_50 is equal to 1. To fix this, my q&d solution was to put a dummy entry in the altera_avalon_uart_speed array in the 0th position. The code which does the mapping could be altered instead, but this way worked fine for me.