Beagleboard Green and UART

Hi,

I am a new user of the BeagleBone Green and I have some troubles with the UART.

I have flashed the board with the bone-eMMC-flasher-debian-10.5-console-armhf-2020-08-25-1gb.img image.

I have updated the system with apt update && apt dist-upgrade and updated the kernel with cd /opt/scripts && git pull && /opt/scripts/tools/update_kernel.sh --lts-4_19 --ti-channel

$ uname -a
Linux beaglebone 4.19.94-ti-r59 #1buster SMP PREEMPT Mon Feb 8 19:17:16 UTC 2021 armv7l GNU/Linux
$ cat /etc/debian_version
10.8

I use the following /boot/uEnv.txt:

#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

uname_r=4.19.94-ti-r59
#uuid=
#dtb=

###U-Boot Overlays###
###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays
###Master Enable
enable_uboot_overlays=1
###

###Overide capes with eeprom
#uboot_overlay_addr0=/lib/firmware/BB-UART1-00A0.dtbo
#uboot_overlay_addr1=/lib/firmware/BB-UART5-00A0.dtbo
#uboot_overlay_addr1=<file1>.dtbo
#uboot_overlay_addr2=<file2>.dtbo
#uboot_overlay_addr3=<file3>.dtbo
###

###Additional custom capes
#uboot_overlay_addr4=<file4>.dtbo
#uboot_overlay_addr5=<file5>.dtbo
#uboot_overlay_addr6=<file6>.dtbo
#uboot_overlay_addr7=<file7>.dtbo
###

###Custom Cape
#dtb_overlay=<file8>.dtbo
###

###Disable auto loading of virtual capes (emmc/video/wireless/adc)
#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
###

###PRUSS OPTIONS
###pru_rproc (4.14.x-ti kernel)
#uboot_overlay_pru=AM335X-PRU-RPROC-4-14-TI-00A0.dtbo
###pru_rproc (4.19.x-ti kernel)
uboot_overlay_pru=AM335X-PRU-RPROC-4-19-TI-00A0.dtbo
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
#uboot_overlay_pru=AM335X-PRU-UIO-00A0.dtbo
###

###Cape Universal Enable
enable_uboot_cape_universal=1
###

###Debug: disable uboot autoload of Cape
#disable_uboot_overlay_addr0=1
#disable_uboot_overlay_addr1=1
#disable_uboot_overlay_addr2=1
#disable_uboot_overlay_addr3=1
###

###U-Boot fdt tweaks... (60000 = 384KB)
#uboot_fdt_buffer=0x60000
###U-Boot Overlays###

cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet

#In the event of edid real failures, uncomment this next line:
#cmdline=coherent_pool=1M net.ifnames=0 lpj=1990656 rng_core.default_quality=100 quiet video=HDMI-A-1:1024x768@60e

##enable Generic eMMC Flasher:
#cmdline=init=/opt/scripts/tools/eMMC/init-eMMC-flasher-v3.sh

I have two peripherals connected to the board, a wind sensor on UART1 and a modem on UART5.

I have configured the pins with these commands:

# Wind sensor
$ config-pin P9.24 uart     # UART1 TX (not connected)
Current mode for P9_24 is:     uart
$ config-pin P9.26 uart     # UART1 RX
Current mode for P9_26 is:     uart
$ config-pin P8.17 gpio_pu  # Enable the sensor
Current mode for P8_17 is:     gpio_pu
$ stty -F /dev/ttyS1 sane   # Configure the serial link
$ stty -F /dev/ttyS         # Check the state
speed 9600 baud; line = 0;

# Modem
$ config-pin P8.37 uart # UART5 TX
Current mode for P8_37 is:     uart
$ config-pin P8.38 uart # UART5 RX
Current mode for P8_38 is:     uart
$ config-pin P8.15 gpio_pu # Enable the modem
Current mode for P8_15 is:     gpio_pu
$ stty -F /dev/ttyS5 sane   # Configure the serial link
$ stty -F /dev/ttyS5
speed 9600 baud; line = 0;

The output of show-pins.pl looks fine for me:

$ sudo /opt/scripts/device/bone/show-pins.pl
P8.25 / eMMC d0                    0  U7 fast rx  up  1 mmc 1 d0         mmc@481d8000 (pinmux_emmc_pins)
P8.24 / eMMC d1                    1  V7 fast rx  up  1 mmc 1 d1         mmc@481d8000 (pinmux_emmc_pins)
P8.05 / eMMC d2                    2  R8 fast rx  up  1 mmc 1 d2         mmc@481d8000 (pinmux_emmc_pins)
P8.06 / eMMC d3                    3  T8 fast rx  up  1 mmc 1 d3         mmc@481d8000 (pinmux_emmc_pins)
P8.23 / eMMC d4                    4  U8 fast rx  up  1 mmc 1 d4         mmc@481d8000 (pinmux_emmc_pins)
P8.22 / eMMC d5                    5  V8 fast rx  up  1 mmc 1 d5         mmc@481d8000 (pinmux_emmc_pins)
P8.03 / eMMC d6                    6  R9 fast rx  up  1 mmc 1 d6         mmc@481d8000 (pinmux_emmc_pins)
P8.04 / eMMC d7                    7  T9 fast rx  up  1 mmc 1 d7         mmc@481d8000 (pinmux_emmc_pins)
P8.19                              8 U10 fast rx down 7 gpio 0.22        ocp/P8_19_pinmux (pinmux_P8_19_default_pin)
P8.13                              9 T10 fast rx down 7 gpio 0.23        ocp/P8_13_pinmux (pinmux_P8_13_default_pin)
P8.14                             10 T11 fast rx down 7 gpio 0.26        ocp/P8_14_pinmux (pinmux_P8_14_default_pin)
P8.17                             11 U12 fast rx  up  7 gpio 0.27        ocp/P8_17_pinmux (pinmux_P8_17_gpio_pu_pin)
P8.12                             12 T12 fast rx down 7 gpio 1.12        ocp/P8_12_pinmux (pinmux_P8_12_default_pin)
P8.11                             13 R12 fast rx down 7 gpio 1.13        ocp/P8_11_pinmux (pinmux_P8_11_default_pin)
P8.16                             14 V13 fast rx down 7 gpio 1.14        ocp/P8_16_pinmux (pinmux_P8_16_default_pin)
P8.15                             15 U13 fast rx  up  7 gpio 1.15        ocp/P8_15_pinmux (pinmux_P8_15_gpio_pu_pin)
P9.15                             16 R13 fast rx down 7 gpio 1.16        ocp/P9_15_pinmux (pinmux_P9_15_default_pin)
P9.23                             17 V14 fast rx down 7 gpio 1.17        ocp/P9_23_pinmux (pinmux_P9_23_default_pin)
P9.14                             18 U14 fast rx down 7 gpio 1.18        ocp/P9_14_pinmux (pinmux_P9_14_default_pin)
P9.16                             19 T14 fast rx down 7 gpio 1.19        ocp/P9_16_pinmux (pinmux_P9_16_default_pin)
P9.11                             28 T17 fast rx  up  7 gpio 0.30        ocp/P9_11_pinmux (pinmux_P9_11_default_pin)
P9.13                             29 U17 fast rx  up  7 gpio 0.31        ocp/P9_13_pinmux (pinmux_P9_13_default_pin)
P9.12                             30 U18 fast rx  up  7 gpio 1.28        ocp/P9_12_pinmux (pinmux_P9_12_default_pin)
P8.26                             31  V6 fast rx  up  7 gpio 1.29        ocp/P8_26_pinmux (pinmux_P8_26_default_pin)
P8.21 / eMMC clk                  32  U9 fast rx  up  2 mmc 1 clk        mmc@481d8000 (pinmux_emmc_pins)
P8.20 / eMMC cmd                  33  V9 fast rx  up  2 mmc 1 cmd        mmc@481d8000 (pinmux_emmc_pins)
P9.15                             34 T13 fast rx  up  7 gpio 2.00
P8.18                             35 V12 fast rx down 7 gpio 2.01        ocp/P8_18_pinmux (pinmux_P8_18_default_pin)
P8.07                             36  R7 fast rx  up  7 gpio 2.02        ocp/P8_07_pinmux (pinmux_P8_07_default_pin)
P8.08                             37  T7 fast rx  up  7 gpio 2.03        ocp/P8_08_pinmux (pinmux_P8_08_default_pin)
P8.10                             38  U6 fast rx  up  7 gpio 2.04        ocp/P8_10_pinmux (pinmux_P8_10_default_pin)
P8.09                             39  T6 fast rx  up  7 gpio 2.05        ocp/P8_09_pinmux (pinmux_P8_09_default_pin)
P8.45 / hdmi / sysboot 0          40  R1 fast rx down 7 gpio 2.06        ocp/P8_45_pinmux (pinmux_P8_45_default_pin)
P8.46 / hdmi / sysboot 1          41  R2 fast rx down 7 gpio 2.07        ocp/P8_46_pinmux (pinmux_P8_46_default_pin)
P8.43 / hdmi / sysboot 2          42  R3 fast rx down 7 gpio 2.08        ocp/P8_43_pinmux (pinmux_P8_43_default_pin)
P8.44 / hdmi / sysboot 3          43  R4 fast rx down 7 gpio 2.09        ocp/P8_44_pinmux (pinmux_P8_44_default_pin)
P8.41 / hdmi / sysboot 4          44  T1 fast rx down 7 gpio 2.10        ocp/P8_41_pinmux (pinmux_P8_41_default_pin)
P8.42 / hdmi / sysboot 5          45  T2 fast rx down 7 gpio 2.11        ocp/P8_42_pinmux (pinmux_P8_42_default_pin)
P8.39 / hdmi / sysboot 6          46  T3 fast rx down 7 gpio 2.12        ocp/P8_39_pinmux (pinmux_P8_39_default_pin)
P8.40 / hdmi / sysboot 7          47  T4 fast rx down 7 gpio 2.13        ocp/P8_40_pinmux (pinmux_P8_40_default_pin)
P8.37 / hdmi / sysboot 8          48  U1 fast rx  up  4 uart 5 txd       ocp/P8_37_pinmux (pinmux_P8_37_uart_pin)
P8.38 / hdmi / sysboot 9          49  U2 fast rx  up  4 uart 5 rxd       ocp/P8_38_pinmux (pinmux_P8_38_uart_pin)
P8.36 / hdmi / sysboot 10         50  U3 fast rx down 7 gpio 2.16        ocp/P8_36_pinmux (pinmux_P8_36_default_pin)
P8.34 / hdmi / sysboot 11         51  U4 fast rx down 7 gpio 2.17        ocp/P8_34_pinmux (pinmux_P8_34_default_pin)
P8.35 / hdmi / sysboot 12         52  V2 fast rx down 7 gpio 0.08        ocp/P8_35_pinmux (pinmux_P8_35_default_pin)
P8.33 / hdmi / sysboot 13         53  V3 fast rx down 7 gpio 0.09        ocp/P8_33_pinmux (pinmux_P8_33_default_pin)
P8.31 / hdmi / sysboot 14         54  V4 fast rx down 7 gpio 0.10        ocp/P8_31_pinmux (pinmux_P8_31_default_pin)
P8.32 / hdmi / sysboot 15         55  T5 fast rx down 7 gpio 0.11        ocp/P8_32_pinmux (pinmux_P8_32_default_pin)
P8.27 / hdmi                      56  U5 fast rx down 7 gpio 2.22        ocp/P8_27_pinmux (pinmux_P8_27_default_pin)
P8.29 / hdmi                      57  R5 fast rx down 7 gpio 2.23        ocp/P8_29_pinmux (pinmux_P8_29_default_pin)
P8.28 / hdmi                      58  V5 fast rx down 7 gpio 2.24        ocp/P8_28_pinmux (pinmux_P8_28_default_pin)
P8.30 / hdmi                      59  R6 fast rx down 7 gpio 2.25        ocp/P8_30_pinmux (pinmux_P8_30_default_pin)
P9.22 / spi boot clk              84 A17 fast rx  up  7 gpio 0.02        ocp/P9_22_pinmux (pinmux_P9_22_default_pin)
P9.21 / spi boot in               85 B17 fast rx  up  7 gpio 0.03        ocp/P9_21_pinmux (pinmux_P9_21_default_pin)
P9.18 / spi boot out              86 B16 fast rx  up  7 gpio 0.04        ocp/P9_18_pinmux (pinmux_P9_18_default_pin)
P9.17 / spi boot cs               87 A16 fast rx  up  7 gpio 0.05        ocp/P9_17_pinmux (pinmux_P9_17_default_pin)
P9.42a                            89 C18 fast rx down 7 gpio 0.07        ocp/P9_42_pinmux (pinmux_P9_42_default_pin)
P9.20 / cape i²c sda             94 D18 fast rx  up  3 i²c 2 sda       ocp/P9_20_pinmux (pinmux_P9_20_default_pin)
P9.19 / cape i²c scl             95 D17 fast rx  up  3 i²c 2 scl       ocp/P9_19_pinmux (pinmux_P9_19_default_pin)
P9.26                             96 D16 fast rx  up  0 uart 1 rxd       ocp/P9_26_pinmux (pinmux_P9_26_uart_pin)
P9.24                             97 D15 fast rx  up  0 uart 1 txd       ocp/P9_24_pinmux (pinmux_P9_24_uart_pin)
P9.31 / hdmi audio clk           100 A13 fast rx down 7 gpio 3.14        ocp/P9_31_pinmux (pinmux_P9_31_default_pin)
P9.29 / hdmi audio fs            101 B13 fast rx down 7 gpio 3.15        ocp/P9_29_pinmux (pinmux_P9_29_default_pin)
P9.30                            102 D12 fast rx down 7 gpio 3.16        ocp/P9_30_pinmux (pinmux_P9_30_default_pin)
P9.28 / hdmi audio data          103 C12 fast rx down 7 gpio 3.17        ocp/P9_28_pinmux (pinmux_P9_28_default_pin)
P9.42b                           104 B12 fast rx down 7 gpio 3.18        ocp/P9_92_pinmux (pinmux_P9_92_default_pin)
P9.27                            105 C13 fast rx down 7 gpio 3.19        ocp/P9_27_pinmux (pinmux_P9_27_default_pin)
P9.41                            106 D13 fast rx down 7 gpio 3.20        ocp/P9_91_pinmux (pinmux_P9_91_default_pin)
P9.25 / audio osc                107 A14 fast rx down 7 gpio 3.21        ocp/P9_25_pinmux (pinmux_P9_25_default_pin)
P9.41 / jtag emu3                109 D14 fast rx down 7 gpio 0.20        ocp/P9_41_pinmux (pinmux_P9_41_default_pin)

