fix: harden demo lifecycle, BSP rollback, and flash layout
This commit is contained in:
1 parent
7b85c4a129
commit
0b6aed856a
42 files changed
+1079
-351
No files matched your search
@@ -9,8 +9,10 @@ This file is the only mandatory entry point for AI-assisted work in this reposit
|
||||
## Project and safety baseline
|
||||
|
||||
- Target: ESP32-C3, 8 MB Flash, no PSRAM, ESP-IDF 5.5.3.
|
||||
- Preserve the protected Flash layout: the 3 MB application limit and `cardid`
|
||||
at `0x356000` are mandatory template contracts.
|
||||
- Keep the repository's default partition table minimal: NVS, PHY data, and
|
||||
one factory application spanning the rest of the 8 MB Flash. User firmware
|
||||
may deliberately change this layout; validate the resulting table and do not
|
||||
turn product-specific partitions into mandatory template contracts.
|
||||
- Preserve existing user changes. Start with `git status --short --branch`; never overwrite or clean unrelated files.
|
||||
- Hardware facts follow this priority: product specifications and measured results → `components/bsp/include/bsp_pins.h` → BSP headers and implementation → hardware guide → README/demo code. If a task requires a hardware detail not defined by these sources, ask the user instead of guessing.
|
||||
- Reusable board logic belongs in `components/bsp`; pages, state machines, animations, and application tasks belong in `main`.
|
||||
@@ -29,7 +31,7 @@ This file is the only mandatory entry point for AI-assisted work in this reposit
|
||||
| Environment bootstrap or missing toolchain | `docs/development/engineering/environment-setup.md` |
|
||||
| BSP, pins, buses, display, audio, battery | `docs/hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.md`, `components/bsp/include/bsp_pins.h` |
|
||||
| Demo or menu | `main/demo.h`, `main/main.c`, the nearest `main/demo_*.c` implementation |
|
||||
| Build, test, dependencies, partitions | `docs/development/engineering/build-and-test.md`, `docs/development/engineering/protected-flash-layout.md`, `sdkconfig.defaults`, `partitions.csv` |
|
||||
| Build, test, dependencies, partitions | `docs/development/engineering/build-and-test.md`, `docs/development/engineering/firmware-layout.md`, `sdkconfig.defaults`, `partitions.csv` |
|
||||
| CI or release | the matching file in `docs/development/ci/CI-*.md` and `.github/workflows/` |
|
||||
| Project completion | `docs/development/release/project-completion.md` (then the `issue-suggestions` or `experience-pr` skill) |
|
||||
| Documentation | `docs/contribution/doc-conventions.md`, `docs/README.md` |
|
||||
|
||||
+4
-3
@@ -9,8 +9,9 @@
|
||||
## 项目与安全基线
|
||||
|
||||
- 目标平台:ESP32-C3、8 MB Flash、无 PSRAM、ESP-IDF 5.5.3。
|
||||
- 必须保持受保护的 Flash 布局:3 MB 应用上限与 `cardid@0x356000`
|
||||
均为模板强制契约。
|
||||
- 仓库默认分区表保持最简:只包含 NVS、PHY data,以及占用 8 MB Flash
|
||||
剩余空间的单个 factory app。用户固件可以按需求明确调整布局;修改后必须
|
||||
验证结果,不得把产品专用分区变成模板的强制契约。
|
||||
- 保留用户已有修改。先执行 `git status --short --branch`,不得覆盖或清理无关文件。
|
||||
- 硬件事实优先级:产品规格与实测结果 → `components/bsp/include/bsp_pins.h` → BSP 头文件与实现 → 硬件指南 → README/demo。任务所需硬件细节未在这些来源中定义时,直接询问用户,不得猜测。
|
||||
- 可复用板级逻辑放入 `components/bsp`;页面、状态机、动画和应用任务放入 `main`。
|
||||
@@ -29,7 +30,7 @@
|
||||
| 环境引导或缺少工具链 | `docs/development/engineering/environment-setup.zh_CN.md` |
|
||||
| BSP、引脚、总线、显示、音频、电池 | `docs/hardware-design/AI_HARDWARE_DEVELOPMENT_GUIDE.zh_CN.md`、`components/bsp/include/bsp_pins.h` |
|
||||
| Demo 或菜单 | `main/demo.h`、`main/main.c`、最近的 `main/demo_*.c` 实现 |
|
||||
| 构建、测试、依赖、分区 | `docs/development/engineering/build-and-test.zh_CN.md`、`docs/development/engineering/protected-flash-layout.zh_CN.md`、`sdkconfig.defaults`、`partitions.csv` |
|
||||
| 构建、测试、依赖、分区 | `docs/development/engineering/build-and-test.zh_CN.md`、`docs/development/engineering/firmware-layout.zh_CN.md`、`sdkconfig.defaults`、`partitions.csv` |
|
||||
| CI 或发布 | `docs/development/ci/CI-*.zh_CN.md` 中的对应文件与 `.github/workflows/` |
|
||||
| 项目开发完成 | `docs/development/release/project-completion.zh_CN.md`(再进入 `issue-suggestions` 或 `experience-pr` skill) |
|
||||
| 文档 | `docs/contribution/doc-conventions.zh_CN.md`、`docs/README.zh_CN.md` |
|
||||
|
||||
@@ -6,7 +6,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
// 初始化 codec 与 I2S。内部会调 bsp_i2c_init()(幂等),无需外部先调。
|
||||
// 初始化 codec 与 I2S。内部会调 bsp_i2c_init()(幂等),无需外部先调。成功调用可重复;
|
||||
// 失败会释放本次已创建的 codec 接口和 I2S channel,修正故障后可重试。
|
||||
esp_err_t bsp_audio_init(void);
|
||||
|
||||
// 设置采样格式。同格式重复调用是廉价的(直接复用已打开的 codec)。
|
||||
|
||||
Loaded 3 of 42 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user