Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
px4_flash.c File Reference
#include "modules/px4_flash/px4_flash.h"
#include "modules/px4_flash/protocol.h"
#include "mcu_periph/sys_time_arch.h"
#include "subsystems/intermcu/intermcu_ap.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/usb_serial.h"
#include "led.h"
#include "libopencm3/cm3/scb.h"
#include "mcu_periph/sys_time.h"
+ Include dependency graph for px4_flash.c:

Go to the source code of this file.


#define FLASH_PORT   (&((FLASH_UART).device))
#define PROTO_INSYNC   0x12
 'in sync' byte sent before status More...
#define PROTO_EOC   0x20
 end of command More...
#define PROTO_OK   0x10
 INSYNC/OK - 'ok' response. More...
#define PROTO_FAILED   0x11
 INSYNC/FAILED - 'fail' response. More...
#define PROTO_INVALID   0x13
 INSYNC/INVALID - 'invalid' response for bad commands. More...
#define PROTO_GET_SYNC   0x21
 NOP for re-establishing sync. More...
#define PROTO_GET_DEVICE   0x22
 get device ID bytes More...
#define PROTO_CHIP_ERASE   0x23
 erase program area and reset program address More...
#define PROTO_LOAD_ADDRESS   0x24
 set next programming address More...
#define PROTO_PROG_MULTI   0x27
 write bytes at program address and increment More...
#define PROTO_GET_CRC   0x29
 compute & return a CRC More...
#define PROTO_BOOT   0x30
 boot the application More...


void px4flash_init (void)
void px4flash_event (void)


bool setToBootloaderMode
bool px4ioRebootTimeout

Detailed Description

Kevin van Hecke Enables to flashes the px4 FBW and AP through the original px4 bootloader. Assumes the flash port on the Pixhawk is configured as the usb.

Definition in file px4_flash.c.

Macro Definition Documentation


#define FLASH_PORT   (&((FLASH_UART).device))

Definition at line 47 of file px4_flash.c.


#define PROTO_BOOT   0x30

boot the application

Definition at line 65 of file px4_flash.c.


#define PROTO_CHIP_ERASE   0x23

erase program area and reset program address

Definition at line 61 of file px4_flash.c.


#define PROTO_EOC   0x20

end of command

Definition at line 53 of file px4_flash.c.


#define PROTO_FAILED   0x11

INSYNC/FAILED - 'fail' response.

Definition at line 56 of file px4_flash.c.


#define PROTO_GET_CRC   0x29

compute & return a CRC

Definition at line 64 of file px4_flash.c.


#define PROTO_GET_DEVICE   0x22

get device ID bytes

Definition at line 60 of file px4_flash.c.


#define PROTO_GET_SYNC   0x21

NOP for re-establishing sync.

Definition at line 59 of file px4_flash.c.


#define PROTO_INSYNC   0x12

'in sync' byte sent before status

Definition at line 52 of file px4_flash.c.


#define PROTO_INVALID   0x13

INSYNC/INVALID - 'invalid' response for bad commands.

Definition at line 57 of file px4_flash.c.


#define PROTO_LOAD_ADDRESS   0x24

set next programming address

Definition at line 62 of file px4_flash.c.


#define PROTO_OK   0x10

INSYNC/OK - 'ok' response.

Definition at line 55 of file px4_flash.c.


#define PROTO_PROG_MULTI   0x27

write bytes at program address and increment

Definition at line 63 of file px4_flash.c.

Function Documentation

◆ px4flash_event()

◆ px4flash_init()

void px4flash_init ( void  )

Definition at line 70 of file px4_flash.c.

References px4ioRebootTimeout, setToBootloaderMode, and sys_time_register_timer().

+ Here is the call graph for this function:

Variable Documentation

◆ px4ioRebootTimeout

bool px4ioRebootTimeout

Definition at line 68 of file px4_flash.c.

Referenced by px4flash_event(), and px4flash_init().

◆ setToBootloaderMode

bool setToBootloaderMode

Definition at line 67 of file px4_flash.c.

Referenced by px4flash_event(), and px4flash_init().