Add fuses, usersig, userrow, signature and data to elf_mem_limits()

This commit is contained in:
Stefan Rueger 2022-12-10 23:28:56 +00:00
parent 6b03d7dc5a
commit db0258a7d8
No known key found for this signature in database
GPG Key ID: B0B4F1FD86B1EC55
1 changed files with 14 additions and 2 deletions

View File

@ -730,11 +730,15 @@ static int elf_mem_limits(const AVRMEM *mem, const AVRPART *p,
*lowbound = 0; *lowbound = 0;
*highbound = 0x7Fffff; // Max 8 MiB *highbound = 0x7Fffff; // Max 8 MiB
*fileoff = 0; *fileoff = 0;
} else if (strcmp(mem->desc, "data") == 0) { // Volatile SRAM for XMEGA (not the .data section)
*lowbound = 0x802000;
*highbound = 0x80ffff;
*fileoff = 0;
} else if (strcmp(mem->desc, "eeprom") == 0) { } else if (strcmp(mem->desc, "eeprom") == 0) {
*lowbound = 0x810000; *lowbound = 0x810000;
*highbound = 0x81ffff; // Max 64 KiB *highbound = 0x81ffff; // Max 64 KiB
*fileoff = 0; *fileoff = 0;
} else if (strcmp(mem->desc, "lfuse") == 0) { } else if (strcmp(mem->desc, "lfuse") == 0 || strcmp(mem->desc, "fuses") == 0) {
*lowbound = 0x820000; *lowbound = 0x820000;
*highbound = 0x82ffff; *highbound = 0x82ffff;
*fileoff = 0; *fileoff = 0;
@ -752,10 +756,18 @@ static int elf_mem_limits(const AVRMEM *mem, const AVRPART *p,
*lowbound = 0x820000; *lowbound = 0x820000;
*highbound = 0x82ffff; *highbound = 0x82ffff;
*fileoff = mem->desc[4] - '0'; *fileoff = mem->desc[4] - '0';
} else if (strncmp(mem->desc, "lock", 4) == 0) { } else if (strncmp(mem->desc, "lock", 4) == 0) { // Lock or lockbits
*lowbound = 0x830000; *lowbound = 0x830000;
*highbound = 0x83ffff; *highbound = 0x83ffff;
*fileoff = 0; *fileoff = 0;
} else if (strcmp(mem->desc, "signature") == 0) { // Read only
*lowbound = 0x840000;
*highbound = 0x84ffff;
*fileoff = 0;
} else if (strncmp(mem->desc, "user", 4) == 0) { // Usersig or userrow
*lowbound = 0x850000;
*highbound = 0x85ffff;
*fileoff = 0;
} else { } else {
rv = -1; rv = -1;
} }