0

I'm using serial to communicate with this board (Serial-CAN-Board) on a RPi4. UART is enabled with

enable_uart=1

Console over serial has been disabled with raspi-config and I am using SSH over ethernet to access the Pi. I had been using /dev/serial0 mapped to /dev/ttyS0 but found that after a few minutes the serial communication would stop working (no bytes received). I'm running at 115200 baud. I read that ttyAMA0 which uses PL011 should be more robust but after adding

dtoverlay=disable-bt 

to disable bluetooth and map /dev/serial0 to /dev/ttyAMA0, the code doesn't work. Scoping the rx and tx pins everything looks fine but bytes sent to the rx of the RPi don't seem to become available for multiple seconds. The output of dmesg | grep tty is shown below.

    dmesg | grep tty
[    0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 bcm2708_fb.fbwidth=0 bcm2708_fb.fbheight=0 bcm2708_fb.fbswap=1 smsc95xx.macaddr=E4:5F:01:3F:9D:25 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000  console=tty1 root=PARTUUID=6bd6e2d5-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
[    0.001099] printk: console [tty1] enabled
[    1.536555] printk: console [tty1]: printing thread started
[    1.545512] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 36, base_baud = 0) is a PL011 rev2
[    1.550661] fe215040.serial: ttyS0 at MMIO 0xfe215040 (irq = 38, base_baud = 62500000) is a 16550

I'm using a real time kernel with the PREEMPT_RT patch (found here) which might affect things.

Would changing the number of bytes to trigger an interrupt in the PL011 FIFO potentially help things? (and if so how do I do that). Is there a way to may /dev/ttyS0 actually stable?

I'm starting to go insane here so any help would be appreciated.

  • "the code doesn't work" What code? It is far from clear what you have actually done. Why not use one of the other [Raspberry Pi4 UART](https://raspberrypi.stackexchange.com/a/107780/8697)? – Milliways Jun 25 '22 at 02:06

0 Answers0