altos/stm-flash: Check target flash address against AO_BOOT_APPLICATION_BASE
authorKeith Packard <keithp@keithp.com>
Tue, 23 Apr 2013 02:08:35 +0000 (20:08 -0600)
committerKeith Packard <keithp@keithp.com>
Tue, 23 Apr 2013 02:08:35 +0000 (20:08 -0600)
Allows that value to change

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm-flash/ao_stm_flash.c
src/stm/ao_arch.h

index 15f121238319756fecd949a553409f2d8beb4a2c..47575a77ca35af0d4a530cba4445937c345a742d 100644 (file)
@@ -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;
        }
index 788d21a419845e13bc2d8cee8448a5050d069f64..50bff5dd35be30aa5bc7cc845abd04cd38eade57 100644 (file)
@@ -128,7 +128,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