Repository navigation
Firmware SAL: the banks (count, running bank, info, verify, select) - #343
Merged
Merged
Conversation
A tool that updates a platform with firmware banks (A and B) has to ask the platform which bank runs, what is in the others, whether an image that it has written is good, and to choose the bank for the next start; the platform's boot loader is the only one that knows. Added to the firmware group, beside Dmod_FirmwareReady and the persistency: * Dmod_FirmwareGetBankCount, Dmod_FirmwareGetRunningBank * Dmod_FirmwareGetBankInfo (state, version, size, address, capacity; StructSize in the structure lets it grow without a new function) * Dmod_FirmwareVerifyBank (the platform verifies the image the way it does before a start) * Dmod_FirmwareSelectBank(Bank, Trial): on trial it stays only if it confirms with Dmod_FirmwareReady, otherwise the platform falls back The writing of an image stays with the flash driver. Default (weak) implementations return -ENOSYS. Together with the earlier firmware SAL this is the whole interface, so that the image of the tools has to be built once more only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
JohnAmadis
approved these changes
Oct 28, 2026
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.
What
The banks in the firmware SAL (#341 added
Dmod_FirmwareReadyand the persistency):int Dmod_FirmwareGetBankCount(void),int Dmod_FirmwareGetRunningBank(void)int Dmod_FirmwareGetBankInfo(int Bank, Dmod_FirmwareBankInfo_t* Info)– state (Empty/Invalid/Valid/Trial/Confirmed), version, size, tries, address, capacity;StructSizemakes the structure extensibleint Dmod_FirmwareVerifyBank(int Bank)– the platform verifies the image the way it does before a startint Dmod_FirmwareSelectBank(int Bank, bool Trial)– the bank for the next start; on trial it stays only if it callsDmod_FirmwareReady()A module that updates the firmware (writes an image with the flash driver, verifies, selects,
Dmod_Reboot()) needs these and only the platform can answer them. Defaults (weak):-ENOSYS. Layout of the structure is fixed (40 bytes, no padding) and tested.Merging this is what makes the next rebuild of the
chocotechnologies/dmodimage the last one for the dual-bank work.🤖 Generated with Claude Code