From 1822d113d9dca87d8be868b7860c1fdee7999988 Mon Sep 17 00:00:00 2001 From: graham sanderson Date: Fri, 19 Feb 2021 14:06:54 -0600 Subject: [PATCH] elf2uf2: fix breakage for no_flash builds; removep 0xFFFFFFFF constantds and error messsage --- tools/elf2uf2/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/elf2uf2/main.cpp b/tools/elf2uf2/main.cpp index 2913e07..fd5de65 100644 --- a/tools/elf2uf2/main.cpp +++ b/tools/elf2uf2/main.cpp @@ -255,18 +255,18 @@ int elf2uf2(FILE *in, FILE *out) { } uint page_num = 0; if (ram_style) { - uint32_t expected_ep_main_ram = 0xFFFFFFFF; - uint32_t expected_ep_xip_sram = 0xFFFFFFFF; + 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) ) { 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) ) { - expected_ep_xip_sram = pages.begin()->first | 0x1; + expected_ep_xip_sram = page_entry.first | 0x1; } } - uint32_t expected_ep = (0xFFFFFFFF != expected_ep_main_ram) ? expected_ep_main_ram : expected_ep_xip_sram; + uint32_t expected_ep = (UINT32_MAX != expected_ep_main_ram) ? expected_ep_main_ram : expected_ep_xip_sram; if (eh.entry == expected_ep_xip_sram) { - return fail(ERROR_INCOMPATIBLE, "B0/B1 Boot RAM errata prevents entry into XIP_SRAM\n"); + return fail(ERROR_INCOMPATIBLE, "B0/B1 Boot ROM does not support direct entry into XIP_SRAM\n"); } else if (eh.entry != expected_ep) { return fail(ERROR_INCOMPATIBLE, "A RAM binary should have an entry point at the beginning: %08x (not %08x)\n", expected_ep, eh.entry); }