Device: Raspberry Pi 4B v1.2
Image: 2020-11-07-ubiquity-xenial-lxde
Hello all, I’m using the Ubiquity image for a project that does not involve the Magni, and I’d like to enable the additional UART ports available on the RPi 4.
I’ve followed the instructions at https://learn.ubiquityrobotics.com/GPIO_lines to free up the GPIO lines, and I’ve added the following lines to config.txt to enable the four extra uart ports:
#Enable the additional uarts for serial communication
enable_uart=1
dtoverlay=miniuart-bt
dtoverlay=uart2
dtoverlay=uart3
dtoverlay=uart4
dtoverlay=uart5
However, after a reboot, running the command sudo raspi-gpio get returns the following:
BANK0 (GPIO 0 to 27):
GPIO 00: level=1 fsel=3 alt=4 func=AVEIN_VCLK
GPIO 01: level=1 fsel=3 alt=4 func=AVEIN_DSYNC
GPIO 02: level=1 fsel=0 alt= func=INPUT
GPIO 03: level=1 fsel=0 alt= func=INPUT
GPIO 04: level=1 fsel=3 alt=4 func=AVEIN_VID0
GPIO 05: level=1 fsel=3 alt=4 func=AVEIN_VID1
GPIO 06: level=1 fsel=0 alt= func=INPUT
GPIO 07: level=1 fsel=0 alt= func=INPUT
GPIO 08: level=1 fsel=3 alt=4 func=AVEIN_VID4
GPIO 09: level=1 fsel=3 alt=4 func=AVEIN_VID5
GPIO 10: level=0 fsel=0 alt= func=INPUT
GPIO 11: level=0 fsel=0 alt= func=INPUT
GPIO 12: level=1 fsel=3 alt=4 func=AVEIN_VID8
GPIO 13: level=1 fsel=3 alt=4 func=AVEIN_VID9
GPIO 14: level=1 fsel=4 alt=0 func=TXD0
GPIO 15: level=1 fsel=4 alt=0 func=RXD0
GPIO 16: level=0 fsel=0 alt= func=INPUT
GPIO 17: level=0 fsel=0 alt= func=INPUT
GPIO 18: level=0 fsel=0 alt= func=INPUT
...
The four pairs of GPIO lines returning functions beginning with ‘AVEIN_’ should be returning RX and TX like GPIO 14 and 15.
I used sudo raspi-gpio funcs to inspect the pin layout returned by raspi-gpio, which returns the following:
GPIO, DEFAULT PULL, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5
0, UP, SDA0, SA5, PCLK, AVEOUT_VCLK, AVEIN_VCLK, -
1, UP, SCL0, SA4, DE, AVEOUT_DSYNC, AVEIN_DSYNC, -
2, UP, SDA1, SA3, LCD_VSYNC, AVEOUT_VSYNC, AVEIN_VSYNC, -
3, UP, SCL1, SA2, LCD_HSYNC, AVEOUT_HSYNC, AVEIN_HSYNC, -
4, UP, GPCLK0, SA1, DPI_D0, AVEOUT_VID0, AVEIN_VID0, ARM_TDI
5, UP, GPCLK1, SA0, DPI_D1, AVEOUT_VID1, AVEIN_VID1, ARM_TDO
6, UP, GPCLK2, SOE_N_SE, DPI_D2, AVEOUT_VID2, AVEIN_VID2, ARM_RTCK
7, UP, SPI0_CE1_N, SWE_N_SRW_N, DPI_D3, AVEOUT_VID3, AVEIN_VID3, -
8, UP, SPI0_CE0_N, SD0, DPI_D4, AVEOUT_VID4, AVEIN_VID4, -
9, DOWN, SPI0_MISO, SD1, DPI_D5, AVEOUT_VID5, AVEIN_VID5, -
10, DOWN, SPI0_MOSI, SD2, DPI_D6, AVEOUT_VID6, AVEIN_VID6, -
11, DOWN, SPI0_SCLK, SD3, DPI_D7, AVEOUT_VID7, AVEIN_VID7, -
12, DOWN, PWM0, SD4, DPI_D8, AVEOUT_VID8, AVEIN_VID8, ARM_TMS
13, DOWN, PWM1, SD5, DPI_D9, AVEOUT_VID9, AVEIN_VID9, ARM_TCK
14, DOWN, TXD0, SD6, DPI_D10, AVEOUT_VID10, AVEIN_VID10, TXD1
15, DOWN, RXD0, SD7, DPI_D11, AVEOUT_VID11, AVEIN_VID11, RXD1
16, DOWN, FL0, SD8, DPI_D12, CTS0, SPI1_CE2_N, CTS1
17, DOWN, FL1, SD9, DPI_D13, RTS0, SPI1_CE1_N, RTS1
18, DOWN, PCM_CLK, SD10, DPI_D14, I2CSL_SDA_MOSI, SPI1_CE0_N, PWM0
...
So it appears that funcs is returning the wrong GPIO pin setup for the Pi 4B. Has anyone successfully gotten uart2-uart5 working on a Ubiquity Pi image? Is there something I can do to force raspi-gpio to recognize that it is a Pi4B with a bcm2711 and use the appropriate pin setup?
Any help would be appreciated.