steami: Add config zone in F103 internal flash gap#4
Conversation
Add WRITE_CONFIG (0x30), READ_CONFIG (0x31) and CLEAR_CONFIG (0x32) I2C commands that read/write a 1 KB config zone in the bootloader/IF gap at 0x0800BC00. This area survives firmware updates and clear_flash operations, suitable for board revision, name, and sensor calibration data.
There was a problem hiding this comment.
Pull request overview
Adds an internal-flash “config zone” for the STeaMi STM32F103 interface firmware and exposes it over the existing I2C command protocol, using the 1KB BL/IF gap at 0x0800BC00.
Changes:
- Introduces a new internal-flash config driver (
steami_config_*) to read/write/erase a 1KB page. - Adds three new I2C commands (WRITE_CONFIG/READ_CONFIG/CLEAR_CONFIG) to the command enum, validation, and argument sizing.
- Implements new task handlers and updates the I2C command documentation in
steami32.c.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| source/board/steami/steami_i2c.h | Adds new I2C command IDs for config operations. |
| source/board/steami/steami_i2c.c | Registers new commands as valid and defines their fixed argument lengths. |
| source/board/steami/steami_config.h | Defines config zone address/size and the public read/write/erase API. |
| source/board/steami/steami_config.c | Implements internal flash read-modify-write and page erase for the config zone. |
| source/board/steami/steami32.c | Wires new commands into the command handler/task loop and documents them. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Document WRITE_CONFIG fixed 31-byte payload in command table. - Reject WRITE_CONFIG when data_len exceeds payload (bad_parameter). - Derive config zone address/size from daplink_addr.h macros. - Add compile-time assert to prevent config/IF overlap.
|
All 4 review comments addressed in 9bc76dd:
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9bc76ddd02
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Fixed in 76ace49. Replaced |
Summary
Closes #2
Adds 3 new I2C commands to read/write a 1 KB config zone stored in the STM32F103 internal flash (gap between bootloader and interface firmware at
0x0800BC00).0x300x310x32Key properties
clear_flash: data file erase does not affect the config zonememcpyFiles changed
steami_config.c/.h— new: internal flash config zone driversteami_i2c.c/.h— register new commands inis_command_valid()andget_argument_byte_number()steami32.c— add task handlers and I2C command documentationUse cases
Test plan