We have a problem where a display running on 5V with an UART on 3.3V will self-bias through the UART TX pin when the 5V supply is switched on.
How do you make zephyr not init UART TX at boot? And then how do you init it when you need it?
Thanks.
We have a problem where a display running on 5V with an UART on 3.3V will self-bias through the UART TX pin when the 5V supply is switched on.
How do you make zephyr not init UART TX at boot? And then how do you init it when you need it?
Thanks.
Hello,
It's important that voltages on pins does not exceed vdd+0.3V, see absolute maximum ratings:
https://infocenter.nordicsemi.com/topic/ps_nrf5340/chapters/abs_max_ratings/doc/abs_max_ratings.html
If pin exceed vdd+0.3V the internal ESD diode will trigger, and make a "path" between the pad and vdd, indirectlly supplying the nRF5340 from the pin. The ESD diode will be damaged over time in such a setup and very likely also damage the part. There is no way to override this in software, it's also important that VDD does not exceed 3.6V.
Kenneth
Indeed, I think you are misunderstanding what I'm asking. This is an issue with voltage on the UART pin from the MCU to the Display (when the display is switched off).
Using zephyr, the UART TX pin is automatically init'ed and thus puts 3.3V out of the MCU. How do I avoid that? I tried with zephyr,deferred-init in the devicetree but says it does not exist in nordic,nrf-uarte.
So, how do I do a deferred init of the UART?
Thanks for the clarification, then I believe it may be solved using the power management feature, ref similar issue when using SPI here:
Deinitialize SPI
Kenneth
So it kinda works by turning off the UART after (!) boot. I disable it first thing in main. However, the uart is still initialized high and I can measure this.
Can you have devicetree not init the uart at boot? Or how can a deferred init be done?
So it kinda works by turning off the UART after (!) boot. I disable it first thing in main. However, the uart is still initialized high and I can measure this.
Can you have devicetree not init the uart at boot? Or how can a deferred init be done?
Thanks for the clarification, I know they are working on something like this:
https://github.com/zephyrproject-rtos/zephyr/pull/67335
Until that is ready I may have a different suggestion, in devicetree you can define multiple pinctrl configurations, by default it will use "default", so you can for instance set the tx pin to not used and/or a different pin that is not used. That should solve the problem on how the tx pin behaves at boot. Now the remaining question is how to update the tx pin whenever you want to, and I hope you may find this answer useful:
https://devzone.nordicsemi.com/f/nordic-q-a/101574/dynamic-uart0-pin-change-for-communicating-with-multiple-3-uart-devices-connected-at-different-pins
Kenneth