diff --git a/common/system_common.c b/common/system_common.c index 8e71052b23..f791745c0d 100644 --- a/common/system_common.c +++ b/common/system_common.c @@ -164,7 +164,7 @@ const char *system_get_reset_cause_string(void) enum system_image_copy_t system_get_image_copy(void) { - uint32_t my_addr = (uint32_t)system_get_image_copy; + uint32_t my_addr = (uint32_t)system_get_image_copy - CONFIG_FLASH_BASE; if (my_addr >= CONFIG_SECTION_RO_OFF && my_addr < (CONFIG_SECTION_RO_OFF + CONFIG_SECTION_RO_SIZE)) diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 30a5446891..b1e9c71127 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -5,7 +5,7 @@ #include "config.h" #define FW_OFF_(section) CONFIG_FW_##section##_OFF -#define FW_OFF(section) FW_OFF_(section) +#define FW_OFF(section) (CONFIG_FLASH_BASE + FW_OFF_(section)) #define FW_SIZE_(section) CONFIG_FW_##section##_SIZE #define FW_SIZE(section) FW_SIZE_(section)