esp32: Enable an early-boot printk hook

The firmware starts us with an already-initialized UART and a simple
ROM hook.  Use that as the default printk handler so we can log in
very early boot.  It will be overriden later (as it happens, by
another handler based on the same firmware hooks).

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
This commit is contained in:
Andy Ross 2018-11-14 11:19:24 -08:00 committed by Anas Nashif
commit 953a81a194

View file

@ -74,3 +74,13 @@ void __attribute__((section(".iram1"))) __start(void)
CODE_UNREACHABLE;
}
/* Boot-time static default printk handler, possibly to be overriden later. */
int z_arch_printk_char_out(int c)
{
if (c == '\n') {
esp32_rom_uart_tx_one_char('\r');
}
esp32_rom_uart_tx_one_char(c);
return 0;
}