1.5.5.1 How The Library Works
The PRIME Firmware Upgrade service library is primarily used by the PRIME Stack, only few of its features are used by the user application. Once configured, the PRIME Stack manages the various operations.
The library must be initialized and maintained periodically.
Description of the module
The Firmware Upgrade service uses the Memory driver to abstract from the different underlying hardware
In the PIC32CX MT device, the SEFC0 driver is configured by allocating the reserved space for the images to be sent (Base Node) or received (Service Node).
PRIME Firmware Upgrade in the Base Node
The PRIME Firmware Upgrade service temporarily stores the image to be transferred to the Service Node in the memory address configured in the Base Node. Then, the PRIME Stack in the Base Node can manage the firmware upgrade process.
PRIME Firmware Upgrade in the Service Node
The PRIME Firmware Upgrade service is responsible for storing the image transferred through the PRIME network in the memory of the Service Node. It also uses GPBRs 0 to 3 to store the state of the over-the-air update, allowing it to resume even if an interruption occurs during the process.
The PRIME Firmware Upgrade service includes verification functions to check the CRC of the entire image as specified in the PRIME standard and incorporates the possibility of performing an integrity check using an ECDSA-256 signature, which allows to verify the authenticity of the downloaded image. For the ECDSA and SHA calculations, this service requires the H3 Cryptographic library.
Additionally, the user application can receive notifications from the PRIME Stack indicating that the available PRIME network version is different from the stack version in use. This allows the user application to decide to switch PRIME versions if both versions (v1.3.6 and v1.4) are stored in the flash memory.