Fix sernum entries for classic parts

This commit is contained in:
Stefan Rueger
2024-07-12 17:52:54 +01:00
parent 09d4dbb5b9
commit 6979fce1ee
2 changed files with 7 additions and 5 deletions

View File

@@ -6237,6 +6237,7 @@ part parent "m324p" # m324pb
memory "sernum"
size = 10;
offset = 0xe; # Sub-region of prodsig
read = "0 0 1 1 a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a4 a3 a2 a1 o o o o o o o o";
;
;
@@ -11045,6 +11046,7 @@ part parent "m328" # m328pb
memory "sernum"
size = 10;
offset = 0xe; # Sub-region of prodsig
read = "0 0 1 1 a0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 a4 a3 a2 a1 o o o o o o o o";
;
;
@@ -20451,7 +20453,7 @@ part parent ".reduced_core_tiny" # t102
memory "sernum"
size = 10;
offset = 0x6; # Sub-region of prodsig
offset = 0x3fc6; # Sub-region of prodsig
;
memory "io"
@@ -20499,7 +20501,7 @@ part parent ".reduced_core_tiny" # t104
memory "sernum"
size = 10;
offset = 0x6; # Sub-region of prodsig
offset = 0x3fc6; # Sub-region of prodsig
;
memory "io"

View File

@@ -374,7 +374,7 @@ part_def :
m->type &= and_mask;
// Remove MEM_IN_SIGROW attribute from classic calibration and classic/XMEGA signature mem
if(!(current_part->prog_modes & (PM_PDI|PM_UPDI))) {
if(current_part->prog_modes & PM_Classic) {
if(mem_is_signature(m))
m->type &= ~MEM_IN_SIGROW;
if(mem_is_calibration(m))
@@ -1396,11 +1396,11 @@ static int parse_cmdbits(OPCODE * op, int opnum)
case 'a':
sb = opnum == AVR_OP_LOAD_EXT_ADDR? bitno+8: bitno-8; // should be this number
if(bitno < 8 || bitno > 23) {
if(!current_mem || !mem_is_sigrow(current_mem)) // Known exemption
if(!current_mem || !mem_is_in_sigrow(current_mem)) // Known exemptions
yywarning("address bits don't normally appear in Bytes 0 or 3 of SPI commands");
} else if((bn & 31) != sb) {
if(!current_part || !str_casestarts(current_part->desc, "AT89S5")) // Exempt AT89S5x
if(!current_mem || !mem_is_sigrow(current_mem)) // and prodsig
if(!current_mem || !mem_is_in_sigrow(current_mem)) // ... and prodsig/sernum
yywarning("a%d would normally be expected to be a%d", bn, sb);
} else if(bn < 0 || bn > 31)
yywarning("invalid address bit a%d, using a%d", bn, bn & 31);