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:
parent
923e1b60e7
commit
953a81a194
1 changed files with 10 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue