I'm trying to run communication with my hardware using RPi built-in UART ports. I need to use 3 UART ports at 4M baud rate. I added to /boot/config.txt following lines at the end:
And switched off serial console from raspi-config
When I try to configure /dev/ttyAMA1 or /dev/ttyAMA2 I get following error:
Exception: Command 'stty -F /dev/ttyAMA1 4000000' returned non-zero exit status 1. stty: /dev/ttyAMA1: unable to perform all requested operations
Maximum what is possible to set is 2000000. I checked that echo works fine, but I didn't verify if it's really 2M with oscilloscope.
I found some answers related to UART clock speed but they seems to be obsolete - they are all about RPI2 or RPI3 and only UART0.
Question: How to set baud rate to 4000000 for any 3 ports of RPi?