Skip to content

Commit

Permalink
px4io: set safety on before going into bootloader (#4860)
Browse files Browse the repository at this point in the history
Sometimes when flashing new firmware, the IO update fails because safety
is off. In this case, we should set safety on first before putting the
IO board into bootloader mode.
  • Loading branch information
julianoes authored and LorenzMeier committed Jun 21, 2016
1 parent a031f6e commit 403d76c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/drivers/px4io/px4io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,12 @@ PX4IO::init()
// be due to mismatched firmware versions and we want
// the startup script to be able to load a new IO
// firmware

// If IO has already safety off it won't accept going into bootloader mode,
// therefore we need to set safety on first.
io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_FORCE_SAFETY_ON, PX4IO_FORCE_SAFETY_MAGIC);

// Now the reboot into bootloader mode should succeed.
io_reg_set(PX4IO_PAGE_SETUP, PX4IO_P_SETUP_REBOOT_BL, PX4IO_REBOOT_BL_MAGIC);
return -1;
}
Expand Down

0 comments on commit 403d76c

Please sign in to comment.