Files
obsidian-note/README.md
2026-05-21 18:18:26 +08:00

139 lines
4.2 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 姿态传感器
## 开发环境
* Python
* [OpenOCD](https://pan.7iwind.cn/directlink/pan/工具/xpack-openocd-0.12.0-7-win32-x64.zip)
* [CLion](https://www.jetbrains.com/clion/download/?section=windows)
* [arm-none-eabi-gcc](https://developer.arm.com/-/media/Files/downloads/gnu/15.2.rel1/binrel/arm-gnu-toolchain-15.2.rel1-mingw-w64-x86_64-arm-none-eabi.msi)
* [protoc-nanopb](https://pan.7iwind.cn/directlink/pan/工具/protoc-nanopb.zip)
## 环境配置说明
1. 下载所有运行条件中提到的文件
2. 解压OpenOCD至可找到的文件夹
3. 解压protoc-nanopb并解压至可找到的文件夹添加其内的bin路径到环境变量
4. 安装CLion
5. 安装arm-none-eabi-gcc一路下一步即可可自定义安装路径安装成功后将bin目录添加至环境变量
6. 打开powershell执行`pip install uv`
## CLion烧录及调试配置
1. 用CLion打开项目路径
2. 在弹出的窗口勾选CM4与CM7的启用预设![[step1.gif|447]]
3. 点击确定开始生成CMake构建缓存![[gif20260514054158.gif|513]]
4. 配置CLion的openocd路径为解压openocd路径下bin文件夹里openocd.exe可执行文件的路径![[gif20260514054645.gif|613]]
5. 添加CLion的openocd烧录目标![[gif20260514055249.gif]]
6. 点击上方绿色三角箭头即可烧录固件到目标板
## 技术架构
```mermaid
flowchart TB
subgraph App["用户程序层 src/"]
direction LR
CM7["CM7 导航应用\nmain.c"]
CM4["CM4 采集应用\nmain_CM4.c"]
AppSupport["应用支撑\nshell / banner / time_base / elog_port"]
end
subgraph Service["业务功能层"]
direction LR
LCFSM["组合导航状态机\nlc_fsm"]
SensorTask["传感器采集任务\nIMU / GNSS"]
ProtoApp["消息协议适配\nproto"]
LogApp["日志与命令行适配"]
end
subgraph Domain["功能模块层"]
direction LR
subgraph Nav["loosely_coupled_navigation"]
direction TB
LC["LooselyCoupled"]
Align["Alignment / Attitude"]
INS["INS / Mechanization"]
EKF["EKF"]
EarthMath["Earth / Math"]
end
subgraph Sensors["sensors"]
direction TB
IMU["IMU 统一接口"]
IMUDriver["ADIS16488 / STIM300 / SCH1633"]
GNSS["GNSS 统一接口"]
GNSSDriver["K922 / libnmea"]
end
subgraph Proto["proto"]
direction TB
ProtoFile["V0_0_1.proto"]
NanoPB["nanopb 生成代码"]
end
end
subgraph BSP["BSP 模块 bsp/"]
direction TB
subgraph BspService["BSP 服务接口层"]
direction LR
OpenAMP["OpenAMP"]
Stream["STREAM"]
SPI["SPI"]
Timer["TIMER"]
Exti["EXTI"]
Enter["ENTER"]
end
subgraph BspBase["BSP 基础抽象层"]
direction LR
IO["IO"]
RCC["RCC"]
DMA["DMA"]
Resource["OpenAMP Resource"]
end
subgraph BspPort["STM32H7xx Port 层"]
direction LR
StreamPort["stream_port / stream_uart_port"]
IOPort["io_port"]
SPIPort["spi_port"]
TimerPort["timer_port / time_base_port"]
ExtiPort["exti_port"]
OpenAMPPort["openamp_port"]
RCCPort["rcc_port"]
DMAPort["dma_port"]
end
subgraph Chip["芯片启动与片上资源层"]
direction LR
ChipInit["init_CM4 / init_CM7"]
IT["stm32h7xx_it"]
Memory["MPU / SDRAM / sysmem / syscalls"]
HAL["STM32H7xx HAL / CMSIS"]
end
end
subgraph Lib["第三方与公共库"]
direction LR
ThreadX["ThreadX"]
CMSISDSP["CMSIS-DSP"]
Metal["libmetal / open_amp"]
LwRB["lwrb"]
ShellLib["microshell"]
EasyLogger["easylogger"]
QF["qf-fsm"]
end
App --- Service
Service --- Domain
Domain --- BSP
BSP --- Lib
```
## 协作者
> 高效的协作会激发无尽的创造力,将他们的名字记录在这里吧
## 协作者
> 高效的协作会激发无尽的创造力,将他们的名字记录在这里吧