Uart4是不是被其他模块占用了?

使用android7.1
控制uart4的时候,发现波特率老是被修改为9600,是不是被其他模块占用了,要如何修改?
01-18 09:25:53.685 410 947 E u-blox : ubx_thread: read error 0
01-18 09:25:53.686 410 947 V u-blox : connectReceiver: Open/Reopen the serial port
01-18 09:25:53.686 410 947 V u-blox : CSerialPort::openSerial: Serial port opened, fd = 166
01-18 09:25:53.686 410 947 V u-blox : connectReceiver: Init receiver
01-18 09:25:53.686 410 947 V u-blox : CUbxGpsState::powerOff: placeholder for power OFF function
01-18 09:25:53.686 410 947 V u-blox : CGpsIf::gpsStatus: current GPS status: (still) 4 (GPS_STATUS_ENGINE_OFF)

rk3399的4G容量开发板
尝试wike如下修改还是不行
3.3 修改方法
3.2中的固件默认是支持GPS的,而公版固件默认关闭该功能。用户可以根据需要修改/system/build.prop里面ro.factory.hasGPS参数(false/true),实现禁止或者使能GPS功能,改完之后需要重启机器才会生效。
可以查看到ro.factory.hasGP已经修改为false了,但ttyS4操作时还是会失效,日志如下:
01-18 08:51:00.049 400 954 E u-blox : ubx_thread: read error 0
01-18 08:51:00.049 400 954 V u-blox : connectReceiver: Open/Reopen the serial port
01-18 08:51:00.049 400 954 V u-blox : CSerialPort::openSerial: Serial port opened, fd = 166
01-18 08:51:00.049 400 954 V u-blox : connectReceiver: Init receiver
01-18 08:51:00.049 400 954 V u-blox : CUbxGpsState::powerOff: placeholder for power OFF function
01-18 08:51:00.049 400 954 V u-blox : CGpsIf::gpsStatus: current GPS status: (still) 4 (GPS_STATUS_ENGINE_OFF)
可见,gps服务还是在工作
是否还要修改什么地方?谢谢!

nila 发表于 2018-5-3 17:30
rk3399的4G容量开发板
尝试wike如下修改还是不行
3.3 修改方法

diff --git a/device/rockchip/common/ueventd.rockchip.rc b/device/rockchip/common/ueventd.rockchip.rc
index 95f9ed4..e6418dc 100755 (executable)
--- a/device/rockchip/common/ueventd.rockchip.rc
+++ b/device/rockchip/common/ueventd.rockchip.rc
@@ -48,6 +48,9 @@
 /dev/accelirq             0660   system     system
 /dev/compassirq           0660   system     system

#for GPS u-blox
+#/dev/ttyS4                0666   gps        gps
+
 # for GPS
 #/dev/ttyS3                0600   gps        gps
 /dev/gps                  0660   gps        gps
diff --git a/device/rockchip/rk3399/BoardConfig.mk b/device/rockchip/rk3399/BoardConfig.mk
index 859c46b..af03d12 100755 (executable)
--- a/device/rockchip/rk3399/BoardConfig.mk
+++ b/device/rockchip/rk3399/BoardConfig.mk
@@ -70,4 +70,7 @@ BOARD_SENSOR_MPU_VR := true
 //MAX-SIZE=2G, for generate out/.../system.img
 BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1610612736

# product has GPS or not
+BOARD_HAS_GPS := false
+
 ENABLE_CPUSETS := true

同时将以上修改加上试试

加上以上修改后,还是会有相同的问题,波特率被修改回9600。出错时会有如下日志打印:
01-18 13:55:27.585 603 1264 E u-blox : ubx_thread: read error 0
01-18 13:55:27.586 603 1264 V u-blox : connectReceiver: Open/Reopen the serial port
01-18 13:55:27.586 603 1264 V u-blox : CSerialPort::openSerial: Serial port opened, fd = 165
01-18 13:55:27.586 603 1264 V u-blox : connectReceiver: Init receiver
01-18 13:55:27.586 603 1264 V u-blox : CUbxGpsState::powerOff: placeholder for power OFF function
01-18 13:55:27.586 603 1264 V u-blox : CGpsIf::gpsStatus: current GPS status: (still) 4 (GPS_STATUS_ENGINE_OFF)
是否应考虑将GPS的服务关闭?该如何操作?谢谢!

nila 发表于 2018-5-3 19:48
加上以上修改后,还是会有相同的问题,波特率被修改回9600。出错时会有如下日志打印:
01-18 13:55:27.585 …

device/rockchip/rk3399/gps/u-blox.conf
改这个文件

修改了device/rockchip/rk3399/gps/u-blox.conf这个文件,
修改为SERIAL_DEVICE /dev/ttyUSB4
这样log会一直打印找不到串口
01-18 08:58:35.757 597 1273 V u-blox : connectReceiver: Open/Reopen the serial port
01-18 08:58:35.757 597 1273 E u-blox : CSerialPort::openSerial: Cannot open serial port /dev/ttyUSB4, return -1 0
01-18 08:58:35.757 597 1273 V u-blox : CGpsIf::gpsStatus: current GPS status: (still) 4 (GPS_STATUS_ENGINE_OFF)
01-18 08:58:35.757 597 1273 E u-blox : connectReceiver: Failing to reopen the serial port
有没有办法可以完全关闭他呢?
谢谢!

V/u-blox ( 462): ubx_thread: MSG UNKNOWN size 123

V/u-blox ( 462): ubx_thread: MSG UNKNOWN size 123
这是什么意思啊,是不是异常了