Failure of CHIP_ERASE and PROG_MULTI Commands with PX4 Bootloader

I am working on a custom application to upload .apj files to Pixhawk 6C CUPE Plus Orange using the Bootloader protocol. The application is built using Qt QML + C++.

  • I am using the official PX4 Bootloader protocol:

namespace BL {
const uint8_t INSYNC = 0x12;
const uint8_t OK = 0x10;

const uint8_t GET_SYNC = 0x21;
const uint8_t CHIP_ERASE = 0x23;
const uint8_t PROG_MULTI = 0x27;
const uint8_t REBOOT = 0x30;

const uint8_t EOC = 0x20;
const int PROG_MULTI_MAX = 64;
}

Current Behavior:

  • The serial port opens correctly.

  • GET_SYNC and REBOOT commands work and respond correctly with 12 10.

  • However, both CHIP_ERASE and PROG_MULTI commands fail, and I receive 12 13 (INVALID) or FAILED responses.

Example output:

Opened port: COM13 : Pixhawk6C
Opened port: COM14 : Pixhawk6C
MAVLink reboot-to-bootloader sent to SYS_ID=1 COMP_ID=1
Starting scan…
Port opened: COM12 (Pixhawk6C-BL)
:right_arrow: Sending INSYNC+GET_SYNC…
:left_arrow: GET_SYNC response: 12 10
CHIP_ERASE (takes ~6 seconds)…
:left_arrow: CHIP_ERASE response: 12 13 ← FAIL
:right_arrow: SET_ADDRESS 0x08004000…
:left_arrow: SET_ADDRESS response: 00 00 00 00 12 10 ← FAIL
Writing Firmware (PROG_MULTI)…
resp 12 13 12 13 ← FAIL at offset 0
Sending REBOOT command…
:left_arrow: REBOOT response: 12 10

This is not an existing product. It is a weird verbal mashup of at least 2 or more companies and their autopilots.

Additionally, this is the ArduPilot forum, and you are using the PX4 bootloader, but you are uploading entirely different firmware, it seems. I’m not sure how we can help.

2 Likes

First, I meant Pixhawk 6C as the board, and CUPE Orange Plus as a different board, yes, they are separate and I did not intend to mix their names.

Second, regarding the protocol:
I understand your point, but I want to clarify that ArduPilot actually uses the same PX4 bootloader protocol for uploading firmware. The script located at:

ardupilot/Tools/scripts/uploader.py

uses the PX4 Bootloader protocol to upload ArduPilot .apj firmware.
This is why I am using the same protocol in my own Qt/QML application.

My issue is that some parts of the protocol work correctly (GET_SYNC, REBOOT), but other commands such as CHIP_ERASE and PROG_MULTI do not work.
Because of this inconsistency, I am trying to understand why only part of the protocol is functioning while the rest fails, and I am looking for help or clarification.

I apologize for any confusion — I am simply trying to replicate the same upload behavior that ArduPilot’s uploader uses.