Browse Source

HAL_ChibiOS: ensure bootloader flash is multiple of 32 bytes

master
Andrew Tridgell 5 years ago
parent
commit
9c6cd15980
  1. 3
      libraries/AP_HAL_ChibiOS/Util.cpp

3
libraries/AP_HAL_ChibiOS/Util.cpp

@ -178,6 +178,9 @@ bool Util::flash_bootloader() @@ -178,6 +178,9 @@ bool Util::flash_bootloader()
return false;
}
// make sure size is multiple of 32
fw_size = (fw_size + 31U) & ~31U;
const uint32_t addr = hal.flash->getpageaddr(0);
if (!memcmp(fw, (const void*)addr, fw_size)) {
hal.console->printf("Bootloader up-to-date\n");

Loading…
Cancel
Save