From 268069e126a7604ca539236065533fc523155ac3 Mon Sep 17 00:00:00 2001 From: Tom Keddie Date: Wed, 5 Jun 2019 13:08:05 -0700 Subject: [PATCH 1/3] Add optional override of user flash image in dfu code --- sw/src/dfu.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sw/src/dfu.c b/sw/src/dfu.c index 8f7e9ee..785599a 100644 --- a/sw/src/dfu.c +++ b/sw/src/dfu.c @@ -26,8 +26,11 @@ #include #include - -#define RESCUE_IMAGE_OFFSET 262144 +#ifdef CONFIG_RESCUE_IMAGE_OFFSET +# define RESCUE_IMAGE_OFFSET CONFIG_RESCUE_IMAGE_OFFSET +#else +# define RESCUE_IMAGE_OFFSET 262144 +#endif #define RAM_BOOT_SENTINAL 0x17ab0f23 #define ERASE_SIZE 65536 // Erase block size (in bytes) @@ -305,4 +308,4 @@ bool dfu_abort(void) { set_state(dfuIDLE, OK); return true; -} \ No newline at end of file +} From 56e7fc09d9da33ce3e32755696ab116998db663a Mon Sep 17 00:00:00 2001 From: Tom Keddie Date: Wed, 5 Jun 2019 13:18:57 -0700 Subject: [PATCH 2/3] Remove warnings --- sw/src/dfu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sw/src/dfu.c b/sw/src/dfu.c index 1c209c6..0fda6a5 100644 --- a/sw/src/dfu.c +++ b/sw/src/dfu.c @@ -78,7 +78,7 @@ static void set_state(dfu_state_t new_state, dfu_status_t new_status) { dfu_status = new_status; } -static bool ftfl_busy() +static bool ftfl_busy(void) { if (ram_mode) return 0; @@ -87,7 +87,7 @@ static bool ftfl_busy() return spiIsBusy(spi); } -static void ftfl_busy_wait() +static void ftfl_busy_wait(void) { // Wait for the flash memory controller to finish any pending operation. while (ftfl_busy()) From c19d3d439c11f507d97fd25b3bfca08f2d1b8d91 Mon Sep 17 00:00:00 2001 From: Tom Keddie Date: Wed, 5 Jun 2019 13:21:41 -0700 Subject: [PATCH 3/3] Add explicit include of csr.h --- sw/src/dfu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sw/src/dfu.c b/sw/src/dfu.c index 0fda6a5..724a3fd 100644 --- a/sw/src/dfu.c +++ b/sw/src/dfu.c @@ -27,6 +27,7 @@ #include #include #include +#include #ifndef CONFIG_RESCUE_IMAGE_OFFSET # define CONFIG_RESCUE_IMAGE_OFFSET 262144