UART register persistence

Is it possible to configure the UART Control, Misc, and Reg5 registers in such a way that the changes will persist between uses of a given UART? I understand that power cycling will reset the registers.

Modifying the memory mapped hardware registers for a UART is simple to do from the command line, but the changes are overwritten when a program accesses said UART (e.g. screen /dev/ttyAML0 will cause changes to the above three registers to be replaced with some defaults).

In particular, I am looking to configure new default values for the RX filter bits in the UART Misc registers for UART_AO_A, UART_AO_B, and UART_EE_C. If this can be accomplished with a device tree overlay, would it be possible to get an example?


1 Like

under /etc/systemd/system, create a service file similar to

 Description = Blink my LED

 ExecStart=/usr/bin/python3 /<your location>/

Alter ExexStart with the script you want to execute.
In this script, you can configure your GPIO like this
BTW, UART_AO_A_RXD corresponds to GPIOAO_1 of which pin number is 413.
I didn’t test the above steps, but they may help.