This is an old revision of the document!
This page mainly introduces the usage of UART on 40-Pin Header.
| UART | PIN | GPIO Name | GPIO Number | DT Overlays Node | Device Node | |
|---|---|---|---|---|---|---|
| VIM1/2 | UART_AO_B | 15(RX) | GPIOAO_5 | 506 | uart4 | /dev/ttyS4 |
| 16(TX) | GPIOAO_4 | 505 | ||||
| VIM3/3L | UART_C | 15(RX) | GPIOH_6 | 433 | uart3 | /dev/ttyS3 |
| 16(TX) | GPIOH_7 | 434 | ||||
| VIM4 | UART_E | 15(RX) | GPIOY_7 | 491 | uart_e | /dev/ttyS4 |
| 16(TX) | GPIOY_6 | 490 |
In order to use the UART, you need to enable the UART function via Device Tree Overlay.
Edit /boot/env.txt to add the uart node to overlays node if it doesn't exist.
Take VIM3 as an example to enable UART_C, you need to add uart3 node to overlays node if it doesn't exist.
overlays=pwm_ao_a pwm_f uart3
After the reboot, you will see the UART device node.
$ ls /dev/ttyS3
/dev/ttyS3
Edit /boot/dtb/amlogic/kvim4.dtb.overlay.env to add uart node to fdt_overlays node if it doesn't exist.
e.g. Enable UART_E, you need to add uart_e to node fdt_overlays if it doesn't exist.
fdt_overlays=uart_e
After the reboot, you will see the UART device node.
$ ls /dev/ttyS4
/dev/ttyS4
If you want to use normal GPIO instead of UART, you can remove the UART node in Device Tree Overlay.