LicheeRVNano can't user ttyS1 ttyS2 ttyS3 ttyS4
LicheeRVNano can't user ttyS1 ttyS2 ttyS3 ttyS4
test on ttyS0 serial terminal work
test python3 code send data on ttyS1 ttyS2 ttyS3 ttyS4 not work how to config pin as serial port ?
import serial import time try : print_ser = serial.Serial('/dev/ttyS1', 115200, timeout=1) while True : print_ser.write(b'test send') time.sleep(1) except : print("Fail open port") print_ser.close()
- I try change serial "disable" to "okay" in dts and complier to dtb
- how to write register pin function in chip turn GPIO to TX or RX function ?
https://raw.githubusercontent.com/sophgo/sophgo-hardware/refs/heads/master/SG200X/03_SG2000/04_SG2000_PINOUT.xlsx
fix it sudo busybox devmem 0x03001070 32 0x2 # GPIOA 28 UART2 TX sudo busybox devmem 0x03001074 32 0x2 # GPIOA 29 UART2 RX sudo busybox devmem 0x03001068 32 0x6 # GPIOA 18 UART1 RX sudo busybox devmem 0x03001064 32 0x6 # GPIOA 19 UART1 TX
UART 2 Disable port edit by convert sg2002_licheervnano_sd.dtb to sg2002_licheervnano_sd.dts sg2002_licheervnano_sd.dts change disable to okay complier to dtb file and replace original dtb file and reboot