eefocus_3914144 发表于 2025-12-11 12:16:31

【FRDM-MCXW71】基于zephyr的蓝牙通信

【前言】
最近学习了zephyr,发现用他的蓝牙相比好象要容易得多,在此分享一下。
【环境搭建】
在wsl下面下载好zephyr包,再安装zephyrsdk。
【复制示例工程】
cp -r $ZEPHYR_BASE/samples/bluetooth/peripheral ./my_ble_app【编译与验证】
lugl@lugl:~/zephyrproject/app/my_ble_app$ west build -b frdm_mcxw71
CMake Error: The current CMakeCache.txt directory /home/lugl/zephyrproject/app/my_ble_app/build/CMakeCache.txt is different than the directory /home/lugl/zephyrproject/zephyr/samples/bluetooth/peripheral/build where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure, reedit the CMakeCache.txt
Linking C executable zephyr/zephyr.elf
Memory region         Used SizeRegion Size%age Used
         FLASH:      137048 B         1 MB   13.07%
             RAM:       29869 B       112 KB   26.04%
    rpmsg_sh_mem:          6 KB         6 KB    100.00%
      IDT_LIST:          0 GB      32 KB      0.00%
Generating files from /home/lugl/zephyrproject/zephyr/samples/bluetooth/peripheral/build/zephyr/zephyr.elf for board: frdm_mcxw71【下载】
打开LinkFlash,接上开发板,找到生成的固件在/my_ble_app/build/zephyr/zephyr.elf

【验证】
打开手机nrf connect 就可以找到客户端,并且可以实现数据的交互。

【总结】
相比用其他的开发方式,zephyr要方便快捷得多。
页: [1]
查看完整版本: 【FRDM-MCXW71】基于zephyr的蓝牙通信

Baidu
map