问题原因
接下来继续解决蓝牙问题。
查看原理图,确认管脚
从原理图可以确认,BT用的是UART1模块。
sys_config.fex配置
找到BT的配置项
;--------------------------------------------------------------------------------
;bluetooth configuration
;bt_used: 0- no used, 1- used
;clocks: external low power clock input (32.768KHz)
;bt_power: input supply voltage
;bt_io_regulator: bluetooth I/O voltage
;bt_rst_n: power up/down internal regulators used by BT section
;--------------------------------------------------------------------------------
[bt]
bt_used = 1
;clocks = "&clk_losc_out"
;bt_power = "vcc-wifi"
;bt_io_regulator = "vcc-wifi-io"
bt_rst_n = port:PM04<1><default><default><0>
;--------------------------------------------------------------------------------
;bluetooth lpm configuration
;btlpm_used: 0- no used, 1- used
;uart_index: 0- uart0, 1- uart1, 2- uart2
;bt_wake: host wake-up bluetooth device
;bt_hostwake: bt device wake-up host
;--------------------------------------------------------------------------------
[btlpm]
btlpm_used = 1
uart_index = 1
bt_hostwake_enable = 0
bt_wake = port:PM02<1><default><default><1>
bt_hostwake = port:PM01<6><default><default><0>
下面解析下每项含义:
[bt]
bt_used ——– 是否使用蓝牙
;clocks ——– 时钟
;bt_power ——– bt模组使用那一路AXP供电
;bt_io_regulator——– bt模组io使用哪一路AXP供电
bt_rst_n ——– bt使能引脚
[btlpm]
btlpm_used ——– 蓝牙低功耗使用控制
uart_index ——– 使用的串口序号
bt_hostwake_enable ——– bt唤醒主控使能
bt_wake ——– 主控唤醒bt引脚
bt_hostwake ——– bt唤醒主控引脚
根据原理图,修改代码如下:
lemon@ubuntu:~/Develop/OrangePi_Lite2/lichee$ git diff tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
diff --git a/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex b/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
index 61295cb..36ccf5f 100755
--- a/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
+++ b/lichee/tools/pack/chips/sun50iw6p1/configs/petrel-p1/sys_config.fex
@@ -1236,9 +1236,9 @@ bt_rst_n = port:PM04<1><default><default><0>
[btlpm]
btlpm_used = 1
uart_index = 1
-bt_hostwake_enable = 0
+bt_hostwake_enable = 1
bt_wake = port:PM02<1><default><default><1>
-bt_hostwake = port:PM01&l