本文來源電子發燒友社區,作者:efans_190a9a, 帖子地址:https://bbs.elecfans.com/jishu_2292095_1_1.html
什么是Zephyr?
zephyr操作系統是一個用于資源受限和嵌入式系統的小型內核(出自名門),針對的應用場景,從簡單的嵌入式環境傳感器和可穿戴設備到復雜的嵌入式控制器、智能手表和物聯網無線應用程序。
Zephyr內核支持多種體系結構,包括ARM Cortex-M, Intel x86, ARC, NIOS II, Tensilica Xtensa and RISC-V 32.。
此外個人覺得zephyr的ble statck被廣大芯片廠商所認可,目前主流藍牙芯片一般都已經支持了。
zephyr的ble stack 包含如下 ble central ble peripheral ble hid等等,此外zephyr的ble mesh 也被大家所認可。
https://github.com/zephyrproject-rtos/zephyr/tree/main/samples/bluetooth
- samples/bluetooth/beacon
- samples/bluetooth/broadcaster
- samples/bluetooth/central
- samples/bluetooth/central_hr
- samples/bluetooth/central_ht
- samples/bluetooth/central_multilink
- samples/bluetooth/eddystone
- samples/bluetooth/observer
- samples/bluetooth/peripheral
- samples/bluetooth/peripheral_csc
- samples/bluetooth/peripheral_dis
- samples/bluetooth/peripheral_esp
- samples/bluetooth/peripheral_hids
- samples/bluetooth/peripheral_hr
- samples/bluetooth/peripheral_ht
- samples/bluetooth/peripheral_identity
- samples/bluetooth/peripheral_ots
- samples/bluetooth/peripheral_sc_only
- samples/bluetooth/scan_adv
TLSR9系列在單芯片上支持包括藍牙5.2在內的最領先的物聯網標準和行業聯盟規范,包括基本速率(BR),增強速率(EDR),低功耗(LE),長距離(Long Range),多天線室內定位(AoA/AoD)和Bluetooth^?^ Mesh,Zigbee 3.0,HomeKit,6LoWPAN,Thread和2.4 GHz專有協議。TLSR9標配256KB SRAM和1 MB~2MB Flash,并將高質量無線音頻和可穿戴產品所需的特性和功能整合到單個SoC中,高配版本將包含更多的硬件資源用于對這些產品的支持。
大家可以在Zephyr支持的設備中發現TLSR9系列:
1. 代碼獲取
git clone https://github.com/zephyrproject-rtos/zephyr.git
2下載交叉編譯工具鏈:
http://wiki.telink-semi.cn/tools_and_sdk/Tools/IDE/telink_riscv_linux_toolchain.zip
配置環境變量:
export PATH=$PATH:~/toolchains/nds32le-elf-mculib-v5f/bin/
配置完在中斷輸出riscv32-elf看看有沒有相關gcc之類的提示,有的話說明工作正常。
-
修改 dts配置clock
boards/riscv/tlsr9518adk80d/tlsr9518adk80d.dts
&cpu0 {
clock-frequency = <48000000>;
};
為什么是48M呢,因為外部晶體是24M 經過PLL倍頻后是48Mhz
4.編譯
# From the root of the zephyr repository
west build -b tlsr9518adk80d samples/hello_world
5.接線如圖
6.全部命令如下:
sudo apt update
sudo apt upgrade sudo apt install --no-install-recommends git cmake ninja-build gperf ccache dfu-util device-tree-compiler wget python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file make gcc gcc-multilib g++-multilib libsdl2-dev
pip3 install --user -U west echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc source ~/.bashrc
west init ~/zephyrproject cd ~/zephyrproject west update
pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.13.1/zephyr-sdk-0.13.1-linux-x86_64-setup.run
chmod +x zephyr-sdk-0.13.1-linux-x86_64-setup.run
./zephyr-sdk-0.13.1-linux-x86_64-setup.run -- -d ~/zephyr-sdk-0.13.1
sudo cp ~/zephyr-sdk-0.13.1/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d sudo udevadm control --reload west build -b tlsr9518adk80d samples/hello_world
-
泰凌微
+關注
關注
7文章
144瀏覽量
10797
發布評論請先 登錄
相關推薦
評論