Skip to content

Instantly share code, notes, and snippets.

@mimoccc
Forked from kashimAstro/UART3_enable.md
Created April 11, 2021 18:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mimoccc/5d2e06660832085e4e8bd6d982e700b4 to your computer and use it in GitHub Desktop.
Save mimoccc/5d2e06660832085e4e8bd6d982e700b4 to your computer and use it in GitHub Desktop.
sunxi H3 enable UART3

#simple step for enable UART3 H3 allwinner sunxi
download suite sunxi:
git clone https://github.com/linux-sunxi/sunxi-tools
compile:
make
convert /boot/script.bin in .fex ascii file for editing:
./bin2fex /boot/script.bin ~script.fex
edit "vim script.fex" and change config uart0(disable) and uart3(enable)


[uart0]
uart_used = 0
uart_port = 0
uart_type = 2
uart_tx = port:PA04<2><1>
uart_rx = port:PA05<2><1>

[uart1]
uart_used = 0
uart_port = 1
uart_type = 4
uart_tx = port:PG06<2><1>
uart_rx = port:PG07<2><1>
uart_rts = port:PG08<2><1>
uart_cts = port:PG09<2><1>

[uart2]
uart_used = 0
uart_port = 2
uart_type = 4
uart_tx = port:PA00<2><1>
uart_rx = port:PA01<2><1>
uart_rts = port:PA02<2><1>
uart_cts = port:PA03<2><1>

[uart3]
uart_used = 1
uart_port = 3
uart_type = 4
uart_tx = port:PA13<2><1>
uart_rx = port:PA14<2><1>
uart_rts = port:PA15<3><1>
uart_cts = port:PA16<3><1>

convert .fex in .bin
./fex2bin ~script.fex ~script.bin cd /boot/

if script.bin is an symbolic link of bin/orangepione.bin or other release, do:

rm script.bin

in case is an file do:

mv script.bin script.bin.orig cp ~script.bin /boot/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment