PX4 Firmware
PX4 Autopilot Software http://px4.io
|
#include <uploader.h>
Public Member Functions | |
PX4IO_Uploader () | |
virtual | ~PX4IO_Uploader ()=default |
int | upload (const char *filenames[]) |
Private Types | |
enum | { PROTO_NOP = 0x00, PROTO_OK = 0x10, PROTO_FAILED = 0x11, PROTO_INSYNC = 0x12, PROTO_INVALID = 0x13, PROTO_BAD_SILICON_REV = 0x14, PROTO_EOC = 0x20, PROTO_GET_SYNC = 0x21, PROTO_GET_DEVICE = 0x22, PROTO_CHIP_ERASE = 0x23, PROTO_CHIP_VERIFY = 0x24, PROTO_PROG_MULTI = 0x27, PROTO_READ_MULTI = 0x28, PROTO_GET_CRC = 0x29, PROTO_GET_OTP = 0x2a, PROTO_GET_SN = 0x2b, PROTO_GET_CHIP = 0x2c, PROTO_SET_DELAY = 0x2d, PROTO_GET_CHIP_DES = 0x2e, PROTO_REBOOT = 0x30, INFO_BL_REV = 1, BL_REV = 5, INFO_BOARD_ID = 2, INFO_BOARD_REV = 3, INFO_FLASH_SIZE = 4, PROG_MULTI_MAX = 248 } |
Private Member Functions | |
void | log (const char *fmt,...) |
int | recv_byte_with_timeout (uint8_t *c, unsigned timeout) |
int | recv_bytes (uint8_t *p, unsigned count) |
void | drain () |
int | send (uint8_t c) |
int | send (uint8_t *p, unsigned count) |
int | get_sync (unsigned timeout=40) |
int | sync () |
int | get_info (int param, uint32_t &val) |
int | erase () |
int | program (size_t fw_size) |
int | verify_rev2 (size_t fw_size) |
int | verify_rev3 (size_t fw_size) |
int | reboot () |
Private Attributes | |
int | _io_fd |
int | _fw_fd |
uint32_t | bl_rev |
bootloader revision More... | |
Definition at line 46 of file uploader.h.
|
private |
Definition at line 55 of file uploader.h.
PX4IO_Uploader::PX4IO_Uploader | ( | ) |
Definition at line 67 of file px4io_uploader.cpp.
|
virtualdefault |
|
private |
Definition at line 293 of file px4io_uploader.cpp.
References log(), OK, and recv_byte_with_timeout().
Referenced by sync().
|
private |
Definition at line 404 of file px4io_uploader.cpp.
References get_sync(), log(), PROTO_CHIP_ERASE, PROTO_EOC, and send().
Referenced by upload().
|
private |
Definition at line 386 of file px4io_uploader.cpp.
References get_sync(), OK, PROTO_EOC, PROTO_GET_DEVICE, recv_bytes(), and send().
Referenced by upload(), and verify_rev3().
|
private |
Definition at line 345 of file px4io_uploader.cpp.
References log(), OK, PROTO_INSYNC, PROTO_OK, and recv_byte_with_timeout().
Referenced by erase(), get_info(), program(), reboot(), sync(), verify_rev2(), and verify_rev3().
|
private |
Definition at line 680 of file px4io_uploader.cpp.
Referenced by drain(), erase(), get_sync(), program(), recv_byte_with_timeout(), send(), upload(), verify_rev2(), and verify_rev3().
|
private |
Definition at line 432 of file px4io_uploader.cpp.
References _fw_fd, get_sync(), log(), OK, PROG_MULTI_MAX, PROTO_EOC, PROTO_PROG_MULTI, read_with_retry(), and send().
Referenced by upload().
|
private |
Definition at line 662 of file px4io_uploader.cpp.
References get_sync(), OK, PROTO_EOC, PROTO_REBOOT, and send().
Referenced by upload().
|
private |
Definition at line 252 of file px4io_uploader.cpp.
References _io_fd, log(), OK, and read().
Referenced by drain(), get_sync(), recv_bytes(), and verify_rev2().
|
private |
Definition at line 277 of file px4io_uploader.cpp.
References OK, and recv_byte_with_timeout().
Referenced by get_info(), and verify_rev3().
|
private |
Definition at line 315 of file px4io_uploader.cpp.
References _io_fd, log(), OK, and write().
Referenced by erase(), get_info(), program(), reboot(), send(), sync(), verify_rev2(), and verify_rev3().
|
private |
|
private |
Definition at line 371 of file px4io_uploader.cpp.
References drain(), get_sync(), PROG_MULTI_MAX, PROTO_EOC, PROTO_GET_SYNC, and send().
Referenced by upload().
int PX4IO_Uploader::upload | ( | const char * | filenames[] | ) |
Definition at line 75 of file px4io_uploader.cpp.
References _fw_fd, _io_fd, BL_REV, bl_rev, erase(), get_info(), INFO_BL_REV, log(), OK, program(), reboot(), sync(), verify_rev2(), and verify_rev3().
Referenced by px4io_main().
|
private |
Definition at line 492 of file px4io_uploader.cpp.
References _fw_fd, get_sync(), log(), OK, PROTO_CHIP_VERIFY, PROTO_EOC, PROTO_READ_MULTI, read_with_retry(), recv_byte_with_timeout(), and send().
Referenced by upload().
|
private |
Definition at line 572 of file px4io_uploader.cpp.
References _fw_fd, get_info(), get_sync(), INFO_FLASH_SIZE, log(), OK, PROTO_EOC, PROTO_GET_CRC, read_with_retry(), recv_bytes(), and send().
Referenced by upload().
|
private |
Definition at line 89 of file uploader.h.
Referenced by program(), upload(), verify_rev2(), and verify_rev3().
|
private |
Definition at line 88 of file uploader.h.
Referenced by recv_byte_with_timeout(), send(), and upload().
|
private |