zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.51k stars 6.44k forks source link

nios2: support serial console #1827

Closed zephyrbot closed 8 years ago

zephyrbot commented 8 years ago

Reported by Andrew Boie:

As a developer, having a working serial console greatly assists in debugging as I can get diagnostic messages from the kernel without being in a GDB session. For the scope of this ticket we only need to transmit messages not receive them, CONFIG_UART_INTERRUPT_DRIVEN can be disabled (see GH-1843)

We requested a 16550 UART in our reference CPU implementation, so we should hopefully be able to use existing drivers. There is some detail in the Embedded IP Peripherals User Guide, chaper 8. They also included a JTAG UART in the CPU design. I am not sure which we need to use.

The console message should be exposed over the debug USB port on the Altera Max10 board, just like when booting Linux.

Once this is working, turn off CONFIG_RAM_CONSOLE as we won't need it any more.

(Imported from Jira ZEP-264)

zephyrbot commented 8 years ago

by Juro Bystricky:

There is reusable code that uses (polling) JTAG UART in Linux/arch/nios2/kernel/early_printk.c Generally, JTAG UART should be used for developer debug messages, leaving the "real" UART to be used as intended by user applications.

zephyrbot commented 8 years ago

by Andrew Boie:

There is also a JTAG UART driver in the baremetal Altera HAL code

zephyrbot commented 8 years ago

by Andrew Boie:

implemented via JTAG UART driver

zephyrbot commented 8 years ago

Blocks ZEP-279