Skip to content

Firmware m0801

mefistotelis edited this page Jul 16, 2021 · 34 revisions

Table of Contents

Target
Purpose
Versions
Structure
OS and Libraries
Flashing
Interfaces

Target

The firmware programs SoC which handles video encoding and flight control. Location of this chip:

Note that within WM220, the m0801 module identifier is used to store something different - there's m0901 instead. So the information on this page does not apply to WM220.

Purpose

The module contains programming of a SoC which handles image sensor and video encoding, but also flight control. Additionally, it uses TrustZone to (semi)securely store cryptographic keys, and is the component which controls firmware update process on the drone.

Versions

TODO

Structure

The IM*H module within FW update package is always encrypted, with AES, using platform-specific UFIE key.

Decrypted firmware is a JAR file, which when unzipped reveals typical Android boot images (normal.img, recovery.img), and a 2nd stage bootloader (bootarea.img). It also contains new content for system and vendor partitions, as sparse filesystem images (*.new.dat, *.transfer.list).

The bootarea.img has the bootloader encrypted with TBIE key. Like the whole firmware file, it has IM*H format, though within the bootloader that part is preceded by a little chunk of unencrypted code.

Boot partitions (normal.img, recovery.img) are encrypted with TBIE key, and have IM*H format as well.

OS and Libraries

Since WM230, the software is divided into normal part and trusted part. Normal part runs directly on the ARM CPU, while trusted part is executed within hardware-accelerated ARM TrustZone.

Normal part

The firmware is based on Android, though it is cut down and heavily modified version. Internal 1st stage bootloader is designed to support IM*H images, and boot images are supplied in form of such encrypted files. The 2nd stage bootloader is also supplied as IM*H image, preceded by public RSA key (PRAK) used to sign its header. Note that 1st stage bootloader is not loaded from eMMC - it is within internal ROM of the chip.

User space has the graphical interface part removed, and works like simple Linux distribution. There are several DJI-made native executables and libraries available within the file system. Some of them are running as services, performing designed functions of the module. Some tools, like dji_fw_verify (used to verify and decrypt firmware updates), are relaying encryption-related operations to TrustZone.

Trusted part

This part is based on OP-TEE OS which is stored within boot images (normal.img, recovery.img).

Encryption algorithms are hardware-accelerated using CryptoCell 310 SDK library provided by Nordic Semiconductor.

Flashing

TODO

Interfaces

TODO

Clone this wiki locally