【FRDM IMX93】扫描不到周边蓝牙
【操作系统】debain 12
root@localhost:/# cat /etc/debian_version
12.11
【现象】
加载蓝牙模块是正常的
执行命行如下:
root@localhost:/# hcitool cmd 0x03 0x0001 0x01
< HCI Command: ogf 0x03, ocf 0x0001, plen 1
01
> HCI Event: 0x0e plen 4
01 01 0C 12
root@localhost:/# sleep 2
root@localhost:/# hcitool scan
Scanning ...
root@localhost:/# hcitool lescan//扫描低功耗蓝牙设备
Set scan parameters failed: Input/output error
【自己偿试过的方法】
经过查找,说提示驱动没有加载好,但是我查看/lib/firmware/nxp/目录下是有蓝牙驱动的(uartuart_n61x_v1.bin.se)。
驱动列表如下:
root@localhost:/# ls /lib/firmware/nxp/
ed_mac_ctrl_V1_8801.conf sdio9098_wlan_v1.bin txpwrlimit_cfg_8997.conf
ed_mac_ctrl_V3_8987.conf sdioiw416_wlan_v0.bin txpwrlimit_cfg_9098.conf
ed_mac_ctrl_V3_8997.conf sdiouart8987_combo_v0.bin uart8987_bt.bin
ed_mac_ctrl_V3_909x.conf sdiouart8997_combo_v4.bin uart8997_bt_v4.bin
helper_uart_3000000.bin sdiouart9098_combo_v1.bin uart9098_bt_v1.bin
pcie8997_wlan_v4.bin sdiouartiw416_combo_v0.binuartiw416_bt.bin
pcie9098_wlan_v1.bin sd_iw610.bin.se uart_iw610_bt.bin.se
pcieuart8997_combo_v4.binsduart_iw610.bin.se uartspi_iw610.bin.se
pcieuart9098_combo_v1.binsduart_nw61x_v1.bin.se uartspi_n61x_v1.bin.se
sd8801_uapsta.bin sduartspi_iw610.bin.se uartuart_n61x_v1.bin.se
sd8987_wlan.bin sd_w61x_v1.bin.se wifi_mod_para.conf
sdio8997_wlan_v4.bin txpwrlimit_cfg_8987.conf
希望有大佬们帮帮忙。
✅ 建议排查步骤(按优先级):
✅ 1. 确认固件是否加载正确
执行:
bash
复制
dmesg | grep -i bluetooth
查看是否有如下类似信息:
Bluetooth: Loading firmware file uartuart_n61x_v1.bin.se
如果没有,说明固件未加载,你需要手动指定或检查设备树(DTB)中是否启用了蓝牙节点。
✅ 2. 检查内核配置
确认内核是否启用了以下配置:
bash
复制
zgrep BT_LE /proc/config.gz
应返回:
CONFIG_BT_LE=y
如果没有,需要重新编译内核并启用 BT_LE。
✅ 3. 使用 btmgmt 替代 hcitool
hcitool 已弃用,建议使用 btmgmt:
bash
复制
btmgmt le on
btmgmt power on
btmgmt find
如果 btmgmt 也报错,说明问题在底层驱动或固件。
✅ 4. 检查设备树(DTB)是否启用蓝牙
确认设备树中是否启用了 uart_n61x 或 bluetooth 节点,例如:
dts
复制
&uart3 {
bluetooth {
compatible = "nxp,n61x";
firmware = "uartuart_n61x_v1.bin.se";
};
};
如果设备树中没有正确配置,蓝牙芯片不会进入 BLE 模式。
✅ 5. 检查 BlueZ 版本
Debian 12 默认 BlueZ 版本为 5.66,建议升级到 5.70+,因为旧版本对 BLE 支持不完善:
bash
复制
apt list bluez -a
如果版本低于 5.70,建议从源码编译安装最新版:
bash
复制
wget https://www.kernel.org/pub/linux/bluetooth/bluez-5.77.tar.xz
tar xf bluez-5.77.tar.xz
cd bluez-5.77
./configure --enable-experimental
make && sudo make install
✅ 6. 临时绕过方案(测试用)
如果你只是要验证 BLE 功能,可以尝试:
使用 NXP IoT Toolbox(如你所述,社区推荐)
或者使用 Android 手机作为 central 连接开发板(你已验证可行)
✅ 总结一句话:
你的 BLE 扫描失败,大概率是固件未正确加载或内核未启用 BLE 支持,建议从 dmesg 和 btmgmt 入手排查,逐步确认固件、设备树、内核配置是否匹配。
✅ 下一步建议(你可以发我结果):
请执行以下命令并贴出输出:
bash
复制
dmesg | grep -i bluetooth
btmgmt le on
btmgmt find 感谢大佬的帮助,我后面使用zehpyr重新写了mcxw71的程序,就可以通信了。 先看一下
页:
[1]