This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BEAGL-BONE-BLACK: Cant get PRU-ICSS SW UART to work

I am not able to get the SW UART to work on the Beaglebone black and I am not sure what I am issing.

Board: Beaglebone black

Base Image : am335x-debian-11.7-iot-armhf-2023-09-02-4gb

I have successfully compiled and installed a new kernel, with the options as specified under "PRU Soft UART driver Kernel Config" at https://software-dl.ti.com/processor-sdk-linux/esd/docs/latest/linux/Foundational_Components/PRU-ICSS/Linux_Drivers/pru-sw-uart.html

I compiled the kernel using instructions found at docs.beagleboard.org/.../kernel.html

I have successfuly compiled the DTB am335x-boneblack-pruswuart.dts and copied it to /lib/... then loaded it via uEnv.txt (as `dtb=/lib/...`).

To get this to even load, I had to set 

```

enable_uboot_overlays=0
enable_uboot_cape_universal=0
disable_uboot_overlay_emmc=1
disable_uboot_overlay_video=1
disable_uboot_overlay_audio=1
disable_uboot_overlay_wireless=1
disable_uboot_overlay_adc=1

```

(maybe disabling all was not needed, but I dont need any of this for my POC)

Setting `enable_uboot_cape_universal` was absolutely required, as on boot it was loading am335x-boneblack-pruswuart.dtb, and then overwiting it with am335x-boneblack-uboot.dtb

In the logs:

```
uboot_overlays: Switching too: dtb=am335x-boneblack-uboot.dtb
```

SO ... I was able to validate that am335x-boneblack-pruswuart.dtb was being loaded, by checking the output of `gpioinfo`, where I see that pin descriptions were set, as per `gpio-line-names` in am335x-boneblack-uboot.dts, eg. 

```
P8_45 [pru1_swuart0_txd]
P8_46 [pru1_swuart0_rxd]
P8_43 [pru1_swuart0_cts]
P8_44 [pru1_swuart0_rts]
P8_41 [pru1_swuart1_txd]
P8_42 [pru1_swuart1_rxd]
P8_39 [pru1_swuart1_cts]
P8_40 [pru1_swuart1_rts]
```

BUT - Nothing shows in dmesg relating to the PRU / UART, and ONLY /dev/sstS0 appears in the dmesg as an initialised serial port.  No other serial devices created in /dev/, no kernel modules loaded that I can tell to take care of this and no reference to firmware etc for the PRU.....so I am stuck now.

I dont know whart is missing, or what I need to do to be able to actually USE the SW UARTS.

Any help woudl be very much appreciated.

Cheers

