From d8c2c9ad0170c2bbdd3b3272a6b2ef67b3e7f4a1 Mon Sep 17 00:00:00 2001 From: JF Date: Mon, 10 Aug 2020 16:36:29 +0200 Subject: Add more doc about the bootloader (sequence diagrams and degraded cases). --- doc/bootloader/boot.puml | 19 +++++++++++++++++++ doc/bootloader/recover.puml | 17 +++++++++++++++++ doc/bootloader/upgrade.puml | 21 +++++++++++++++++++++ 3 files changed, 57 insertions(+) create mode 100644 doc/bootloader/boot.puml create mode 100644 doc/bootloader/recover.puml create mode 100644 doc/bootloader/upgrade.puml (limited to 'doc/bootloader') diff --git a/doc/bootloader/boot.puml b/doc/bootloader/boot.puml new file mode 100644 index 00000000..00790d75 --- /dev/null +++ b/doc/bootloader/boot.puml @@ -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 \ No newline at end of file diff --git a/doc/bootloader/recover.puml b/doc/bootloader/recover.puml new file mode 100644 index 00000000..3f5bafb1 --- /dev/null +++ b/doc/bootloader/recover.puml @@ -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 \ No newline at end of file diff --git a/doc/bootloader/upgrade.puml b/doc/bootloader/upgrade.puml new file mode 100644 index 00000000..c31b9111 --- /dev/null +++ b/doc/bootloader/upgrade.puml @@ -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 \ No newline at end of file -- cgit v1.2.3-70-g09d2