From: Keith Packard Date: Tue, 23 Apr 2013 02:08:35 +0000 (-0600) Subject: altos/stm-flash: Check target flash address against AO_BOOT_APPLICATION_BASE X-Git-Tag: 1.2.1~29 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=afad5ae893a48785f3b50ff4125dc78648343a2d;ds=sidebyside altos/stm-flash: Check target flash address against AO_BOOT_APPLICATION_BASE Allows that value to change Signed-off-by: Keith Packard --- diff --git a/src/stm-flash/ao_stm_flash.c b/src/stm-flash/ao_stm_flash.c index f0abe7fb..df06bb09 100644 --- a/src/stm-flash/ao_stm_flash.c +++ b/src/stm-flash/ao_stm_flash.c @@ -86,7 +86,7 @@ ao_block_write(void) } u; uint16_t i; - if (addr < 0x08002000 || 0x08200000 <= addr) { + if (addr < (uint32_t) AO_BOOT_APPLICATION_BASE) { ao_put_string("Invalid address\n"); return; } diff --git a/src/stm/ao_arch.h b/src/stm/ao_arch.h index cc83eac2..757b5251 100644 --- a/src/stm/ao_arch.h +++ b/src/stm/ao_arch.h @@ -129,7 +129,7 @@ extern const uint32_t ao_radio_cal; void ao_adc_init(); -#define AO_BOOT_APPLICATION_BASE ((uint32_t *) 0x1000) +#define AO_BOOT_APPLICATION_BASE ((uint32_t *) 0x08001000) #define AO_BOOT_LOADER_BASE ((uint32_t *) 0x0) #define HAS_BOOT_LOADER 1