Crate ql_fota
Expand description
Library for applying Quectel FOTA updates.
run writes an update to the inactive slot and sync copies it to the
other slot after the reboot. This needs a module with A and B slots, such
as the AG35EVD. Modules without B slots, such as the AG35EVA, update
through the recovery system, which this crate doesnβt support.
Β§FOTA info
Quectel stores the FOTA state on the rawdata partition of the flash. The
state is a 512-byte struct (FotaInfo) with the magic string FOTA# and
a CRC32. FotaPartition reads and writes it.
There are three copies of the state, one at the start of each of the first three good blocks from block 6 on. Bad blocks are skipped, so the copies are in blocks 6, 7 and 8 unless one of them is bad. The bootloader reads the same blocks. When it writes the state itself, it starts at block 6 without skipping the bad blocks before it. A bad block before block 6 then makes the bootloader read its own copies from other blocks than it wrote them to.
To read the state, FotaPartition checks the same three blocks and
returns the first copy with the magic string and a valid CRC32.
ModulesΒ§
StructsΒ§
- Fota
Info - Represents FOTA (Firmware Over-The-Air) update information.
- Fota
Partition - FOTA info partition.
- Unknown
Value - Error for a raw value that matches no enum variant.
EnumsΒ§
- Error
- Errors that can occur when updating a partition through the Quectel FOTA update system or when accessing the FOTA info.
- Fota
Active - Represents the active partition (A or B) for FOTA updates.
- Fota
State - Represents the state of FOTA (Firmware Over-The-Air) update.
- Fota
Type - Represents the type of FOTA update.
- Patch
Error - Errors that can occur when applying a bspatch patch.
- Write
Outcome - Result of a FOTA info write that did not return an error.
ConstantsΒ§
- DEFAULT_
WORK_ DIR - Default directory for the files that
runcreates.
FunctionsΒ§
- clean
- Removes
work_dirwith the files created byrun. - run
- Computes the new partitions from the FOTA blob and flashes them onto the proper MTD flash memory locations.
- sync
- Copies the updated partitions to the inactive slot after the reboot.