From 63ff3483d5e00658cd743169f412cdcd80212956 Mon Sep 17 00:00:00 2001 From: Peter Lawrence <12226419+majbthrd@users.noreply.github.com> Date: Mon, 22 Feb 2021 15:17:39 -0600 Subject: [PATCH] elf2uf2: fix address range bug --- tools/elf2uf2/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/elf2uf2/main.cpp b/tools/elf2uf2/main.cpp index fd5de65..07cd107 100644 --- a/tools/elf2uf2/main.cpp +++ b/tools/elf2uf2/main.cpp @@ -258,9 +258,9 @@ int elf2uf2(FILE *in, FILE *out) { uint32_t expected_ep_main_ram = UINT32_MAX; uint32_t expected_ep_xip_sram = UINT32_MAX; for(auto& page_entry : pages) { - if ( ((page_entry.first >= MAIN_RAM_START) && (page_entry.first < (MAIN_RAM_START + MAIN_RAM_END))) && (page_entry.first < expected_ep_main_ram) ) { + if ( ((page_entry.first >= MAIN_RAM_START) && (page_entry.first < MAIN_RAM_END)) && (page_entry.first < expected_ep_main_ram) ) { expected_ep_main_ram = page_entry.first | 0x1; - } else if ( ((page_entry.first >= XIP_SRAM_START) && (page_entry.first < (XIP_SRAM_START + XIP_SRAM_END))) && (page_entry.first < expected_ep_xip_sram) ) { + } else if ( ((page_entry.first >= XIP_SRAM_START) && (page_entry.first < XIP_SRAM_END)) && (page_entry.first < expected_ep_xip_sram) ) { expected_ep_xip_sram = page_entry.first | 0x1; } }