Fix usage of RAMEND

RAMEND is the last valid address, not one-past as I expected it to be...
This commit is contained in:
Yuri D'Elia 2021-06-12 13:16:12 +02:00
parent f18d4757c6
commit f7dc8dcaef
3 changed files with 4 additions and 4 deletions

View file

@ -278,7 +278,7 @@ void dcode_1()
*/
void dcode_2()
{
dcode_core(RAMSTART, RAMEND, dcode_mem_t::sram, 2, _N("SRAM"));
dcode_core(RAMSTART, RAMEND+1, dcode_mem_t::sram, 2, _N("SRAM"));
}
#endif

View file

@ -7,7 +7,7 @@
#include <inttypes.h>
#define RAMSIZE (RAMEND-RAMSTART)
#define RAMSIZE (RAMEND+1-RAMSTART)
#define boot_src_addr (*((uint32_t*)(RAMSIZE - 16)))
#define boot_dst_addr (*((uint32_t*)(RAMSIZE - 12)))
#define boot_copy_size (*((uint16_t*)(RAMSIZE - 8)))

View file

@ -63,7 +63,7 @@ static void xfdump_dump_core(dump_header_t& hdr, uint32_t addr, uint8_t* buf, ui
xflash_wait_busy();
// write data
static_assert(sizeof(dump_t::data) <= RAMEND, "dump area size insufficient");
static_assert(sizeof(dump_t::data) <= RAMEND+1, "dump area size insufficient");
xflash_multipage_program(addr, buf, cnt);
}
@ -96,7 +96,7 @@ void xfdump_full_dump_and_reset(dump_crash_reason reason)
wdt_enable(WDTO_500MS);
// write all addressable ranges (this will trash bidirectional registers)
xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data), 0, RAMEND);
xfdump_dump_core(buf, DUMP_OFFSET + offsetof(dump_t, data), 0, RAMEND+1);
// force a reset even sooner
softReset();