# Uart1 and Uart2 not showing up in Rasp5

**URL:** <https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733>\
**Category:** Product support\
**Created:** [June 17, 2024, 3:25am UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733 "2024-06-17T03:25:25Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tempusername](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tempusername](https://forums.balena.io/u/tempusername)\
**Post date:** [June 17, 2024, 3:25am UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/1 "2024-06-17T03:25:25Z")

</div>

Hi,

I’ve run into an issue where the dtoverlay for uart1 and uart2 does not show up in the docker, but uart0, spi0 and spi1 does. Also, the interface is created on the host for all the overlays.

The code was developed and tested running Raspbian directly on a rasp5. When it runs in docker, the code doesn’t fail because the Uart 1 & Uart 2 interfaces exist but no data comes through because the hardware pins are not set to be uarts as can be seen in the “pinctrl” output below.

DtOverlay config value:

```auto
"uart0,txd0_pin=14,rxd0_pin=15","uart1,txd1_pin=0,rxd1_pin=1","uart2,txd2_pin=4,rxd2_pin=5","spi0-1cs","spi1-1cs"

```

Config file:

```auto
root@:~# cat /mnt/boot/config.txt
arm_64bit=1
arm_boost=1
avoid_warnings=1
camera_auto_detect=1
disable_overscan=1
disable_splash=1
display_auto_detect=1
dtoverlay=uart0,txd0_pin=14,rxd0_pin=15
dtoverlay=uart1,txd1_pin=0,rxd1_pin=1
dtoverlay=uart2,txd2_pin=4,rxd2_pin=5
dtoverlay=spi0-1cs
dtoverlay=spi1-1cs
dtparam=
max_framebuffers=2
otg_mode=1

```

In Raspbian docker:

```auto
root@:~# pinctrl
 0: ip pu | hi // ID_SD/GPIO0 = input
 1: ip pu | hi // ID_SC/GPIO1 = input
 2: no pu | -- // PIN3/GPIO2 = none
 3: no pu | -- // PIN5/GPIO3 = none
 4: no pu | -- // PIN7/GPIO4 = none
 5: no pu | -- // PIN29/GPIO5 = none
 6: no pu | -- // PIN31/GPIO6 = none
 7: no pu | -- // PIN26/GPIO7 = none
 8: op dh pu | hi // PIN24/GPIO8 = output
 9: a0 pn | lo // PIN21/GPIO9 = SPI0_MISO
10: a0 pn | lo // PIN19/GPIO10 = SPI0_MOSI
11: a0 pn | lo // PIN23/GPIO11 = SPI0_SCLK
12: no pd | -- // PIN32/GPIO12 = none
13: no pd | -- // PIN33/GPIO13 = none
14: a4 pn | hi // PIN8/GPIO14 = TXD0
15: a4 pu | hi // PIN10/GPIO15 = RXD0
16: no pd | -- // PIN36/GPIO16 = none
17: no pd | -- // PIN11/GPIO17 = none
18: op dh pd | hi // PIN12/GPIO18 = output
19: a0 pd | lo // PIN35/GPIO19 = SPI1_MISO
20: a0 pd | lo // PIN38/GPIO20 = SPI1_MOSI
21: a0 pd | lo // PIN40/GPIO21 = SPI1_SCLK
22: no pd | -- // PIN15/GPIO22 = none
23: no pd | -- // PIN16/GPIO23 = none
24: no pd | -- // PIN18/GPIO24 = none
25: no pd | -- // PIN22/GPIO25 = none
26: no pd | -- // PIN37/GPIO26 = none

```

Raspbian docker interfaces:

```auto
root@d15a318:/dev# dir
autofs gpiomem1 media0 ptp0 random tty13 tty3 tty46 tty62 vc-mem vcsu2 video28
btrfs-control gpiomem2 media1 pts rfkill tty14 tty30 tty47 tty63 vcio vcsu3 video29
bus gpiomem3 media2 ram0 rtc0 tty15 tty31 tty48 tty7 vcs vcsu4 video30
cachefiles gpiomem4 mem ram1 shm tty16 tty32 tty49 tty8 vcs1 vcsu5 video31
cdc-wdm0 hwrng mmcblk0 ram10 snapshot tty17 tty33 tty5 tty9 vcs2 vcsu6 video32
console input mmcblk0p1 ram11 snd tty18 tty34 tty50 ttyAMA0 vcs3 vga_arbiter video33
cpu_dma_latency kmsg mmcblk0p2 ram12 spidev0.0 tty19 tty35 tty51 ttyAMA1 vcs4 vhci video34
cuse kvm mmcblk0p3 ram13 spidev1.0 tty2 tty36 tty52 ttyAMA10 vcs5 vhost-net video35
dma_heap loop-control mmcblk0p4 ram14 spidev10.0 tty20 tty37 tty53 ttyAMA2 vcs6 vhost-vsock video36
fd loop0 mmcblk0p5 ram15 stderr tty21 tty38 tty54 ttyUSB0 vcsa video19 video37
full loop1 mmcblk0p6 ram2 stdin tty22 tty39 tty55 ttyUSB1 vcsa1 video20 watchdog
fuse loop2 mqueue ram3 stdout tty23 tty4 tty56 ttyUSB2 vcsa2 video21 watchdog0
gpiochip0 loop3 net ram4 tty tty24 tty40 tty57 ttyUSB3 vcsa3 video22 zero
gpiochip1 loop4 null ram5 tty0 tty25 tty41 tty58 ttyprintk vcsa4 video23 zram0
gpiochip2 loop5 port ram6 tty1 tty26 tty42 tty59 ubi_ctrl vcsa5 video24
gpiochip3 loop6 ppp ram7 tty10 tty27 tty43 tty6 uhid vcsa6 video25
gpiochip4 loop7 pps0 ram8 tty11 tty28 tty44 tty60 uinput vcsu video26
gpiomem0 mapper ptmx ram9 tty12 tty29 tty45 tty61 urandom vcsu1 video27

```

In Raspbian directly on rasp5:

```auto
$ pinctrl
 0: a2 pn | hi // ID_SDA/GPIO0 = TXD1
 1: a2 pu | hi // ID_SCL/GPIO1 = RXD1
 2: no pu | -- // GPIO2 = none
 3: no pu | -- // GPIO3 = none
 4: a2 pn | hi // GPIO4 = TXD2
 5: a2 pu | hi // GPIO5 = RXD2
 6: no pu | -- // GPIO6 = none
 7: no pu | -- // GPIO7 = none
 8: op dh pu | hi // GPIO8 = output
 9: a0 pn | lo // GPIO9 = SPI0_MISO
10: a0 pn | lo // GPIO10 = SPI0_MOSI
11: a0 pn | lo // GPIO11 = SPI0_SCLK
12: no pd | -- // GPIO12 = none
13: no pd | -- // GPIO13 = none
14: a4 pn | hi // GPIO14 = TXD0
15: a4 pu | hi // GPIO15 = RXD0
16: no pd | -- // GPIO16 = none
17: no pd | -- // GPIO17 = none
18: op dh pd | hi // GPIO18 = output
19: a0 pd | lo // GPIO19 = SPI1_MISO
20: a0 pd | lo // GPIO20 = SPI1_MOSI
21: a0 pd | lo // GPIO21 = SPI1_SCLK
22: no pd | -- // GPIO22 = none
23: no pd | -- // GPIO23 = none
24: no pd | -- // GPIO24 = none
25: no pd | -- // GPIO25 = none
26: no pd | -- // GPIO26 = none

```

I’ve also tried just creating a “uart1” or “uart2” dtoverlay with no defined pins (so that it uses the default) and a “uart1,txd1\_pin=0,rxd1\_pin=1” or “uart2,txd2\_pin=4,rxd2\_pin=5” overlay but neither works (with uart0, spi0, spi1 removed completely).

Any ideas?

Thanks,  
Sebastian

---

<div class="post-metadata">

**Author:** ![tempusername](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tempusername](https://forums.balena.io/u/tempusername)\
**Post date:** [June 19, 2024, 11:29pm UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/2 "2024-06-19T23:29:23Z")

</div>

Any help from the dev team?

Thanks  
Sebastian

---

<div class="post-metadata">

**Author:** ![mpous](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mpous/32/4742_2.png) [@mpous](https://forums.balena.io/u/mpous)\
**Post date:** [June 20, 2024, 7:45am UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/3 "2024-06-20T07:45:35Z")

</div>

Hello @tempusername let me ask the balena devices team if they can help!

---

<div class="post-metadata">

**Author:** ![tempusername](https://avatars.discourse-cdn.com/v4/letter/t/e274bd/32.png) [@tempusername](https://forums.balena.io/u/tempusername)\
**Post date:** [June 24, 2024, 2:20pm UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/4 "2024-06-24T14:20:06Z")

</div>

It’s been over a week, emails, forum and nothing to show from it. We’ve since switched to another product that allows us to run Raspbian with OTA docker updates and none of the above problems. Good luck with the fix.

---

<div class="post-metadata">

**Author:** ![shaunmulligan1](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan1/32/9857_2.png) [@shaunmulligan1](https://forums.balena.io/u/shaunmulligan1)\
**Post date:** [June 26, 2024, 12:08pm UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/5 "2024-06-26T12:08:14Z")

</div>

Hi there, I’m really sorry you hit this issue! I did some digging into it and there definitely looks to be an issue with enabling secondary UARTs in the rpi5 device types, this is still a fairly new device and we are working out the rough edges.

The team will continue to dig into this and hopefully have a fix in the coming versions.

---

<div class="post-metadata">

**Author:** ![floion](https://avatars.discourse-cdn.com/v4/letter/f/45deac/32.png) [@floion](https://forums.balena.io/u/floion)\
**Post date:** [June 27, 2024, 11:56am UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/6 "2024-06-27T11:56:37Z")

</div>

Fixed by [https://github.com/balena-os/balena-raspberrypi-temp/pull/161](https://github.com/balena-os/balena-raspberrypi-temp/pull/161)

---

<div class="post-metadata">

**Author:** ![shaunmulligan1](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/shaunmulligan1/32/9857_2.png) [@shaunmulligan1](https://forums.balena.io/u/shaunmulligan1)\
**Post date:** [June 27, 2024, 12:50pm UTC](https://forums.balena.io/t/uart1-and-uart2-not-showing-up-in-rasp5/370733/7 "2024-06-27T12:50:15Z")

</div>

Just to add a bit more colour to the fix. It seems it was an issue with the upstream kernel ( [https://forums.raspberrypi.com/viewtopic.php?t=359173](https://forums.raspberrypi.com/viewtopic.php?t=359173) ) which explains why it worked in Raspberry Pi OS but not in balenaOS, which has an older kernel version.

The suggested fix was to bump the kernel to 6.1, so the fix linked above by Florin bumps the pi5 kernel in balenaOS to 6.6.22 . This will take a bit of time to be deployed, but for anyone looking to use multiple UARTs on the pi5, please check that your kernel version is \> 6.1 😃
