aboutsummaryrefslogtreecommitdiff
path: root/embassy-boot/boot/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Assert active and dfu have same erase size and copy in smaller chunksRasmus Melchior Jacobsen2023-04-044-57/+118
| | | | | | | | | | | | | | | | | | | | The copy from active to dfu (and vice versa) is now done in smaller portions depending on aligned_buf, which now does not need to be erase_size big.
| * | | | Remove magic buffer argument from prepare_bootRasmus Melchior Jacobsen2023-04-042-78/+78
| | |_|/ | |/| | | | | | | | | | and use the aligned page buffer instead
| | | |
| | \ \
| *-. \ \ Merge #1324 #1327bors[bot]2023-04-045-163/+247
| |\ \ \ \ | | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1324: Add MCO support for L4 and F4 families r=Dirbaio a=m-dupont Add MCO support for L4 and F4 as already done in F7. When the 'HSI' source is selected as MCO source, 'HSI' is activated (`set_hsion(true)`) . This is done to operate the MCO in case 'MSI' is chosen as the clock source for the CPU. The same applies to PLL, etc. 1327: Avoid write before erase r=Dirbaio a=rmja This introduces an additional marker to the state partition right after the magic which indicates whether the current progress is valid or not. Validation in tests that we never write without an erase is added. There is currently a FIXME in the FirmwareUpdater. Let me know if we should take the erase value as a parameter. I opened a feature request in embedded-storage to get this value in the trait. Before this, the assumption about ERASE_VALUE=0xFF was the same. I have made some thoughts about whether this is a breaking change between the app and firmware, i.e. whether adding the "Progress valid" field is breaking. My conclusion is that it is not a breaking change. For the case where an app uses this new FirmwareUpdater together with an old bootloader, what it now does, is that it: 1. Writes the progress valid field to all zeros. This field is not known in the old bootloader, so it actually writes a "current progress" index. 2. The entire state partition is erased - effectively removing any trace of 1. 3. Set magic This should be compatible. Co-authored-by: Mathieu Dupont <[email protected]> Co-authored-by: Rasmus Melchior Jacobsen <[email protected]>
| | | * | Fix compile error when verification is enabledRasmus Melchior Jacobsen2023-04-041-2/+2
| | | | |
| | | * | Merge remote-tracking branch 'upstream/master' into avoid-write-before-eraseRasmus Melchior Jacobsen2023-04-043-76/+12
| | | |\|
| | | * | Avoid write to not-erased magicRasmus Melchior Jacobsen2023-04-044-81/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces an additional marker to the state partition right after the magic which indicates whether the current progress is valid or not. Validation in tests that we never write without an erase is added. There is currently a FIXME in the FirmwareUpdater. Let me know if we should take the erase value as a parameter. I opened a feature request in embedded-storage to get this value in the trait. Before this, the assumption about ERASE_VALUE=0xFF was the same.
| | | * | Move MemFlash to separate module and add verify_erased_before_write verificationRasmus Melchior Jacobsen2023-04-033-142/+244
| | |/ /
| * | / Expose read/write/erase on partitionRasmus Melchior Jacobsen2023-04-041-16/+6
| | |/ | |/|
| * | Remove FirmwareWriterRasmus Melchior Jacobsen2023-04-033-76/+12
| |/ | | | | | | FirmwareWriter currently has a "max-write-size" parameter, but this is a limitation that should be handled by chunking inside the NorFlash driver, and not "up here" in user code. In case that the driver (e.g. qspi driver) is unaware of any max-write limitations, one could simply add an intermediate NorFlash adapter providing the chunk'ing capability.
| * Add erase and wipe testsRasmus Melchior Jacobsen2023-03-312-1/+48
| |
| * Let bootloader partition have read/write/erase operationsRasmus Melchior Jacobsen2023-03-314-223/+195
| | | | | | | | This change should not have any breaking changes.
| * Split bootloader implementation into multiple filesRasmus Melchior Jacobsen2023-03-315-1171/+1194
| |
* | embassy-boot: add default nightly feature, makes it possible to compile with ↵sander2023-03-221-1/+10
|/ | | | the stable compiler
* Merge branch 'emb-storage-async-0p4' of https://github.com/Grus-BV/embassy ↵Mehmet Ali Anil2023-03-071-3/+4
|\ | | | | | | into emb-storage-async-0p4
* \ Merge branch 'emb-storage-async-0p4' of https://github.com/Grus-BV/embassy ↵Mehmet Ali Anil2023-03-071-1/+1
|\ \ | |/ |/| | | into emb-storage-async-0p4
* | Merge upstreamMehmet Ali Anil2023-03-071-35/+25
|\ \ | |/ |/|
* | Bump embedded-storage-async to 0.4Mehmet Ali Anil2023-03-061-2/+2
|/
* Support codesigning in the firmware updaterhuntc2023-01-121-14/+353
| | | | This commit provides a method to verify that firmware has been signed with a private key given its public key. The implementation uses ed25519-dalek as the signature verifier. An "ed25519" feature is required to enable the functionality. When disabled (the default), calling the firmware updater's verify method will return a failure.
* fix: add required metadata for embassy-bootUlf Lilleengen2022-11-251-1/+1
|
* Fix ascii table in BootLoader doc commentDaniel Bevenius2022-10-291-1/+1
| | | | Signed-off-by: Daniel Bevenius <[email protected]>
* make prepare_update asyncMathias2022-09-261-2/+2
|
* Add get_state helpers to allow self-testing before calling mark_bootedMathias2022-09-261-13/+43
|
* Add blocking API to FirmwareUpdater, and allow for a split prepare/write apiMathias2022-09-261-7/+179
|
* Update Rust nightly.Dario Nieuwenhuis2022-09-221-1/+0
| | | | Removes feature(generic_associated_types)
* Take into account size of revert indexUlf Lilleengen2022-09-201-4/+17
| | | | | | | Fixes a bug in the partition assertions that ensures that the state page(s) have enough space for 2x active partition range. Add unit test to verify that panic is observed.
* Remove BootFlash borrowUlf Lilleengen2022-09-201-12/+12
| | | | | | | Compiler will infer a different lifetime for BootFlash than for the borrowed flash, which makes it require more type annotations than if it was just owning the type. Since it doesn't really matter if it owns or borrows in practical use, change it to own so that it simplifies usage.
* Fix a few clippy warningsUlf Lilleengen2022-09-021-25/+23
|
* Remove generic const expressions from embassy-bootUlf Lilleengen2022-09-021-232/+312
| | | | | | | | | * Remove the need for generic const expressions and use buffers provided in the flash config. * Extend embedded-storage traits to simplify generics. * Document all public APIs * Add toplevel README * Expose AlignedBuffer type for convenience. * Update examples
* simplify `set_magic`Vincent Stakenburg2022-06-301-13/+4
|
* Run rustfmt.Dario Nieuwenhuis2022-06-121-41/+15
|
* Allow using separate page sizes for state and dfuUlf Lilleengen2022-04-281-66/+278
| | | | | | | * Less generics on bootloader. Keep PAGE_SIZE as a common multiple of DFU and ACTIVE page sizes. * Document restriction * Add unit tests for different page sizes
* Add bootloader to CIUlf Lilleengen2022-04-271-33/+24
|
* Add stm32 flash + bootloader supportUlf Lilleengen2022-04-271-75/+144
| | | | | | | | * Add flash drivers for L0, L1, L4, WB and WL. Not tested for WB, but should be similar to WL. * Add embassy-boot-stm32 for bootloading on STM32. * Add flash examples and bootloader examples * Update stm32-data
* Support multiple flash instances in embassy-bootUlf Lilleengen2022-04-191-41/+193
| | | | | | | | * Add FlashProvider and FlashConfig traits to define flash characteristics * Use traits in bootloader to retrieve flash handles and for copying data between flash instances * Add convenience implementations for using a single flash instance.
* Avoid writing bootloader flash if not neededUlf Lilleengen2022-03-311-24/+36
|
* Fix potential unaligned writeUlf Lilleengen2022-03-221-4/+14
| | | | Reduce log level
* Add embassy-bootUlf Lilleengen2022-02-092-0/+775
Embassy-boot is a simple bootloader that works together with an application to provide firmware update capabilities with a minimal risk. The bootloader consists of a platform-independent part, which implements the swap algorithm, and a platform-dependent part (currently only for nRF) that provides addition functionality such as watchdog timers softdevice support.