Files
chrg/docs/debug/apps-chrg-baseline.md

109 lines
4.5 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.
# apps/chrg 长期运行修复基线
## 记录信息
- 记录时间:2026-07-18 15:53:36 +08:00
- 当前分支:`feature`
- 当前 HEAD`5ffc85077ee7c4ebd52178021d9ac99eed223cd6`
- 业务改动检查点:`c820aad feat: 完成项目多模块功能迭代与配置更新`
- 检查点说明:`c820aad` 包含当前 `apps/chrg` 多模块业务改动;后续 `5ffc850` 仅新增仓库 README 和死锁修复计划。当前 `apps/chrg` 相对 HEAD 无未提交差异。
- 保留的无关工作区文件:`docs/修改计划.md` 为未跟踪文件,本任务未修改、暂存或清理该文件。
## Git 工作区基线
执行命令:
```powershell
git status --short --branch
```
输出:
```text
## feature
?? "docs/\344\277\256\346\224\271\350\256\241\345\210\222.md"
```
执行命令:
```powershell
git diff --ignore-space-at-eol --stat -- apps/chrg
```
输出:无输出,表示 `apps/chrg` 相对当前 HEAD 没有未提交差异。
执行命令:
```powershell
git log -5 --oneline --decorate
```
输出:
```text
5ffc850 (HEAD -> feature) docs: 初始化HCDF MID 405充放电控制器固件仓库
c820aad feat: 完成项目多模块功能迭代与配置更新
250864c (origin/feature) debug north
3a413f5 (origin/master, origin/HEAD, master, agents/add-comments-to-sinkc) nor / sou roll
7e463e5 add more comments
```
## 修复前构建
执行命令:
```powershell
scons -C apps/chrg -j4
```
结果:**失败,构建环境缺失。**
```text
scons : 无法将“scons”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。
CategoryInfo : ObjectNotFound: (scons:String) [], CommandNotFoundException
FullyQualifiedErrorId : CommandNotFoundException
```
环境复核结果:
- `scons`:无法取得,未安装或未加入 `PATH`
- Python:系统 `PATH` 中无法取得;Codex 自带 Python 可运行,但未安装 `SCons` 模块。
- `arm-none-eabi-gcc`:无法取得,未安装或未加入 `PATH`
- Keil UV4:常用路径 `C:\Keil_v5\UV4\UV4.exe` 及检查的常见安装目录中未找到。
- 既有输出:未找到可复用的 `chrg.elf``rtthread.bin``chrg.axf`
- text/data/bss:无法取得,原因是构建未启动。
- 镜像大小:无法取得,原因是未生成镜像。
- 编译 warning:无法取得,原因是编译器未运行。
结论:Task 1 的修复前构建验收尚未通过。在具备 SCons 与 Arm GCC 或 Keil MDK 的构建机上补跑同一命令并补录产物尺寸、段大小和全部 warning 前,不应开始功能修改。
## 故障现场 Shell 快照
当前会话只有离线源码工作区,没有连接发生故障的 STM32F405 设备、串口或 USB Shell,因此不能执行板上命令。以下项目均显式记录为无法取得,避免将“未采集”误认为正常状态。
| 命令 | 结果 |
| --- | --- |
| `list_thread` | 无法取得:当前未连接目标板 Shell,线程状态和栈使用量未知。 |
| `list_mutex` | 无法取得:当前未连接目标板 Shellmutex owner/suspend 未采集。 |
| `list_mailbox` | 无法取得:当前未连接目标板 Shell,邮箱 entry 数未采集。 |
| `list_event` | 无法取得:当前未连接目标板 Shell,事件状态未采集。 |
| `free` | 无法取得:当前未连接目标板 Shellheap total/used/max-used 未采集。 |
| `list_device` | 无法取得:当前未连接目标板 Shell,设备状态未采集。 |
## 故障特征
- 首次异常运行时长:无法取得:未提供对应现场运行记录。
- 异常时仍工作的接口:无法取得:当前没有现场设备或故障时间点数据。
- 最后 100 行日志:无法取得:仓库中未提供本次故障对应的运行日志,当前未连接目标板。
- `com batch timeout` 是否连续出现:无法取得:没有现场串口日志。
- `free` 的 total/used/max-used:无法取得:当前未连接目标板 Shell。
- `thr.rollnor``thr.rollsou` 状态:无法取得:当前未连接目标板 Shell。
- `thr.nor``thr.sou` 状态:无法取得:当前未连接目标板 Shell。
- 最近一次复位原因:无法取得:没有启动日志或 RCC 复位标志快照。
## 后续补录要求
1. 在配置完整的构建机上重新执行 `scons -C apps/chrg -j4`,补录工具链版本、text/data/bss、镜像大小和 warning。
2. 下次现场复现且 Shell 尚可用时,立即按上述顺序保存六条诊断命令的原始输出和最后 100 行日志。
3. 所有后续修复必须基于 `c820aad` 已包含的业务逻辑和当前 HEAD,不得从 `origin/feature``master` 重新开始。