Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


Sidebar

products:sbc:common:applications:gpio:uart

This is an old revision of the document!


UART

Introduction

This document mainly introduces the usage of UART on 40-Pin Header.

UART Information

UART PIN & GPIO(#Number) DT Overlays Node Device Node
VIM1/2 UART_AO_B RX(15) - GPIOAO_5(#506)
TX(16) - GPIOAO_4(#505)
uart4 /dev/ttyS4
VIM3/3L UART_C RX(15) - GPIOH_6(#433)
TX(16) - GPIOH_7(#434)
uart3 /dev/ttyS3
VIM4 UART_E RX(15) - GPIOY_7(#491)
TX(16) - GPIOY_6(#490)
uart_e /dev/ttyS4

Enable UART

In order to use the UART, you need to enable the UART function via Device Tree Overlay.

VIM1/2/3/3L/Edge1

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 reboot, you will see the UART device node.

$ ls /dev/ttyS3
/dev/ttyS3

VIM4

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 reboot, you will see the UART device node.

$ ls /dev/ttyS4
/dev/ttyS4

Disable UART to Use GPIO

If you want to use normal GPIO instead of UART, you can remove the UART node in device tree overlays configration file.

Last modified: 2022/07/12 23:10 by nick