DocID024383 Rev 1
27/56
UM1619
Firmware description
this application is set to 60 Kbytes), plus 4 Kb of additional memory for a bootloader.
shows the microcontroller memory organization.
The bootloader is loaded at startup and checks the active segment containing the actual
firmware. The implemented mechanism uses three partitions of the microcontroller's Flash
memory, one containing the bootloader and two containing the actual running firmware
(active image) and the new firmware as soon as a RFU is needed.
As soon as the firmware transfer is completed, a “swap” command sent from the remote
PLM causes the target PLM to check first the integrity of the firmware dump (actually a
checksum is calculated and compared with the one sent by the remote PLM), and after the
reset vector address of the new firmware is written in a dedicated Flash segment of the
bootloader. Lastly, the microcontroller is self-reset, and the new firmware executed.
Figure 21. Memory organization
The RFU protocol manages the RFU “start”, “get new firmware segment” (with the segment
address) and “swap” commands. The protocol is not embedded in the bootloader, hence it
can be updated with the new firmware, but the user must be careful with the modifications,
as any bug can compromise the RFU mechanism.
As soon as a new firmware segment is received, the RFU manager checks if the address is
within the firmware interrupt vector table. If it is the case, an offset depending on the free
firmware image (1 or 2) allocation is added to each interrupt vector before being written in
the free image flash area.
shows the RFU flow chart.