This commit is contained in:
some00 2024-09-29 23:47:40 -04:00 committed by GitHub
commit 3a0a6cb561
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 60 additions and 0 deletions

View file

@ -250,6 +250,8 @@ Before running this step, wait to receive `0x10`, `0x04`, `0x01` which indicates
Once all of these steps are complete, the DFU is complete. Don't forget to validate the firmware in the settings.
![BLE firmware upgrade sequence diagram](ble/dfu_sequence.png "BLE firmware upgrade sequence diagram")
---
### Music Control

BIN
doc/ble/dfu_sequence.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

58
doc/ble/dfu_sequence.puml Normal file
View file

@ -0,0 +1,58 @@
@startuml
group Step 1 [States::Start]
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::StartDFU, ImageTypes::Application)
Pinetime --> CompanionApp : ControlPoint Endpoint (Ack)
end
group Step 2 [States::Start]
CompanionApp --> Pinetime : Packet Endpoint (softdeviceSize: uint32_le, bootloaderSize: uint32_le, applicationSize: uint32_le)
end
group Step 3 [States::Init]
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::Response, Opcodes::InitDFUParameters, ErrorCodes::NoError)
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::InitDFUParameters, complete=0x00)
Pinetime --> CompanionApp : ControlPoint Endpoint (Ack)
end
group Step 4 [States::Init]
CompanionApp --> Pinetime : Packet Endpoint (<.dat init file>)
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::InitDFUParameters, complete=0x01)
end
group Step 5 [States::Init]
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::Response, Opcodes::InitDFUParameters, ErrorCodes::NoError)
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::PacketReceiptNotificationRequest, nbPacketsToNotify)
Pinetime --> CompanionApp : ControlPoint Endpoint (Ack)
end
group Step 6 [States::Init]
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::ReceiveFirmwareImage)
Pinetime --> CompanionApp : ControlPoint Endpoint (Ack)
end
group Step 7 [States::Data]
loop firmware in 20 bytes
CompanionApp --> Pinetime : Packet Endpoint (<firmware-chunk>)
alt nbPacketsToNotify chunks received
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::PacketReceiptNotification, bytesReceived: uint32_le)
end
end
end
group Step 8 [States::Validate]
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::Response, Opcodes::ReceiveFirmwareImage, ErrorCodes::NoError)
CompanionApp -> Pinetime : ControlPoint Endpoint (Opcodes::ValidateFirmware)
Pinetime --> CompanionApp : ControlPoint Endpoint (Ack)
end
alt validation succcess
group Step 9 [States::Validated]
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::Response, Opcodes::ValidateFirmware, ErrorCodes::NoError)
CompanionApp ->x Pinetime : ControlPoint Endpoint (Opcodes::ActivateImageAndReset)
end
else crc mismatch
Pinetime --> CompanionApp : ControlPoint Endpoint (Opcodes::Response, Opcodes::ValidateFirmware, ErrorCodes::CrcError)
end
@enduml