Change Baudrate for Built-On Serial
#1
The serial port on the RPi header has a baud of 1,500,000. This is fine for most tools, but some are capped at the values present in the baud tables in various places in the Linux kernel and other utilities.

How do I change the baud to 460800? I've found the uarts in rk3399.dtsi in the kernel tree, but am unsure how their clocks are actually generated.

As expected software seems unable to change the speed of the serial port.
  Reply
#2
Hello R0b0t1,
  I do not know, what software you are using to operate the UART. I usually use C-programs for this purpose. So my experience is limited to Linux and C.
  Before any further consideration, I would like to strongly discourage from using UART2 on ROCKPro64. It is used by system console in Linux, any my attempts to connect two-way communication to this port ended with the board hanging completely after some time. I tried Armbian, Mrfixit2001 and Ayufan images. It is better to activate one of unused UARTs and use it.
  The C-interface for UART speed in Linux (cfsetispeed() ) is limited to only some baud-rates up to 230400. This might be the reason, why many software tools offer only limited UART-speed settings.
Once, I needed to overcome this issue on another ARM board. My solution was not very elegant, but I do not know any other:
  1. Open the device-file and set it for communication, by using the standard functions (fcntl(), tcsetattr(), ioctl()...)
  2. Map the memory part, which contains the UART control registers.
  3. Set the speed of UART directly in the control registers.
  4. Continue with communication in the program.
I do not want to post the coding here, because it is for a different chip.
Description of the control registers, and their settings can be found in the TRM document of RK3399 (http://opensource.rock-chips.com/images/...170408.pdf).
Maybe you could apply similar procedure?
Please, be aware that those boards cannot generate any UART frequency. Sometimes approximations must be used.
  Best regards,
  Gienek.
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Anybody built a RockPro64 Cluster ? axelf 10 4,112 08-16-2020, 05:35 PM
Last Post: ichibon-brosan
  Is there a guide to using the PADI-Server serial console adapter? Tim Jones 1 440 11-04-2019, 01:25 PM
Last Post: xalius
  Serial communcation with USB to serial(DB9) cable rahulsharma 6 1,493 01-12-2019, 10:29 AM
Last Post: martinayotte
  u-boot serial port speed? zener 2 841 10-06-2018, 12:47 PM
Last Post: zener

Forum Jump:


Users browsing this thread: 1 Guest(s)