Serial unit / termios include file doesn't have constants for bitrate >460800 for ARM 32bit architecture
Original Reporter info from Mantis: pik33
-
Reporter name: Piotr Kardasz
Original Reporter info from Mantis: pik33
- Reporter name: Piotr Kardasz
Description:
I tried to set serial communication using serial unit. It doesn't work if the baudrate is over 460800 I found that Bxxxxxx constants are defined only up to 460800 for 32bit ARM, and the procedure defaults to 9600 bps.
I solved the problem by copying the serial.pp file to my project folder, merge it with termiosh.inc and then adding lacking constants which are (experimentally tested):
B500000 = $1005
B576000 = $1006
B921600 = $1007
B1000000=$1008
B1152000=$1009
B1500000=$100a
B2000000=$100b
B2500000=$100c
B3000000=$100d
B3500000=$100e
B4000000=$100f
Now I can use serial communication up to 4 Mbps as expected.
Steps to reproduce:
On RPi4, running 32-bit linux, try to call setserparams from Serial unit with baudrate over 460800 bps and it sets 9600 bps instead because of no constants defined for arm32
Mantis conversion info:
- Mantis ID: 39101
- OS: RaspiOS
- OS Build: Linux 5.10.17
- Build: 64989M
- Platform: RaspberryPi4 / ARM32bit
- Version: 2.0.12
- Monitored by: » AntonK (Anton Kavalenka), » @ccrause (Christo Crause)