UART0无法接收问题
设备用UART0连接外设发现只能发不能收,示波器检查硬件连接没有问题(SYS的GPIO 调试可以正常拉高拉低, UART0_RXD=GPIO0_B3, GPIO11)检查 /sys/kernel/debug/pinctrl/pinctrl-handle,
device: ff030000.serial current state: default
state: default
type: MUX_GROUP controller rockchip-pinctrl group: uart0-xfer (6) function: uart0 (22)
type: CONFIGS_PIN controller rockchip-pinctrl pin gpio0-10 (10)config 00010005
type: CONFIGS_PIN controller rockchip-pinctrl pin gpio0-11 (11)config 00010005
px30.dtsi uart0_xfer配置为:
2078 uart0 {
2079 uart0_xfer: uart0-xfer {
2080 rockchip,pins =
2081 <0 RK_PB2 RK_FUNC_1 &pcfg_pull_up>,
2082 <0 RK_PB3 RK_FUNC_1 &pcfg_pull_up>;
2083 };
所以配置上是没有问题的,
所以谁知道这个问题是在哪里么? 解决思路,串口配置正确,GPIO的gpio0_b3的功能配置检查:
文档 PX30 TRM-Part1 /Chapter 3 General Register Files (GRF) /P.g.104
NameAddress Base
PMUGRF0xFF010000
PMUGRF_GPIO0B_IOMUX0x0004 W 0x00001000GPIO0B iomux control bits
31:16 WO 0x0000
write_enable
When bit16=1, bit0 can be written by software.
...
When bit22=1, bit6 cannot be written by software;
When bit23=1, bit7 can be written by software.
7:6 RW 0x0
gpio0b3_sel
2'h0: gpio
2'h1: uart0_rx
2'h2: pmu_debug1
调试:
root@firefly:/home/firefly# io -4 -r 0xFF010004
ff010004:00001015
-->bit7 = 0, 对应功能为gpio,没有使能uart0 rx
解决方法:
开机脚本/etc/init.d/myboothack 添加
/usr/local/bin/io -4 -w0xFF010004 0x00501055
0050 权限
005x tx/rx 功能
页:
[1]