-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stdio/stderr UART initialization #317
Comments
This is closely related to #275 I would like to add a device-initialisation phase that can run on the scheduler's stack before we start the scheduler. This is the right place to do UART initialisation and would also be a good place to configure the revoker. The allocator should be able to have a capability that excludes the registers that configure the revokable range of memory and have early initialisation code set this. |
I just ran into a hang running the test suite on Sonata with reduced UART FIFO sizes (we're moving to small FIFOs to save on FPGA resources). The core issue was a write to
stderr
which goes touart1
if it exists (which it does on Sonata).cheriot-rtos/sdk/include/stdio.h
Lines 33 to 37 in b6875ba
The problem is
uart1
never get initialised so our small transmit FIFO fills up and the test hangs.stdout
goes touart
oruart0
which gets initialised in the loader:cheriot-rtos/sdk/core/loader/boot.cc
Lines 1048 to 1055 in b6875ba
But there's no initialisation for
uart1
.Clearly I can just initialize
uart1
in the same place but is that the most appropriate place for it? In particular that's aiming to initialise the UART used for debug logs which has the happy side effect of initialising the UART used forstdout
as they're the same UART. So mixing in initialisation for stdio specific things doesn't clearly fit there.We may want
stdout
andstderr
to both go touart
on Sonata anyway so I can sidestep the problem that way but nevertheless there should be some defined stdio or UART init this can all be properly handled in.The text was updated successfully, but these errors were encountered: