MC3302_SDK_V1.1.9_202507281.../bsp/test/uart
2025-11-11 12:08:31 +08:00
..
Makefile original version 2025-11-11 12:08:31 +08:00
Readme.txt original version 2025-11-11 12:08:31 +08:00
uart_test original version 2025-11-11 12:08:31 +08:00
uart_test.c original version 2025-11-11 12:08:31 +08:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

测试步骤
1、进入kernel后配置波特率及数据格式
stty -F /dev/ttySx ispeed 115200 ospeed 115200 cs8
x为uart编号1~3

2、检查源时钟是否为24m读以下寄存器查看值是否为0
Uart1的源时钟地址为0x9200254
Uart2的源时钟地址为0x10300244
Uart3的源时钟地址为0x10300248

3、配置pin_mux
uart111*11与13*13相同
devmem 0x10200208 32 0x0
devmem 0x1020020c 32 0x0

uart2
11*11
devmem 0x102000a0 32 0x6
devmem 0x102000a4 32 0x6
13*13
devmem 0x102001b8 32 0x6
devmem 0x102001bc 32 0x6

uart3
11*11
devmem 0x10200090 32 0x4
devmem 0x10200094 32 0x4
13*13
devmem 0x102001b0 32 0x6
devmem 0x102001c8 32 0x4

4、拨码跳帽配置
11*11
UART3:
需要重新做串口线改成单孔插针将tx、rx接往以下位置
J166--中间的pin为uart3_tx连接串口芯片的rx
J167--中间的pin为uart3_rx连接串口芯片的tx

UART2
只需要更改跳帽
J155跳帽往上跳
J178跳帽往上跳
U1552U1553对应拨码
J156跳帽往上跳
J179跳帽往上跳

UART1无需改动

13*13
UART3U1540U1541对应拨码
UART2U1539U1540对应拨码
UART1不需改动

5、运行测试程序“./uart_test”
不带参数时默认测试ttyS2设备需要更改测试串口设备时在执行测试程序时输入参数“/dev/ttySx“ (x为uart编号)
运行串口调试工具sscom32打开与连接在对应uart口上的串口

6、当测试程序选择“1“时sscom32窗口会打印测试使用的uart发出的”hello world“字符串
当测试程序选择“2“时需要点击sscom32下方的”发送“sscom32窗口及应用会显示打印uart接收到的数据
” 31 32 33 34 35 36 37 38 39 30 40 0d “为具体字符对应的ASCII码前十一个可以随意更改结尾需要为”0d“回车符