打印
[技术讨论]

全志XR806 FreeRTOS快速开发入门

[复制链接]
718|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
神棍地海棠|  楼主 | 2024-3-1 10:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
RTOS 快速开发入门
[color=rgba(0, 0, 0, 0.87)]XR806 是一颗高集成度无线应用MCU,其集成了ARMv8-M 内核、IEEE 802.11b/g/n Wi-Fi 子系统、BLE 5.0子系统、电源管理系统、高级别的安全系统以及丰富的外设接口,具有优秀的射频性能、稳定性、可靠性和超低功耗。
[color=rgba(0, 0, 0, 0.87)]芯之联软件开发平台,具有丰富的组件和灵活的应用框架,可满足用户对Wi-Fi、BLE、低功耗、安全等多方面的需求,可协助用户快速开发智能产品应用,包括物联网(IoT)、智能家居、云连接等。
SDK 说明框架简述
[color=rgba(0, 0, 0, 0.87)][color=var(--md-typeset-a-color)]
目录结构
[color=rgba(0, 0, 0, 0.87)]目录结构如下,其中out 目录在编译时产生。
code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;">.├── bin # bin 文件目录,存放预置bin 文件├── chip.mk├── config.mk├── gcc.mk├── Kconfig├── Makefile├── include # 头文件目录,存放模块对外头文件├── lib # 库文件目录,存放预置库文件和编译生成的库文件│ ├── libaac.a│ ├── libadt.a│ └── ......├── out # 编译生成文件存放目录,存放编译生成的bin 和image├── project # 工程总目录│ ├── bootloader # bootloader 工程│ ├── common # 工程公用代码│ ├── demo # 演示工程总目录,该目录下每个目录对应一个工程│ │ ├── hello_demo│ │ ├── wlan_demo│ │ └── ......│ ├── example # 示例工程总目录,该目录下每个目录对应一个工程│ │ ├── uart│ │ ├── wlan│ │ └── ......│ ├── image_cfg│ │ └── image.cfg # 默认镜像配置文件│ ├── linker_script│ │ └── gcc│ │ ├── appos.ld # 工程默认链接脚本│ │ └── bootloader.ld # bootloader 链接脚本│ ├── project.mk│ ├── Kconfig│ └── ......├── src│ ├── driver│ │ ├── chip # 芯片外设驱动│ │ └── component # 扩展外设驱动│ ├── image # image 模块│ ├── kernel # 内核│ ├── ota # OTA 模块│ └── ......├── ......└── tools # 镜像打包及烧录等工具构建系统和配置文件
[color=rgba(0, 0, 0, 0.87)]XRADIO SDK 的代码编译和镜像创建采用Kconfig 和Makefile 进行管理,Kconfig 和关键Makefile 和配置文件的说明见表。除特殊说明外,下文所有路径描述均为相对于SDK 根目录的相对路径。
[color=rgba(0, 0, 0, 0.87)][color=var(--md-typeset-a-color)]
[color=rgba(0, 0, 0, 0.87)]一般情况下,用户只需要修改以下文件来实现工程配置定义:
  • project/[prj]/gcc/Makefile(用于指定工程源文件、库、链接脚本、镜像配置文件等)
  • project/[prj]/gcc/defconfig(可用于覆盖顶层.config 中的默认配置)
  • project/[prj]/prj_config.h(覆盖“project/common/prj_conf_opt.h”中的默认配置)
代码编译和镜像创建
[color=rgba(0, 0, 0, 0.87)]代码编译前需要在“gcc.mk”中设置正确的GCC 交叉编译工具链路径,例如:
code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;">CC_DIR = ~/tools/gcc-arm-none-eabi-8-2019-q3-update/bin
[color=rgba(0, 0, 0, 0.87)]所有代码编译和镜像创建命令均需在Linux 终端执行,在顶层目录编译。
  • 先copy 一份配置作为默认配置。例如:
code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;">cp project/demo/hello_demo/gcc/defconfig .config code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;">make PRJ=demo/hello_demo defconfig
[color=rgba(0, 0, 0, 0.87)][color=var(--md-typeset-a-color)]
应用示例
[color=rgba(0, 0, 0, 0.87)]对“hello_demo”工程进行代码编译和镜像创建的常规过程,举例如下:
code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;"># 复制默认配置文件到顶层目录(不切换工程可不要此步骤)$ cp project/demo/hello_demo/gcc/defconfig .config 或make PRJ=demo/hello_demo defconfig# 检查SDK 基础配置,如工程名、芯片型号、高频晶振、板级配置是否正确$ make menuconfig# 清理,切换工程时需要$ make build_clean# 编译代码并生成镜像文件,生成的镜像文件为“out/xr_system.img”$ make build(建议使用make build -j 加速编译)
[color=rgba(0, 0, 0, 0.87)]编译bootloader 的过程如下:
code" style="box-sizing: inherit; -webkit-tap-highlight-color: transparent; font-size: inherit; font-family: inherit; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial; border-width: 0px; border-style: initial; border-color: initial; position: absolute; top: 0.5em; right: 0.5em; z-index: 1; width: 1.5em; height: 1.5em; border-radius: 0.1rem; outline: none; outline-offset: 0.1rem; cursor: pointer; transition: color 0.25s ease 0s;"># 复制默认配置文件到顶层目录$ cp project/bootloader/gcc/defconfig .config 或make PRJ=bootloader defconfig# 检查SDK 基础配置,如工程名、芯片型号、高频晶振、板级配置是否正确$ make menuconfig# 清理,切换工程时需要$ make build_clean# 编译代码并生成镜像文件,默认晶振是40M,生成的镜像文件为#“bin/xradio_v3/boot/xr806/boot_40M.bin”$ make build(建议使用make build -j 加速编译)

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

190

主题

198

帖子

0

粉丝