Should there be a stdio_uart_deinit()? #810

Closed
opened 2022-05-04 19:07:33 -05:00 by bruelltuete · 0 comments
bruelltuete commented 2022-05-04 19:07:33 -05:00 (Migrated from github.com)

I would like to disable UART console output after running for a while. Idea is to dump boot diagnostics to console but once everything is up and running (say after 1 minute or so) I would like to disable UART output to save power running off batteries.
I'd call stdio_uart_deinit and then clock-off UART. My crusty amp meter says clock-off will save about 0.5mA.

Stumbled over #808 while trying this.

I got a related question: what is supposed to happen (wrt to printf) if I disable CLOCKS_WAKE_EN1_CLK_SYS_UART0_BITS and CLOCKS_WAKE_EN1_CLK_PERI_UART0_BITS? Somewhere down the call stack is a call to uart_write_blocking(). If the UART controller is not clocked, is there always space in the tx fifo?

I would like to disable UART console output after running for a while. Idea is to dump boot diagnostics to console but once everything is up and running (say after 1 minute or so) I would like to disable UART output to save power running off batteries. I'd call `stdio_uart_deinit` and then clock-off UART. My crusty amp meter says clock-off will save about 0.5mA. Stumbled over #808 while trying this. I got a related question: what is supposed to happen (wrt to printf) if I disable `CLOCKS_WAKE_EN1_CLK_SYS_UART0_BITS` and `CLOCKS_WAKE_EN1_CLK_PERI_UART0_BITS`? Somewhere down the call stack is a call to `uart_write_blocking()`. If the UART controller is not clocked, is there always space in the tx fifo?
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk#810
No description provided.