dRonin
adbada4
dRonin firmware
|
Message definitions for the unified bootloader. More...
Data Structures | |
struct | bl_messages |
struct | xfer_state |
struct | led_pwm_state |
struct | bl_fsm_context |
struct | bl_transition |
Macros | |
#define | BL_INCLUDE_CAP_EXTENSIONS |
#define | BL_MSG_FLAGS_ECHO_REQ 0x80 |
#define | BL_MSG_FLAGS_ECHO_REP 0x40 |
#define | BL_MSG_FLAGS_MASK 0xC0 |
#define | BL_MSG_COMMAND_MASK 0x3F |
#define | MIN(x, y) ((x) < (y) ? (x) : (y)) |
#define | MSEC_TO_USEC(ms) ((ms) * 1000) |
#define | SEC_TO_MSEC(s) ((s) * 1000) |
#define | SEC_TO_USEC(s) ((s) * 1000 * 1000) |
#define | BL_DETECT_BREAK_TO_BL_TIMER_WITH_VSENSE MSEC_TO_USEC(2) |
#define | BL_DETECT_BREAK_TO_BL_TIMER_NO_VSENSE MSEC_TO_USEC(500) |
#define | BL_WAIT_FOR_DFU_TIMER SEC_TO_USEC(6) |
#define | BL_RECOVER_FROM_FAULT_TIMER SEC_TO_USEC(10) |
Functions | |
enum dfu_partition_label | __attribute__ ((packed)) |
static uint32_t | bl_compute_partition_crc (uintptr_t partition_id, uint32_t partition_offset, uint32_t length) |
bool | bl_xfer_completed_p (const struct xfer_state *xfer) |
bool | bl_xfer_crc_ok_p (const struct xfer_state *xfer) |
bool | bl_xfer_read_start (struct xfer_state *xfer, const struct msg_xfer_start *xfer_start) |
bool | bl_xfer_send_next_read_packet (struct xfer_state *xfer) |
bool | bl_xfer_write_start (struct xfer_state *xfer, const struct msg_xfer_start *xfer_start) |
bool | bl_xfer_write_cont (struct xfer_state *xfer, const struct msg_xfer_cont *xfer_cont) |
bool | bl_xfer_wipe_partition (const struct msg_wipe_partition *wipe_partition) |
bool | bl_xfer_send_capabilities_self (void) |
static uint32_t | led_pwm_on_p (uint32_t pwm_period, uint32_t pwm_sweep_steps, uint32_t uptime, uint8_t *fraction) |
void | led_pwm_config (struct led_pwm_state *leds, uint32_t pwm_1_period_us, uint32_t pwm_1_sweep_steps, uint32_t pwm_2_period_us, uint32_t pwm_2_sweep_steps) |
void | led_pwm_add_ticks (struct led_pwm_state *leds, uint32_t elapsed_us) |
bool | led_pwm_update_leds (struct led_pwm_state *leds) |
void | PIOS_Board_Init (void) |
static void | go_fsm_fault (struct bl_fsm_context *context) |
static void | go_detect_break_to_bl (struct bl_fsm_context *context) |
static void | go_wait_for_dfu (struct bl_fsm_context *context) |
static void | go_jumping_to_app (struct bl_fsm_context *context) |
static void | go_dfu_idle (struct bl_fsm_context *context) |
static void | go_read_in_progress (struct bl_fsm_context *context) |
static void | go_write_in_progress (struct bl_fsm_context *context) |
static void | go_dfu_operation_ok (struct bl_fsm_context *context) |
static void | go_dfu_operation_failed (struct bl_fsm_context *context) |
static enum bl_states | bl_fsm_get_state (struct bl_fsm_context *context) |
static void | bl_fsm_timer_start (struct bl_fsm_context *context, uint32_t timer_duration_us) |
static void | bl_fsm_timer_cancel (struct bl_fsm_context *context) |
static void | bl_fsm_timer_add_ticks (struct bl_fsm_context *context, uint32_t elapsed_us) |
static bool | bl_fsm_timer_expired_p (struct bl_fsm_context *context) |
static void | bl_fsm_process_auto (struct bl_fsm_context *context) |
static void | bl_fsm_inject_event (struct bl_fsm_context *context, enum bl_events event) |
static void | bl_fsm_init (struct bl_fsm_context *context) |
static void | process_packet_rx (struct bl_fsm_context *context, const struct bl_messages *msg) |
int | main (void) |
static bool | bl_select_dfu_device (struct bl_fsm_context *context, uint8_t device_number) |
static bool | bl_send_status (struct bl_fsm_context *context) |
static bool | bl_send_capabilities (struct bl_fsm_context *context, uint8_t device_number) |
Variables | |
static const uint8_t | fsm_to_dfu_state_map [] |
bool | have_vsense |
static const struct bl_transition | bl_transitions [BL_STATE_NUM_STATES] |
Message definitions for the unified bootloader.
Unified bootloader main loop and FSM.
LED PWM emulation for the unified bootloader.
Data transfer functions for the unified bootloader.
#define BL_DETECT_BREAK_TO_BL_TIMER_NO_VSENSE MSEC_TO_USEC(500) |
#define BL_DETECT_BREAK_TO_BL_TIMER_WITH_VSENSE MSEC_TO_USEC(2) |
#define BL_INCLUDE_CAP_EXTENSIONS |
Definition at line 30 of file bl_messages.h.
#define BL_MSG_COMMAND_MASK 0x3F |
Definition at line 58 of file bl_messages.h.
#define BL_MSG_FLAGS_ECHO_REP 0x40 |
Definition at line 56 of file bl_messages.h.
#define BL_MSG_FLAGS_ECHO_REQ 0x80 |
Definition at line 55 of file bl_messages.h.
#define BL_MSG_FLAGS_MASK 0xC0 |
Definition at line 57 of file bl_messages.h.
#define BL_RECOVER_FROM_FAULT_TIMER SEC_TO_USEC(10) |
#define BL_WAIT_FOR_DFU_TIMER SEC_TO_USEC(6) |
enum bl_commands |
Definition at line 36 of file bl_messages.h.
enum bl_events |
enum bl_states |
enum dfu_partition_label |
Definition at line 64 of file bl_messages.h.
enum legacy_dfu_states |
enum dfu_partition_label __attribute__ | ( | (packed) | ) |
Definition at line 38 of file serial_4way.h.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
bool bl_xfer_completed_p | ( | const struct xfer_state * | xfer | ) |
bool bl_xfer_crc_ok_p | ( | const struct xfer_state * | xfer | ) |
bool bl_xfer_read_start | ( | struct xfer_state * | xfer, |
const struct msg_xfer_start * | xfer_start | ||
) |
bool bl_xfer_send_next_read_packet | ( | struct xfer_state * | xfer | ) |
bool bl_xfer_wipe_partition | ( | const struct msg_wipe_partition * | wipe_partition | ) |
bool bl_xfer_write_cont | ( | struct xfer_state * | xfer, |
const struct msg_xfer_cont * | xfer_cont | ||
) |
bool bl_xfer_write_start | ( | struct xfer_state * | xfer, |
const struct msg_xfer_start * | xfer_start | ||
) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
void led_pwm_add_ticks | ( | struct led_pwm_state * | leds, |
uint32_t | elapsed_us | ||
) |
void led_pwm_config | ( | struct led_pwm_state * | leds, |
uint32_t | pwm_1_period_us, | ||
uint32_t | pwm_1_sweep_steps, | ||
uint32_t | pwm_2_period_us, | ||
uint32_t | pwm_2_sweep_steps | ||
) |
|
static |
bool led_pwm_update_leds | ( | struct led_pwm_state * | leds | ) |
int main | ( | void | ) |
dRonin Main function:
Initialize PiOS
Create the "System" task (SystemModInitializein Modules/System/systemmod.c)
Start the RTOS Scheduler
CortexM3 CPU vectors
CortexM3 CPU vectors
void PIOS_Board_Init | ( | ) |
PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c
Initialise PWM Output for black/white level setting PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c
PIOS_Board_Init() initializes all the core subsystems on this specific hardware
PIOS_Board_Init() initializes all the core systems on this specific hardware called from System/openpilot.c
Definition at line 44 of file pios_board.c.
|
static |
|
static |
|
static |