Conversation
* pvstore detached from values, can be used with any value * vaddr helper to get RAM address from a value * pvto testing helper * QEM target for lm mcu as it doesn't allow writing to flash
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.
Implements #7
Heart of the implementation is in
core/pvalue.s(andcore/amforth32.ld). Two main API pointspv.store ( x xt -- )updates pvalue identified by its XT with value x. This is what needs to be used to update pvalues; deliberately using XT to make it easy to use in ITC.pv.initneeds to run in WARM after the normal value initialization, it replays the pvalue records to set the pvalues to the latest know stateThe rest happens automatically although it may be sometimes useful to run
pvarena.swapexplicitly, which is fine. If the MCU is reset during the swap, it is implemented to be safe to rerun as many times as needed until it succeeds. No persistent state should be lost in any circumstance.The framework relies on few primitves for modifying and reading the flash
The 2) is probably unnecessary, since it's unlikely to be anything but regular fetch but is there for now for balance
Quick summary of the rest of the changes:
pvarena1/2linker sections that require each MCU to definePVFLASHmemory region.LENGTH(PVFLASH)to 0 effectively dissables persistency of pvaluesPVFLASH_PAGEmust be defined, it is needed for erasing the PVFLASH arenas (pvflash.erase)PVALUEmacro, likeVALUEbut sets newflag.pvalue, new wordpv.dohelps iterating over all pvalues in forth-worldlisttests/pvalue.frttests the basic pvalue operations (QEMU faux PVFLASH only), included in CI teststoword now duplicatesisfunctionalitybuild/amforth.mapfor the linker mapbuild/amforth.lst, it was redundant and made the file hard to useTARGETS, with differentPVFLASHconfigurations:lm3slm4fTODO