Beorn

  • Hi Beorn,

    I believe the Debian OS you use on Beaglebone Black is not released by TI, I don't know how it is packaged, so I can only provide limited support.

    What is the kernel version do you in the Debian on BBB? In the TI Processor SDK for AM335x, v8.2 (with kernel v5.10) still supports PRU SW UART, but v9.1 (with kernel 6.1) doesn't support it anymore.

    Please check if your rootfs has the PRU SW UART firmware - /lib/firmware/ti-pruss/pru_swuart-fw.elf.

  • This would explain a LOT - but is this documented / confirmed anywhere?  I can confirm that I do not find the pru_swuart-fw.elf file (anywhere), but looking at the v9.1 release notes it suggests that it is still supported (refer here) - or is it just that the firmware itsellf is no longer provided?

    If I have to, I will settle for the older version - but I dont like the idea that I may not be able to update.

    Kernel Version:

    debian@BeagleBone:~$ uname -a
    Linux BeagleBone 5.10.168-ti-r71 #1xross SMP PREEMPT Fri Apr 26 08:04:26 CEST 2024 armv7l GNU/Linux

    debian@BeagleBone:~$ gunzip -c /proc/config.gz | grep -i pru
    # CONFIG_TI_PRUETH is not set
    CONFIG_SERIAL_8250_PRUSS=m
    # CONFIG_SERIAL_PRU_SWUART is not set
    CONFIG_UIO_PRUSS=m
    CONFIG_PRU_REMOTEPROC=m
    CONFIG_RPMSG_PRU=m
    CONFIG_TI_PRUSS=m
    CONFIG_TI_PRUSS_INTC=m

    The firmware did not exist on the BBB, so I copied it across from a previous SDK I had installed (ti-processor-sdk-linux-am335x-evm-08.02.00.24).  Perhaps unsurprisingly this did not work (as far as I can tell).

    Ill run some tests today and report back.

  • Hi Beorn,

    When I say "not supported', I meant the function has not been validated.

    I don't know how our SDK dev team managed the PRU SW UART firmware (pru_swuart-fw.elf) in the past, but moving to SDK 9.x, all the firmware are coming from the ti-linux-firmware project on git.ti.com, which doesn't have pru_swuart-fw.elf. I believe this is the reason why SDK9.1 doesn't have this firmware.

    I don't expect the PRU SW UART function would break in SDK9.1 once you copied over the PRU firmware. Looking forward to your test result.

  • So, I managed to get the PRU-ICSS SERIAL UART working - so this proves at least I am able to load appropriate DTBs.

    I am still having problems with the SW UART though - it seems I am not loading the firmware at all.

    I am trying to get the TI SDK working for me ... but I am having issues since I am running under WSL (and dont have direct USB access for the SDK to detect the BBB).

    In any case, I was able to boot using am335x-boneblack-pruswuart.dtb (although there is something I am not understanding here either since setting dtb=... in uEnv.txt does nothing for me, I have been overwriting /boot/dtbs/5.10.168-ti-r71/am335x-boneblack-uboot-univ.dtb which is then restored to the original after boot)

    U-Boot SPL 2019.04-00002-g31a8ae0206 (May 13 2020 - 09:26:17 -0500)
    Trying to boot from MMC2
    Loading Environment from EXT4... ** File not found /boot/uboot.env **
    
    ** Unable to read "/boot/uboot.env" from mmc0:1 **
    
    
    U-Boot 2019.04-00002-g31a8ae0206 (May 13 2020 - 09:26:17 -0500), Build: jenkins-github_Bootloader-Builder-139
    
    CPU  : AM335X-GP rev 2.1
    I2C:   ready
    DRAM:  512 MiB
    No match for driver 'omap_hsmmc'
    No match for driver 'omap_hsmmc'
    Some drivers were not found
    Reset Source: Global warm SW reset has occurred.
    Reset Source: Power-on reset has occurred.
    RTC 32KCLK Source: External.
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from EXT4... ** File not found /boot/uboot.env **
    
    ** Unable to read "/boot/uboot.env" from mmc0:1 **
    Board: BeagleBone Black
    <ethaddr> not set. Validating first E-fuse MAC
    BeagleBone Black:
    BeagleBone: cape eeprom: i2c_probe: 0x54:
    BeagleBone: cape eeprom: i2c_probe: 0x55:
    BeagleBone: cape eeprom: i2c_probe: 0x56:
    BeagleBone: cape eeprom: i2c_probe: 0x57:
    Net:   eth0: MII MODE
    cpsw, usb_ether
    Press SPACE to abort autoboot in 0 seconds
    board_name=[A335BNLT] ...
    board_rev=[00C0] ...
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    switch to partitions #0, OK
    mmc0 is current device
    Scanning mmc 0:1...
    gpio: pin 56 (gpio 56) value is 0
    gpio: pin 55 (gpio 55) value is 0
    gpio: pin 54 (gpio 54) value is 0
    gpio: pin 53 (gpio 53) value is 1
    switch to partitions #0, OK
    mmc0 is current device
    gpio: pin 54 (gpio 54) value is 1
    Checking for: /uEnv.txt ...
    Checking for: /boot.scr ...
    Checking for: /boot/boot.scr ...
    Checking for: /boot/uEnv.txt ...
    gpio: pin 55 (gpio 55) value is 1
    1764 bytes read in 15 ms (114.3 KiB/s)
    Loaded environment from /boot/uEnv.txt
    debug: [dtb=/boot/dtbs/5.10.168-ti-r71/am335x-boneblack-pruswuart.dtb] ...
    Using: dtb=/boot/dtbs/5.10.168-ti-r71/am335x-boneblack-pruswuart.dtb ...
    Checking if uname_r is set in /boot/uEnv.txt...
    gpio: pin 56 (gpio 56) value is 1
    Running uname_boot ...
    loading /boot/vmlinuz-5.10.168-ti-r71 ...
    11334144 bytes read in 728 ms (14.8 MiB/s)
    debug: [enable_uboot_overlays=0] ...
    debug: [enable_uboot_cape_universal=0] ...
    debug: [uboot_base_dtb_univ=am335x-boneblack-uboot-univ.dtb] ...
    uboot_overlays: [uboot_base_dtb=am335x-boneblack-uboot-univ.dtb] ...
    uboot_overlays: Switching too: dtb=am335x-boneblack-uboot-univ.dtb ...
    loading /boot/dtbs/5.10.168-ti-r71/am335x-boneblack-uboot-univ.dtb ...
    95399 bytes read in 51 ms (1.8 MiB/s)
    uboot_overlays: [fdt_buffer=0x60000] ...
    uboot_overlays: uboot loading of [/lib/firmware/BB-ADC-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_adc=1]...
    uboot_overlays: uboot loading of [/lib/firmware/BB-BONE-eMMC1-01-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_emmc=1]...
    uboot_overlays: uboot loading of [/lib/firmware/BB-HDMI-TDA998x-00A0.dtbo] disabled by /boot/uEnv.txt [disable_uboot_overlay_video=1]...
    loading /boot/initrd.img-5.10.168-ti-r71 ...

    but I dont see anything in dmesg to help

    debian@BeagleBone:~$ dmesg | grep -i 'serial\|pru'
    [    3.816027] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
    [    3.820658] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 20, base_baud = 3000000) is a 8250
    [    4.008045] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    4.008072] usb usb1: SerialNumber: musb-hdrc.1
    [   12.627892] systemd[1]: Unnecessary job for /sys/devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e09050.target-module/44e09000.serial/tty/ttyS0 was removed.
    [   12.645989] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [   32.271846] remoteproc remoteproc1: 4a334000.pru is available
    [   32.290946] remoteproc remoteproc2: 4a338000.pru is available
    
    debian@BeagleBone:~$ cat /dev/remoteproc/pruss-core0/state
    offline
    
    debian@BeagleBone:~$ ls -l /lib/firmware/ti-pruss/pru_swuart-fw.elf
    -rw-r--r-- 1 root root 32456 Apr 30 08:46 /lib/firmware/ti-pruss/pru_swuart-fw.elf
    
    debian@BeagleBone:~$ gpioinfo | grep pru
            line   6: "P8_45 [pru1_swuart0_txd]" unused input active-high
            line   7: "P8_46 [pru1_swuart0_rxd]" unused input active-high
            line   8: "P8_43 [pru1_swuart0_cts]" unused input active-high
            line   9: "P8_44 [pru1_swuart0_rts]" unused input active-high
            line  10: "P8_41 [pru1_swuart1_txd]" unused input active-high
            line  11: "P8_42 [pru1_swuart1_rxd]" unused input active-high
            line  12: "P8_39 [pru1_swuart1_cts]" unused input active-high
            line  13: "P8_40 [pru1_swuart1_rts]" unused input active-high
            line  22: "P8_27 [pru1_swuart2_txd]" unused input active-high
            line  23: "P8_29 [pru1_swuart2_rxd]" unused input active-high
            line  24: "P8_28 [pru1_swuart2_cts]" unused input active-high
            line  25: "P8_30 [pru1_swuart2_rts]" unused input active-high
            line  14: "P9_31 [pru0_swuart0_txd]" unused input active-high
            line  15: "P9_29 [pru0_swuart0_rxd]" unused input active-high
            line  16: "P9_30 [pru0_swuart1_txd]" unused input active-high
            line  17: "P9_28 [pru0_swuart1_rxd]" unused input active-high
            line  19: "P9_27 [pru0_swuart2_txd]" unused input active-high
            line  21: "P9_25 [pru0_swuart2_rxd]" unused input active-high

    What am I missing?

  • Well...thats embarassing!  I completely misread and confused 

    <M> TI PRU-ICSS UART support

    from PRU-ICSS Serial UART, for 

    <M> TI PRU Software UART suppor

    from PRU-ICSS Soft UART

    Once I enabled the correct module define, it looks like I have liftoff

    debian@BeagleBone:~$ dmesg | grep -i 'serial\|uart\|pru'
    [    3.817398] Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
    [    3.821974] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 20, base_baud = 3000000) is a 8250
    [    4.008047] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    4.008074] usb usb1: SerialNumber: musb-hdrc.1
    [   12.623872] systemd[1]: Unnecessary job for /dev/bone/uart/0 was removed.
    [   12.623964] systemd[1]: Unnecessary job for /sys/devices/platform/ocp/44c00000.interconnect/44c00000.interconnect:segment@200000/44e09050.target-module/44e09000.serial/tty/ttyS0 was removed.
    [   12.641947] systemd[1]: Created slice system-serial\x2dgetty.slice.
    [   31.911346] remoteproc remoteproc1: 4a334000.pru is available
    [   31.977847] remoteproc remoteproc2: 4a338000.pru is available
    [   32.181379] remoteproc remoteproc1: powering up 4a334000.pru
    [   32.255840] remoteproc remoteproc1: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   32.255979] remoteproc remoteproc1: remote processor 4a334000.pru is now up
    [   32.256077] remoteproc remoteproc1: stopped remote processor 4a334000.pru
    [   32.256854] remoteproc remoteproc2: powering up 4a338000.pru
    [   32.297652] remoteproc remoteproc2: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   32.297782] remoteproc remoteproc2: remote processor 4a338000.pru is now up
    [   32.297876] remoteproc remoteproc2: stopped remote processor 4a338000.pru
    [   33.602935] remoteproc remoteproc1: powering up 4a334000.pru
    [   33.603366] remoteproc remoteproc1: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   33.603493] remoteproc remoteproc1: remote processor 4a334000.pru is now up
    [   33.603573] remoteproc remoteproc1: stopped remote processor 4a334000.pru
    [   33.604729] remoteproc remoteproc2: powering up 4a338000.pru
    [   33.621178] remoteproc remoteproc2: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   33.621317] remoteproc remoteproc2: remote processor 4a338000.pru is now up
    [   33.621415] remoteproc remoteproc2: stopped remote processor 4a338000.pru
    [   34.770912] remoteproc remoteproc1: powering up 4a334000.pru
    [   34.771339] remoteproc remoteproc1: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   34.771466] remoteproc remoteproc1: remote processor 4a334000.pru is now up
    [   34.787626] remoteproc remoteproc2: powering up 4a338000.pru
    [   34.788039] remoteproc remoteproc2: Booting fw image ti-pruss/pru_swuart-fw.elf, size 32456
    [   34.788167] remoteproc remoteproc2: remote processor 4a338000.pru is now up

    Not yet tested but I can at least SEE the serial devices

    debian@BeagleBone:~$ ls -l /dev/ttySPRU*
    crw-rw---- 1 root dialout 237, 0 Apr 30 16:04 /dev/ttySPRU0
    crw-rw---- 1 root dialout 237, 1 Apr 30 16:04 /dev/ttySPRU1
    crw-rw---- 1 root dialout 237, 2 Apr 30 16:04 /dev/ttySPRU2
    crw-rw---- 1 root dialout 237, 3 Apr 30 16:04 /dev/ttySPRU3
    crw-rw---- 1 root dialout 237, 4 Apr 30 16:04 /dev/ttySPRU4
    crw-rw---- 1 root dialout 237, 5 Apr 30 16:04 /dev/ttySPRU5

    So I think we can close this out for now.  Ill openit up again if I have any (ahem!) *actual* issues.

    Thanks Bin for your quick help.

  • I am glad to see you got it up and running. Thanks for the update.