Back to Trending
RepositoryC
sj15712795029

sj15712795029/bluetooth_stack

这是一个开源的双模蓝牙协议栈(bluetooth.stack)(btstack),可以运行在STM32,Linux.,包含HCI,L2CAP,SDP,RFCOMM,HFP,SPP,A2DP,AVRCP,AVDTP,AVCTP,OBEX,PBAP等协议,后续会继续维护,以达到商用的目的

487stars
181forks
9issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: pbap

#1 Repository of the month

1
TINIX TRENDING·Topic: a2dp

#1 Repository of the week

1
TINIX TRENDING·Topic: avrcp

#1 Repository of the month

蓝牙协议栈 Bluetooth stack (English)

这是一个包含传统蓝牙跟低功耗蓝牙的协议栈,属于超轻量级蓝牙协议栈,用作学习蓝牙协议栈的人使用

CSR8311CYW54591BCM43430A
(AP6212A)
BCM4345C5
(AP6256)
ESP32
STM32F103√×××x
STM32F407√×××x
STM32F412√×××x
STM32H750√×××x
Linux√√√√√
Windows××××x
购买连接:购买开发板连接(点击我)暂未上线暂未上线暂未上线购买开发板连接(点击我)

源码目录结构

目录文件夹子目录文件夹说明
boardstm32f10xSTM32F103板载外设驱动
stm32f407STM32F407板载外设驱动
stm32f412STM32F412板载外设驱动
bspcortex-m3Cortex M3 Driver库(M3默认用标准库)
cortex-m4Cortex M4 Driver库(M3默认用HAL库)
componentbluetooth蓝牙协议栈源码
cjsonjson源码(目前用于跟上位机交互)
fsfile system文件系统,目前用于管理spi flash
memory_manager内存管理,目前用于管理STM32F407的SRAM
ringbuffer环形数组,用于蓝牙接收串口数据
mcu_bt_toolPC上位机,用于控制STM32开发板,以及接受STM32的状态回传
projectstm32f10x_bb_btSTM32F103裸机(BB:bare board)蓝牙工程
stm32f407_bb_btSTM32F407裸机(BB:bare board)蓝牙工程
stm32f412_bb_btSTM32F412裸机(BB:bare board)蓝牙工程
stm32h750_bb_btSTM32H750裸机(BB:bare board)蓝牙工程
linux_btLinux 蓝牙工程
windows_btWindows蓝牙工程
python_toolconvert_binayr_file_to_array.py把二进制文档转换为数据的python工具
corvert_opcode_to_ogf_ocf.py把HCI opcode转换为OGF,OCF

工程使用方式

通用

在bt_config.h中配置你想要的功能,比如debug/profile enable/paring mode/chipset select/spec profile config...

STM32下使用

前提条件:1)Keil安装 2)STM32F1/STM32F4对应的pack包 3)Download工具(我们选择的是ST-LINK)

打开工程project下的对应的stm32f10x_bb_bt/stm32f10x_bb_bt/stm32f412_bb_bt直接编译下载即可

Linux下使用

前提条件:

1)安装alsa工具:sudo apt install alsa

1)USB转UART工具(H4 transport需要硬件流控)并且接线正确,根据丝印TX接TX,RX接RX,CTS接CTS,RTS接RTS,VCC5V,GND

2)一般需要给串口权限,比如sudo chmod 777 /dev/ttyUSB0(如果不是这个路径要修改code)

打开工程project下的linux_bt make一下,生成bt_demo后直接运行即可

交流社区:

1. CSDN技术文章专栏(点击我)

2. 论坛(点击我)

视频教程:

蓝牙协议栈教程(点击我)

平台介绍:

目前我们的蓝牙协议栈可以在STM32F103以及在Linux跑起来,蓝牙芯片是CSR8311,支持
PROTOCOL:HCI L2CAP RFCOMM SDP AVDTP AVCTP ATT SMP
PROFILE: HFP A2DP AVRCP PBAP SPP GATT
希望会有更多的人来加入进来一起协作开发profile以及蓝牙芯片的工作。

蓝牙协议栈架构:

Similar Projects

Discover other similar projects and AI models.

RepositoryC
sj15712795029/bluetooth_stack

这是一个开源的双模蓝牙协议栈(bluetooth.stack)(btstack),可以运行在STM32,Linux.,包含HCI,L2CAP,SDP,RFCOMM,HFP,SPP,A2DP,AVRCP,AVDTP,AVCTP,OBEX,PBAP等协议,后续会继续维护,以达到商用的目的

487
Jan 6, 2025
RepositoryC
arkq/bluez-alsa

Bluetooth Audio ALSA Backend

987
Oct 26, 2026
RepositoryRust
bluez/bluer

BlueR — Official BlueZ Bindings for Rust

454
Aug 17, 2026
RepositoryRust
SeiyaFunaokaJP/BlueCaster

Audio Transmission APP on Windows (LDAC, LHDC V5, LE Audio, aptX Adaptive, aptX HD, aptX Low Latency, aptX, AAC, SBC XQ, SBC, FastStream, Opus, Opus 05)

225
Dec 2, 2026
RepositoryC
EHfive/pulseaudio-modules-bt

[Deprecated, see https://github.com/EHfive/pulseaudio-modules-bt/issues/154] Adds Sony LDAC, aptX, aptX HD, AAC codecs (A2DP Audio) support to PulseAudio on Linux

1.8k
Dec 15, 2020
RepositoryC
paullouisageneau/libjuice

JUICE is a UDP Interactive Connectivity Establishment library

644
Nov 20, 2026
RepositoryC
redchenjs/bluetooth_visual_speaker_esp32

Bluetooth Visual Speaker | 藍牙視效音響 | 基於ESP32的音樂全彩光立方視覺效果控制器

116
Sep 7, 2021
RepositoryC#
timschneeb/GalaxyBudsClient

Unofficial Galaxy Buds Manager for Windows, macOS, Linux, and Android

5.4k
Nov 29, 2026
RepositoryC#
sipsorcery-org/sipsorcery

A WebRTC, SIP and VoIP library for C# and .NET. Designed for real-time communications apps.

2.0k
Dec 1, 2026