SDK 简介
概述
SDK 由以下三部分组成:
SDK
├── component FreeRTOS、SoC、mbed API、Wi-Fi、network 等组件
├── example 应用示例集合,包括 audio、network、ota、usb、外设等功能示例
├── tools 工具
└── cmake 编译抽象层
component
该目录包含 SDK 的核心功能组件,供上层应用调用。常见的组件如下表所示:
条目 |
描述 |
|---|---|
at_cmd |
AT 命令支持模块 |
audio |
音频 codec 驱动,支持:alc5616/alc5640/alc5651/alc5660/alc5679/alc5680/sgtl5000 |
bluetooth |
蓝牙协议栈源码及相关库文件 |
file_system |
文件系统实现,包含:fatfs、littlefs、ftl、kv、vfs 等 |
lwip |
LWIP 协议栈 API 及其源代码 |
network |
网络协议支持,包括:
|
os |
FreeRTOS 实时操作系统源代码及 OS API 封装层实现 |
soc |
SoC 相关的核心模块,包括:
|
ssl |
安全通信协议栈,基于 mbed TLS 实现 |
usb |
USB class driver 及验证代码 |
utils |
工具类模块,包括:
|
wifi |
Wi-Fi 功能模块,提供以下接口:
|
在 soc 目录下,每个 SoC 都有一个独立的子目录 main,该目录是该 SoC 的主程序入口。每个 SoC 可能包含多个 MCU,每个 MCU 拥有一个独立的子目录。
component/soc/xxx/main
├── {mcu1}/ 每个 MCU 的专属主程序目录
└── {mcu2}/ 每个 MCU 的专属主程序目录
├── inc/ 头文件 FreeRTOSConfig.h 以及 build_info.h 等
└── src/ 主程序源码
在 soc 目录下,每个 SoC 都有一个独立的子目录 project,该目录是该 SoC 的编译入口,包含 Kconfig, CMake, layout 等文件。每个 SoC 可能包含多个 MCU,每个 MCU 拥有一个独立的子目录 project_xx,其中包含了链接脚本(linker script)、以及 Bootloader 和 Application Image 的 CMake 编译配置文件等。
component/soc/xxx/project
├── project_{mcu1}/ 每个 MCU 的专属配置目录
└── project_{mcu2}/ 每个 MCU 的专属配置目录,SoC 中有多个 MCU,就会有多个目录
├── ld/ 链接脚本
├── lib/ 库文件
└── make/ 用于编译 image 的 CMake 脚本
tools
该目录包含 Ameba 固件开发过程中需要用到的工具。
条目 |
描述 |
|---|---|
TraceTool |
用于打印日志和发送指令 Trace Tool |
ImageTool |
用于下载固件 Image Tool |
DownloadServer |
基于 socket 的 OTA server 程序 |
DownloadServer (HTTP) |
基于 HTTP 的 OTA server 程序 |
iperf |
用于 Wi-Fi 吞吐量测试 |
littlefs |
littlefs 文件系统生成 |
meta_tools |
VS Code 插件 SDK 端适配工具集 |
关键头文件
SDK 中的一些关键头文件及说明如下表所示:
条目 |
描述 |
位置 |
|---|---|---|
basic_types.h |
|
component/soc/ |
section_config.h |
链接脚本中各种Section的定义:
|
|
ameba_soc.h |
提供底层驱动的Raw API(推荐使用) 相对于mbed API,Raw API提供更灵活丰富和高效的硬件配置接口 |
|
mbed API headers |
基于Raw API的高级封装接口,提供的功能相对单一 |
component/soc/ |
SDK License
Layer |
Item |
Version |
License |
|---|---|---|---|
Application |
cJSON |
n/a |
MIT License |
NetWork |
Lwip |
v2.1.2 |
BSD License |
GmSSL |
v3.1.1 |
Apache-2.0 |
|
mbedTLS |
v3.6.2 v3.6.5 |
Apache-2.0 |
|
Wi-Fi |
wpa_supplicant |
n/a |
BSD License |
BT |
LC3 Codec (BT audio codec lib) |
n/a |
Apache-2.0 |
SBC Codec (BT audio codec lib) |
n/a |
Apache-2.0 |
|
AES-CMAC |
n/a |
No License, free to use |
|
CCMS |
n/a |
Apache-2.0 |
|
ECC (Kenneth MacKay) |
n/a |
BSD 2-Clause License |
|
SHA256 (Colin Percival) |
n/a |
BSD 2-Clause License |
|
File System |
FatFs |
n/a |
BSD Licenses |
LittleFS |
n/a |
BSD 3-Clause License |
|
OS |
FreeRTOS |
v10.2.1 v10.4.3 v10.5.1 |
MIT License |
Audio |
Audio effect |
n/a |
For audio effects Apache-2.0 |
sonic |
n/a |
For audio speed Apache-2.0 |
|
FLAC (Free Lossless Audio Codec) decoder |
n/a |
For decoding FLAC v2 or any later version LGPL |
|
haac |
n/a |
For decoding haac The contents of this file, and the files included with this file, are subject to the current version of the RealNetworks Public Source License Version 1.0 (the "RPSL") unless you have licensed the file under the RealNetworks Community Source License Version 1.0 (the "RCSL"), in which case the RCSL will apply. |
|
gsm610 |
v1.0.19 |
For playing sound in ekho Any use of this software is permitted provided that this notice is not removed and that neither the authors nor the Technische Universitaet Berlin are deemed to have made any representations as to the suitability of this software for any purpose nor are held responsible for any defects of this software. |
|
libopus |
n/a |
For decode opus Contributions to the collaboration shall not be considered confidential. Each contributor represents and warrants that it has the right and authority to license copyright in its contributions to the collaboration. Each contributor agrees to license the copyright in the contributions under the Modified (2-clause or 3-clause) BSD License or the Clear BSD License. Please see the IPR statements submitted to the IETF for the complete patent licensing details:
|
|
speexdsp |
v1.2.1 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
tremolo |
v0.07 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
|
Ui |
lvgl |
v8.3 v9.3 |
MIT license Copyright(c) 2021 LVGL Kft |
jpeg |
v62 |
libjpeg-turbo is covered by three compatible BSD-style open source licenses:
|
|
png |
v1.6.34 |
libpng License |
|
zlib |
v1.2.11 |
zlib License |
|
AIVoice |
tflite_micro |
n/a |
Apache-2.0 |