BL602: add BL602PartitionInfo and BL602RepartitionPSM console commands#2151
Open
kruzer wants to merge 1 commit into
Open
BL602: add BL602PartitionInfo and BL602RepartitionPSM console commands#2151kruzer wants to merge 1 commit into
kruzer wants to merge 1 commit into
Conversation
Adds two console commands (registered only on the classic BL602 SDK path, not PLATFORM_BL_NEW): - BL602PartitionInfo: reads the flash JEDEC id and parses the partition table, printing a human-readable summary of entries, sizes and the active table (read-only diagnostics). - BL602RepartitionPSM: rewrites the PSM partition entry (erases and updates the partition table via the SDK PtTable API) so the config partition can be relocated/resized. Verifies the target address/size before committing. Motivation: CozyLife-based BL602 devices (1 MB flash) ship with a PSM (EasyFlash config) partition of only 8 KB. That is too small for OpenBeken to reliably persist its configuration, so config saves fail on those devices. BL602RepartitionPSM lets you relocate/enlarge the PSM partition from the console to give OpenBeken enough room to store its config, without reflashing the whole device. Useful for diagnosing and fixing flash layout differences between BL602 board variants from the device console.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds two console commands, registered only on the classic BL602 SDK path (not
PLATFORM_BL_NEW):BL602PartitionInfo— reads the flash JEDEC id and parses the partition table, printing a human-readable summary of entries, sizes and the active table (read-only diagnostics).BL602RepartitionPSM— rewrites the PSM partition entry (erases and updates the partition table via the SDKPtTableAPI) so the config partition can be relocated/resized. Verifies the target address/size before committing.Motivation
CozyLife-based BL602 devices (1 MB flash) ship with a PSM (EasyFlash config) partition of only 8 KB. That is too small for OpenBeken to reliably persist its configuration, so config saves fail on those devices.
BL602RepartitionPSMlets you relocate/enlarge the PSM partition from the console to give OpenBeken enough room to store its config, without reflashing the whole device.BL602PartitionInfois also handy for diagnosing flash layout differences between BL602 board variants directly from the device console.Files
src/hal/bl602/hal_partition_bl602.c— command implementationssrc/cmnds/cmd_main.c— registration inCMD_Init_Early()Test plan
make OpenBL602(canonical build)BL602PartitionInfoprints correct partition summary on a dev board and a CozyLife 1 MB deviceBL602RepartitionPSMenlarges PSM on a CozyLife 1 MB device and OpenBeken then persists config across rebootsNote for reviewers
BL602RepartitionPSMerases and rewrites the partition table. It verifies the target address/size before committing, but it is inherently a destructive flash operation — happy to split it into a separate PR (info-only vs. repartition) if preferred.