From 5b9a07c92f70f0a72b199a033e6a6b68798089d1 Mon Sep 17 00:00:00 2001 From: Shawn Nock Date: Tue, 18 Jun 2019 15:10:14 -0400 Subject: [PATCH] Always run subsequent upload in fast_mode after bootloader upgrade --- src/image.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/image.c b/src/image.c index 5ba1e58..6077d11 100644 --- a/src/image.c +++ b/src/image.c @@ -405,6 +405,7 @@ void do_upload(char *filename, bool fast_mode){ void fix_and_upload(char *filename) { char *version = get_version(); + bool has_new_bootloader = false; if (version && !strcmp(version, "0.3.2.0") ) { // Upload bootloader update payload printf("Bootloader update required, uploading...\n"); @@ -424,11 +425,12 @@ void fix_and_upload(char *filename) { printf("Reseting into new bootloader\n"); gpio_ble_req_bootloader(); usleep(50000); + has_new_bootloader = true; } // Do the update printf("Writing %s into slot 1\n", filename); - do_upload(filename, image_get_fast_mode()); + do_upload(filename, image_get_fast_mode() || has_new_bootloader); // If we just updated the BL, it supports fast } void image_main(int fd, int argc, char **argv){