But when I use screen/picocom/minicom/cat/whatever on /dev/ttyS1 or /dev/ttyS5, nothing happens.

E.g.:

# Expected output
$ cat /dev/ttyS1
PLCJ,5EFF,5DFF,2F,3434,4241
PLCJE84C8,6DAE,32,C,021.0,C,,*51
PLCJ,5EFF,5CFE,2F,3434,4241
<snip>

# Current output
$ cat /dev/ttyS1
<nothing>

What did I miss?

Ok, I have found the problem. I didn’t understand well how the GPIO works.

The following configure script resolved my issue:

# Anemometer
config-pin P9.24 uart     # UART1 TX (not connected)
config-pin P9.26 uart     # UART1 RX
config-pin P8.17 gpio     # Enable the sensor
echo "out" > /sys/class/gpio/gpio27/direction
echo "1" > /sys/class/gpio/gpio27/value
stty -F /dev/ttyS1 sane   # Configure the serial link

# Modem
config-pin P8.37 uart # UART5 TX
config-pin P8.38 uart # UART5 RX
config-pin P8.15 gpio  # Enable the modem
echo "out" > /sys/class/gpio/gpio47/direction
echo "1" > /sys/class/gpio/gpio47/value

Hi @jtremesay-sereema,

So the background…

config-pin P8.15 gpio_pu

Just enables the Pull Up… Which by itself is pretty weak, but enough to usually turn on an LED… But to drive anything, not enough current…

Whereas:

config-pin P8.15 gpio  # Enable the modem
echo "out" > /sys/class/gpio/gpio47/direction
echo "1" > /sys/class/gpio/gpio47/value

Also enables the output, which can drive actual logic. :wink:

Regards,

I am new in electronic, I don’t understand well the concept pull up/down resistor and cie. My first attempt was based on a blog post that said “use gpio_pd for 0 and gpio_pu for 1” :smiley:

No, worries. So that blog post is still correct, if you connect an LED or anything that draws a very minimal amount of current it will work just fine…

But once you stick a real load on it, it will fail…

Regards,