deployer: Wait 100ms before overwriting existing bootloader

If the power supply isn't fully stable or the reset line is glitchy
then there may be a few reboots before the mcu becomes stable.  If the
deployer runs during this unstable period, it may erase the existing
bootloader, but not be able to fully write the new bootloader.

Wait a 100ms before erasing the existing bootloader in an effort to
avoid this situation.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2022-08-03 15:15:33 -04:00 committed by Eric Callahan
parent f4ac6470bf
commit 1b71e856a4

View File

@ -77,6 +77,10 @@ sched_main(void)
halt();
}
// Wait 100ms to help ensure power supply is stable before
// overwriting existing bootloader
udelay(100000);
// Write CanBoot to flash
const uint8_t *p = deployer_canboot_binary, *end = &p[cbsize];
while (p < end) {