MAVLINKHUD

Overview

The FLASH parameter group provides tools for managing the on-board non-volatile memory (Flash) of the autopilot or peripheral.

Currently, this is primarily used within AP_Periph firmware to trigger critical bootloader updates.

Key Concepts

1. Bootloader Update (FLASH_BOOTLOADER)

The bootloader is the first bit of code that runs when the board powers up. Updating it is risky but sometimes necessary to support new firmware features or hardware fixes.

  • Trigger: Setting FLASH_BOOTLOADER = 1 tells the firmware to overwrite the bootloader sector with an updated version embedded in the application binary.

Parameter Breakdown

  • FLASH_BOOTLOADER:
    • 0: Idle.
    • 1: Perform update on next boot.

Integration Guide

  • Safety: DO NOT trigger a bootloader update unless specifically instructed by firmware release notes. A power failure during this process can "brick" the device, requiring an ST-Link or JTAG debugger to recover.

Developer Notes

  • Library: Tools/AP_Periph.

FLASH_BOOTLOADER

Default 0
Range 0 1

Trigger bootloader update (FLASH_BOOTLOADER)

Description

DANGER ZONE. This parameter is a command trigger. When set to 1, the DroneCAN peripheral will attempt to upgrade its own bootloader using the version embedded in its current firmware image. This is a critical operation; power loss during this process can brick the device.

The Mathematics

N/A. State Machine Trigger.

The Engineer's View

Defined in Tools/AP_Periph/Parameters.cpp.

  • Mechanism: On set, the system validates the embedded bootloader image, erases the bootloader sector, and writes the new image.
  • Safety: Do not touch unless instructed by release notes.

Tuning & Behavior

  • Default Value: 0
  • 1: Perform update. Parameter usually resets to 0 automatically or requires a reboot.