Skip to main content

Crate ql_fota

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Β§

bspatch πŸ”’
config πŸ”’
error πŸ”’
fotainfo πŸ”’
md5sum πŸ”’
ops πŸ”’
partition πŸ”’

StructsΒ§

FotaInfo
Represents FOTA (Firmware Over-The-Air) update information.
FotaPartition
FOTA info partition.
UnknownValue
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.
FotaActive
Represents the active partition (A or B) for FOTA updates.
FotaState
Represents the state of FOTA (Firmware Over-The-Air) update.
FotaType
Represents the type of FOTA update.
PatchError
Errors that can occur when applying a bspatch patch.
WriteOutcome
Result of a FOTA info write that did not return an error.

ConstantsΒ§

DEFAULT_WORK_DIR
Default directory for the files that run creates.

FunctionsΒ§

clean
Removes work_dir with the files created by run.
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.

Type AliasesΒ§

Result
Result type using the crate Error.