This is the documentation for the latest (main) development branch. If you are looking for the documentation of previous releases, use the drop-down menu on the left and select the desired version.

Bootloader

Introduction

Overview

Terminology Definitions

terminology

definitions

CRC

Cyclic Redundancy Check

IMAGE

Binary File

MAC

Medium Access Control

QFLASH

Quad-SPI Flash

RAM

Read-Write Memory

ROM

Read-Only Memory

SECBOOT

Second Boot

UART

Universal asynchronous receiver-transmitter

MB

Mega Byte

KB

Kilo Byte

Bootloader Flowchart

Bootloader Flowchart

Bootloader Functionality

Description of Bootloader Functionality

IMAGE Boot Part

QFlash Working Mode Switch

For unknown Flash manufacturers, when switching from ROM to QFlash, it is necessary to switch the QFlash working mode: from single-line mode to quad-line mode.

IMAGE Integrity Check(CRC32)
  1. Perform a CRC check on the IMAGE header;

Perform a CRC check on the contents of the IMAGE.

After this check, subsequent actions are performed on the boot code.

  1. Perform a signature check on the entire IMAGE.

Code Decompression

To save space, customers may compress the code. Based on the compression algorithm used, the code is decompressed. It is necessary to consider which compression and decompression algorithms are used, as well as the compression ratio. Only the GZIP algorithm is supported.

Code Relocation

The decompressed code needs to be placed in the specified running position, determined based on the header information of the IMAGE.

Code Decryption Setup

If the code is encrypted, it is necessary to configure the decryption information for the code.

Code Jump Running

After the code is moved, determine the reset vector address of the code and jump from secboot to the user’s image to run.

Upgrade Functionality

Upgrade method

Similar to the ROM upgrade method, using xmodem.

Special instructions

The same instructions supported by ROM.