Skip to content

Commit 45056aa

Browse files
committed
Integrated more documentation
1 parent 7cb51a4 commit 45056aa

3 files changed

Lines changed: 11 additions & 5 deletions

File tree

docs/API.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,25 @@ and
3232
- `wolfBoot_update()` is used to trigger an update upon the next reboot, and it is normally used by
3333
an update application that has retrieved a new version of the running firmware, and has
3434
stored it in the UPDATE partition on the flash. This function will set the state of the UPDATE partition
35-
to `ST_UPDATE`, instructing the bootloader to perform the update upon the next execution (after reboot).
35+
to `STATE_UPDATING`, instructing the bootloader to perform the update upon the next execution (after reboot).
3636

3737
wolfBoot update process consist in swapping the content of the UPDATE and the BOOT partitions, using a temporary
3838
single-block SWAP space.
3939

40+
### Confirm current image
41+
4042
- `wolfBoot_success()` indicates a successful boot of a new firmware. This can be called by the application
4143
at any time, but it will only be effective to mark the current firmware (in the BOOT partition) with the state
42-
`ST_SUCCESS`, indicating that no roll-back is required. An application should typically call `wolfBoot_success()`
44+
`STATE_SUCCESS`, indicating that no roll-back is required. An application should typically call `wolfBoot_success()`
4345
only after verifying that the basic system features are up and running, including the possibility to retrieve
4446
a new firmware for the next upgrade.
4547

46-
If after an upgrade wolfBoot detects that the active firmware is still in `ST_TESTING` state, it means that
48+
If after an upgrade wolfBoot detects that the active firmware is still in `STATE_TESTING` state, it means that
4749
a successful boot has not been confirmed for the application, and will attempt to revert the update by swapping
4850
the two images again.
4951

5052
For more information about the update process, see [Firmware Update](firmware_update.md)
5153

54+
For the image format, see [Firmware Image](firmware_image.md)
55+
5256

docs/firmware_update.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ The steps to follow to complete a firmware update with wolfBoot are:
1313
At any given time, an application or OS running on a wolfBoot system can receive an updated version of itself,
1414
and store the updated image in the second partition in the FLASH memory.
1515

16+
![Update and Rollback](png/wolfboot_update_rollback.png)
17+
1618
Applications or OS threads can be linked to the [libwolfboot library](API.md), which exports the API to trigger
1719
the update at the next reboot, and some helper functions to access the flash partition for
1820
erase/write through the target specific [HAL](HAL.md).
@@ -27,15 +29,15 @@ After storing the new firmware image in the UPDATE partition, the application sh
2729
- Validate the new firmware image stored in the UPDATE partition
2830
- Verify the signature attached against a known public key stored in the bootloader image
2931
- Swap the content of the BOOT and the UPDATE partitions
30-
- Mark the new firmware in the BOOT partition as in state `ST_TESTING`
32+
- Mark the new firmware in the BOOT partition as in state `STATE_TESTING`
3133
- Boot into the newly received firmware
3234

3335
### Successful boot
3436

3537
Upon a successful boot, the application should inform the bootloader by calling `wolfBoot_success()`, after verifying that
3638
the system is up and running again. This operation confirms the update to a new firmware.
3739

38-
Failing to set the BOOT partition to `ST_SUCCESS` before the next reboot triggers a roll-back operation.
40+
Failing to set the BOOT partition to `STATE_SUCCESS` before the next reboot triggers a roll-back operation.
3941
Roll-back is initiated by the bootloader by triggering a new update, this time starting from the backup copy of the original
4042
(pre-update) firmware, which is now stored in the UPDATE partition due to the swap occurring earlier.
4143

33.1 KB
Loading

0 commit comments

Comments
 (0)