BT/BLE uart收发HCI示例

源码路径:example/bt/HCI_over_uart/src

支持的平台

  • eh-lb52x

  • eh-lb56x

  • eh-lb58x

概述

本例程演示通过uart1与BT/BLE controller进行HCI收发。

例程的使用

例程开机后,就可以通过uart1发送HCI command给controller,HCI event也会发送回uart1。

52x的console log口默认是uart3(参见project/sf32lb52x/proj.conf)

56x/58x的console log口默认是uart4(参见project/sf32lb56x/proj.conf)(参见project/sf32lb58x/proj.conf)

硬件需求

运行该例程前,需要准备:

编译和烧录

切换到例程project目录,运行scons命令执行编译:

> scons --board=eh-lb525 -j32

切换到例程project/build_xx目录,运行uart_download.bat,按提示选择端口即可进行下载:

$ ./uart_download.bat

     Uart Download

please input the serial port num:5

关于编译、下载的详细步骤,请参考快速入门的相关介绍。

例程的预期结果

例程启动后: 就可以通过uart1发送HCI command给controller,HCI event也会发送回uart1。

例如:通过uart1发送十六进制 01 03 0C 00 (需要加回车换行),uart1就会收到十六进制04 0E 04 06 03 0C 00

异常诊断

参考文档

更新记录

版本

日期

发布说明

0.0.1

01/2025

初始版本