Disable console to UART0 (to use UART0 for other purposes)
-
How do I go about programmatically disabling console I/O to UART0? In production, I don't want the console to be there at all, and at the same time, I want to use UART0 to communicate with a serial device.
Note: I say "programmatically" because I want to be able to select console or no console during boot-up (initially disabled, but enabled in boot.py if a particular input put is held low, for example).
-
@Eric24 The are two aspects, REPL prompt and debug messages. The REPL prompt on the console is enabled in _boot.py with os.dupterm() and can be disableb with os.dupterm(None).
The debug messages are told to be disabled some time in one of the next versions. -
@robert-hh Does disabling the REPL prompt free up the UART?
-
@RobTuDelft
Yes. I disable the REPL in boot.py and then use all three UARTS in my application. I use UART0 to communicate with a computer and UART1 & 2 to communicate with sensor networks. -
Ah great, didn't actually test this yet.
Would it be possible to have all UARTs available and instead replicate the REPL over a websocket?
-
@RobTuDelft I assume that would be the case (I haven't had a chance to test it yet), but looking at os.dupterm(None), I would think you could still Telnet into the device.
-
@Shaun Are you able to stop the debug messages, too? Based on my experience (and as @robert-hh mentions), I didn't think they could currently be disabled.
-
@Eric24
The debug messages at startup, before the micropython interpreter starts, are not stopped, but this is not a problem for me.
No further debug messages are output once the python interpreter is started, unless the system throws an error.The startup debug messages are output at 115kbs.
To stop the debug messages, my understanding is that one can compile a custom image with debug messages disabled, but I have not attempted this as they are not hampering my application.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login