文章目录
- 开发平台基本信息
- 问题描述
- 解决方法
- debug口转普通串口补丁
开发平台基本信息
芯片: SDM450
版本: Android 9.0
kernel: msm-4.9
问题描述
由于硬件起初设计的时候,没有预留通用串口,而usb转串口又不是特别稳定,经常会挂死,虽然可以通过上、下电U口节点去恢复串口功能,但是,效果仍然不如直接使用串口好。刚好,在设备上有一个debug串口,平时是驱动调试功能用的,业务就提出将debug串口转为通用串口使用,解决u转串不稳定的问题。
解决方法
debug口转普通串口补丁
diff --git a/device/qcom/msm8953_64/BoardConfig.mk b/device/qcom/msm8953_64/BoardConfig.mk
index 61d3034..676ea13 100755
--- a/device/qcom/msm8953_64/BoardConfig.mk
+++ b/device/qcom/msm8953_64/BoardConfig.mk
@@ -182,8 +182,10 @@ BOARD_VENDOR_KERNEL_MODULES := \endif-ifeq ($(strip $(TARGET_KERNEL_VERSION)), 4.9)
- BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 firmware_class.path=/vendor/firmware_mnt/image androidboot.usbconfigfs=true loop.max_part=7
+ifeq ($(strip $(TARGET_KERNEL_VERSION))_$(D2_NoNeed_DebugSerial), 4.9_true)
+ BOARD_KERNEL_CMDLINE := user_debug=31 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 firmware_class.path=/vendor/firmware_mnt/image androidboot.usbconfigfs=true loop.max_part=7
+else ifeq ($(strip $(TARGET_KERNEL_VERSION)), 4.9)
+ BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_serial_dm,0x78af000 firmware_class.path=/vendor/firmware_mnt/image androidboot.usbconfigfs=true loop.max_part=7else ifeq ($(strip $(TARGET_KERNEL_VERSION)), 3.18)BOARD_KERNEL_CMDLINE := console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 androidboot.hardware=qcom msm_rtb.filter=0x237 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 androidboot.bootdevice=7824900.sdhci earlycon=msm_hsl_uart,0x78af000 firmware_class.path=/vendor/firmware_mnt/image loop.max_part=7endifdiff --git a/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2-perf_defconfig b/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2-perf_defconfig
index 7e0a3d0..1540b98 100755
--- a/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2-perf_defconfig
+++ b/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2-perf_defconfig
@@ -339,8 +339,8 @@ CONFIG_INPUT_UINPUT=y# CONFIG_LEGACY_PTYS is not set# CONFIG_DEVMEM is not set# CONFIG_DEVKMEM is not set
-CONFIG_SERIAL_MSM_HS=y
-CONFIG_SERIAL_MSM_SMD=y
+#CONFIG_SERIAL_MSM_HS=y
+#CONFIG_SERIAL_MSM_SMD=yCONFIG_DIAG_CHAR=yCONFIG_DIAG_USES_SMD=yCONFIG_HW_RANDOM=y
@@ -701,9 +701,9 @@ CONFIG_USB_SERIAL_PL2303=yCONFIG_USB_SERIAL_FTDI_SIO=yCONFIG_SERIAL_MSM_HSL=y
-CONFIG_SERIAL_MSM_HSL_CONSOLE=y
+#CONFIG_SERIAL_MSM_HSL_CONSOLE=yCONFIG_SERIAL_MSM=y
-CONFIG_SERIAL_MSM_CONSOLE=y
+#CONFIG_SERIAL_MSM_CONSOLE=yCONFIG_SENSORS=yCONFIG_SWITCH=y
diff --git a/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2_defconfig b/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2_defconfig
index 8a468b8..b113cc4 100755
--- a/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2_defconfig
+++ b/kernel/msm-4.9/arch/arm64/configs/msm8953-telpo-D2_defconfig
@@ -347,9 +347,9 @@ CONFIG_INPUT_UINPUT=y# CONFIG_DEVMEM is not set# CONFIG_DEVKMEM is not setCONFIG_SERIAL_MSM=y
-CONFIG_SERIAL_MSM_CONSOLE=y
+#CONFIG_SERIAL_MSM_CONSOLE=yCONFIG_SERIAL_MSM_HS=y
-CONFIG_SERIAL_MSM_SMD=y
+#CONFIG_SERIAL_MSM_SMD=yCONFIG_DIAG_CHAR=yCONFIG_DIAG_USES_SMD=yCONFIG_HW_RANDOM=y
@@ -767,7 +767,7 @@ CONFIG_USB_SERIAL_PL2303=yCONFIG_USB_SERIAL_FTDI_SIO=yCONFIG_SERIAL_MSM_HSL=y
-CONFIG_SERIAL_MSM_HSL_CONSOLE=y
+#CONFIG_SERIAL_MSM_HSL_CONSOLE=yCONFIG_SENSORS=yCONFIG_SWITCH=y
注:修改完之后进行调试,用AT指令工具打开串口,发生指令没有接收到返回,原因是波特率设置为115200,改为9600就能正常收到返回数据了。