Files
ai-passport/docs/reference/shinku-chen/release-artifact-verification.md
T
Shinku fd061e9ab2 docs(reference): add Connect Four post-release notes and archive
The Connect Four release on the fork's feature branch produced four reusable
notes and one application archive, all under docs/reference/shinku-chen/:

- two-device-ble-link: symmetric peer discovery with an address tiebreak
  instead of a host/join choice, the measured heap cost of the link on a part
  without PSRAM and its collision with a static screenshot buffer, two NimBLE
  traps that compile cleanly and only fail on hardware, the NVS requirement
  behind RF calibration caching, and the stop-and-wait layer a turn-based
  application needs.
- landscape-rotation-and-deep-sleep-key-wake: rotating a portrait panel into a
  320 x 240 landscape screen through LVGL, why the corner mask must follow the
  logical resolution, and how an ADC-owned pin makes a low-level deep-sleep
  wake fire at sleep entry.
- on-device-game-ai-wall-clock-budget: why node-count limits misfire on this
  board (about 15k nodes per second), iterative deepening against a time
  budget, yielding to keep the idle task fed, and difficulty as a blunder rate.
- release-artifact-verification: sizing a static buffer from the panel rather
  than guessing, reading the startup log of the published merged image, and
  replacing a release that shipped wrong rather than following it up.
- connect-four: the functional summary of the published application.

Both language versions are added together and the reference index lists all
five entries. Documentation only: no code, configuration, partition table, or
repository rule is touched, and the runtime two-device BLE transport this work
informed is split into its own change.
2026-09-20 10:50:10 +08:00

2.5 KiB
Raw Blame History

简体中文 · English

Size Static Buffers from the Panel, and Verify the Release Artifact

Collected after releasing Connect Four, where the first published firmware booted with only 8 KB of free heap and had to be rebuilt before the community submission.

A convenient constant can cost 50 KB

The release adds a serial screenshot command (FAP_SCREENSHOT_V1) whose frame buffer must be reserved statically: with LVGL, the codec and the DMA buffers already running, the heap cannot produce a 150 KB contiguous block. The buffer was declared as "the largest of the two orientations" — 320 × 320 pixels, 204,800 bytes — while one frame is exactly the panel's pixel count: 240 × 320 = 153,600 bytes, the same in portrait and landscape.

The extra 51 KB does not show up in a flash-size report, and it is not a build error. On the device the free heap fell from 227 KB to 8.3 KB with a largest block of 7.7 KB, which happens to still boot and play, so nothing fails loudly. Derive such buffers from the panel geometry (BSP_LCD_W * BSP_LCD_H * 2) instead of from a round number, and give the feature a compile-time switch so a build can hand the RAM back.

Flash the artifact you published, and read the boot log

The workflow already says to verify a release on hardware; the practical version of that is: download the released merged image, flash it from offset 0, and read the startup log for the numbers that matter — logical resolution, task readiness, and free heap. That check caught the buffer mistake in minutes.

Reproducing the issue locally also required flashing the same artifact rather than a local build, because the two differ: the CI build produced different bytes for the same source. A fix verified only in a local build would not have proven anything about what users download.

When a just-published release turns out to be wrong and nothing has consumed it yet, replacing it — deleting the release and the tag, moving the tag to the fixed commit, and letting the tag-triggered build republish — is cleaner than shipping a follow-up version that only fixes a mistake nobody could see.

The screenshot command is also the cover pipeline

With that command in place, a release cover can show the device's real frame instead of a redrawn mock-up: capture the frame over serial, composite it into the brand shell, and place the result in a scene. The cover is then publish metadata — recorded by file name and format — and does not need to be committed.