Repository navigation
Add experimental internal Flash Blackbox for AT32F435CMU7 - #2
FlyingRC-Official wants to merge 1 commit into
Conversation
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e35f7faa6d
ℹ️ 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".
| command = [os.environ.get("CC", "cc"), "-std=c99", "-D_DARWIN_C_SOURCE", "-D_DEFAULT_SOURCE", | ||
| "-Wall", "-Wextra", "-Werror", "-fsanitize=undefined", | ||
| "-I" + str(here / "stubs"), "-I" + str(here.parents[1] / "main"), | ||
| str(here / source), "-o", str(binary)] + defines |
There was a problem hiding this comment.
Compile the mapped-address harness without PIE
On Linux distributions where cc builds PIE executables by default, python3 src/test/at32_internal_flash/run_tests.py aborts immediately in resetVolume() because references to the absolute assembler symbols __flashlog_start and __flashlog_end are emitted relative to the executable load address, so at32InternalFlashInit() rejects the layout. The non-PIE flags are currently added only on Darwin; add the appropriate compile and link flags (for example -fno-pie and -no-pie) on Linux as well so the newly documented host test can execute.
Useful? React with 👍 / 👎.
| } | ||
|
|
||
| cliPrintLine("Done."); | ||
| cliPrintLine(flashGetGeometry()->totalSize ? "Done." : "Flash erase failed; reboot required."); |
There was a problem hiding this comment.
Report an armed erase refusal instead of success
If the CLI is entered while the controller is still armed, the internal backend returns from flashfsEraseCompletely() without erasing anything, but its geometry remains valid, so this expression prints Done.. cliEnter() only sets ARMING_DISABLED_CLI and does not clear ARMED, making this path reachable and leaving the user believing the logs were erased; check the armed state before starting the command or propagate an erase result instead of inferring success from capacity.
Useful? React with 👍 / 👎.
|
RAM / Flash usage vs. base branch — commit
See RAM/flash optimization guide for techniques to reduce usage. |
CMU7 boards without external Flash currently have no onboard Blackbox storage. This adds an opt-in
FLYINGRCF435WINGMINI_CMU7_FLASHtarget that reserves Bank 2 as a 1,984 KiB NOR log volume and reuses the existing FlashFS, Blackbox and download interfaces. Firmware, configuration and extended defaults remain in Bank 1.The backend checks chip capacity, boot selection and linker boundaries, validates erased destinations and write readback, and stops logging on errors. FlashFS now accounts for short writes correctly and preserves its cursor when internal erase is refused or fails. Erase is restricted to disarmed operation; existing external NOR/NAND asynchronous erase behavior is preserved. The FlyingRC CGU7/CMU7 board definitions are imported from the hardware branch without merging its unrelated changes.
Validation
FLYINGRCF435WINGMINI_CMU7_FLASH,FLYINGRCF435WINGMINI_CMU7,FLYINGRCF435WINGMINI,NEUTRONRCF435MINIandBETAFPVF435with GCC 13.2.1.Hardware status
Draft pending bench validation. Real-chip programming behavior, control-loop timing, log download and power-loss recovery have not been tested. Writes and erase are synchronous; full erase is estimated at approximately 22 seconds typical and 198 seconds at the datasheet sector-time maximum. Flight readiness is not established.
Research, implementation details and bench procedure:
docs/development/at32-internal-blackbox.md.This PR contains one commit.