mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 09:01:35 +00:00
Fix image copy detection
When the flash base address is not zero (e.g. STM32L chip), the current image index is wrongly computed. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BUG=None TEST=check it compiles for all boards, run on Discovery board and see proper value. Change-Id: I06f5508cdffce6d754bd93e870d64087d299c9c7
This commit is contained in:
@@ -51,7 +51,8 @@ const char *system_get_reset_cause_string(void)
|
||||
|
||||
enum system_image_copy_t system_get_image_copy(void)
|
||||
{
|
||||
int copy = (uint32_t)system_get_image_copy / CONFIG_FW_IMAGE_SIZE;
|
||||
int copy = ((uint32_t)system_get_image_copy - CONFIG_FLASH_BASE) /
|
||||
CONFIG_FW_IMAGE_SIZE;
|
||||
switch (copy) {
|
||||
case 0:
|
||||
return SYSTEM_IMAGE_RO;
|
||||
|
||||
Reference in New Issue
Block a user