Paparazzi UAS  v7.0_unstable
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 "modules/intermcu/intermcu_ap.h"
#include "mcu_periph/uart.h"
#include "mcu_periph/usb_serial.h"
#include "mcu.h"
#include "led.h"
#include "mcu_arch.h"
#include "mcu_periph/sys_time.h"
+ Include dependency graph for px4_flash.c:

Go to the source code of this file.

Macros

#define FLASH_PORT   (&((FLASH_UART).device))
 
#define PX4_IO_FORCE_PROG   FALSE
 
#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_CHIP_VERIFY   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...
 

Functions

void px4flash_init (void)
 
void px4flash_event (void)
 

Variables

bool setToBootloaderMode
 
bool px4ioRebootTimeout
 

Detailed Description

Author
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

◆ FLASH_PORT

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

Definition at line 51 of file px4_flash.c.

◆ PROTO_BOOT

#define PROTO_BOOT   0x30

boot the application

Definition at line 74 of file px4_flash.c.

◆ PROTO_CHIP_ERASE

#define PROTO_CHIP_ERASE   0x23

erase program area and reset program address

Definition at line 70 of file px4_flash.c.

◆ PROTO_CHIP_VERIFY

#define PROTO_CHIP_VERIFY   0x24

set next programming address

Definition at line 71 of file px4_flash.c.

◆ PROTO_EOC

#define PROTO_EOC   0x20

end of command

Definition at line 62 of file px4_flash.c.

◆ PROTO_FAILED

#define PROTO_FAILED   0x11

INSYNC/FAILED - 'fail' response.

Definition at line 65 of file px4_flash.c.

◆ PROTO_GET_CRC

#define PROTO_GET_CRC   0x29

compute & return a CRC

Definition at line 73 of file px4_flash.c.

◆ PROTO_GET_DEVICE

#define PROTO_GET_DEVICE   0x22

get device ID bytes

Definition at line 69 of file px4_flash.c.

◆ PROTO_GET_SYNC

#define PROTO_GET_SYNC   0x21

NOP for re-establishing sync.

Definition at line 68 of file px4_flash.c.

◆ PROTO_INSYNC

#define PROTO_INSYNC   0x12

'in sync' byte sent before status

Definition at line 61 of file px4_flash.c.

◆ PROTO_INVALID

#define PROTO_INVALID   0x13

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

Definition at line 66 of file px4_flash.c.

◆ PROTO_OK

#define PROTO_OK   0x10

INSYNC/OK - 'ok' response.

Definition at line 64 of file px4_flash.c.

◆ PROTO_PROG_MULTI

#define PROTO_PROG_MULTI   0x27

write bytes at program address and increment

Definition at line 72 of file px4_flash.c.

◆ PX4_IO_FORCE_PROG

#define PX4_IO_FORCE_PROG   FALSE

Definition at line 54 of file px4_flash.c.

Function Documentation

◆ px4flash_event()

◆ px4flash_init()

void px4flash_init ( void  )

Definition at line 79 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 77 of file px4_flash.c.

Referenced by px4flash_event(), and px4flash_init().

◆ setToBootloaderMode

bool setToBootloaderMode

Definition at line 76 of file px4_flash.c.

Referenced by px4flash_event(), and px4flash_init().