Add more doc about the bootloader (sequence diagrams and degraded cases).
This commit is contained in:
19
doc/bootloader/boot.puml
Normal file
19
doc/bootloader/boot.puml
Normal file
@@ -0,0 +1,19 @@
|
||||
@startuml
|
||||
|
||||
MCU -> Bootloader: reset
|
||||
activate Bootloader
|
||||
Bootloader -> Bootloader: Recover? (no)
|
||||
Bootloader -> Bootloader: New version? (no)
|
||||
Bootloader -> Application: Jump to primary slot
|
||||
deactivate Bootloader
|
||||
|
||||
activate Application
|
||||
note right: This is the current version of the firmware
|
||||
Application -> Application: OTA procedure
|
||||
note right: Download a new firmware version and\n store it in secondary slot
|
||||
Application -> MCU: Reset
|
||||
deactivate Application
|
||||
|
||||
|
||||
|
||||
@enduml
|
17
doc/bootloader/recover.puml
Normal file
17
doc/bootloader/recover.puml
Normal file
@@ -0,0 +1,17 @@
|
||||
@startuml
|
||||
|
||||
MCU -> Bootloader: reset
|
||||
activate Bootloader
|
||||
Bootloader -> Bootloader: Recover? (yes)
|
||||
Bootloader -> Bootloader: Restore previous firmware
|
||||
note left: Copy the previous firmware from secondary to primary slot
|
||||
Bootloader -> Application: Jump to primary slot
|
||||
deactivate Bootloader
|
||||
|
||||
activate Application
|
||||
note right: This is the previous version\nof the firmware
|
||||
Application -> Application: Normal Operation
|
||||
Application -> MCU: Reset
|
||||
deactivate Application
|
||||
|
||||
@enduml
|
21
doc/bootloader/upgrade.puml
Normal file
21
doc/bootloader/upgrade.puml
Normal file
@@ -0,0 +1,21 @@
|
||||
@startuml
|
||||
|
||||
MCU -> Bootloader: reset
|
||||
activate Bootloader
|
||||
Bootloader -> Bootloader: Recover? (no)
|
||||
Bootloader -> Bootloader: New version? (yes)
|
||||
Bootloader -> Bootloader: Swap firmwares
|
||||
note left: Copy current firmware from primary to secondary\nand copy the new firmware from secondary to primary
|
||||
Bootloader -> Application: Jump to primary slot
|
||||
deactivate Bootloader
|
||||
|
||||
|
||||
activate Application
|
||||
note right: This is the new version of the firmware
|
||||
Application -> Application: Write the valid bit in flash memory
|
||||
note right: The application should provide a way to\ncheck that it is running correctly\n(selftest, user confirmation,...)\nbefore setting the valid bit.
|
||||
Application -> Application: Normal operations...
|
||||
Application -> MCU: Reset
|
||||
deactivate Application
|
||||
|
||||
@enduml
|
Reference in New Issue
Block a user