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
uart1( 11*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跳帽往上跳
U1552, U1553对应拨码
J156跳帽往上跳
J179跳帽往上跳
UART1: 无需改动
13*13:
UART3: U1540, U1541对应拨码
UART2: U1539, U1540对应拨码
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“回车符