Menu

#316 incorrect linear_ram_addrs

None
closed-rejected
None
1
2022-02-16
2020-11-01
Ben Tesch
No

It appears that the pic12f1571 has an incorrect ending address for linear_ram_addrs in static struct px pics[] in gpprocessor.c. The end address is 0x206F, indicating 112 general purpose registers, but per the datasheet, this processor has 128 general purpose registers. I think the end address should be 0x207F.

The entry for the pic12F1572 has a linear_ram_addrs end address of 0x20EF, which matches the 240 general purpose registers indicated by the datasheet.

The entry for the pic12F1822 has a linear_ram_addrs end address of 0x206F, matching the 112 general purpose registers indicated by its datasheet. Hopefully the 12F1571 definition is an isolated copy/paste error.

1 Attachments

Discussion

  • Ben Tesch

    Ben Tesch - 2020-11-01

    The form only accepts one attachment at a time. I can do two here because it lets me edit comments, but I don't think I can edit the original request...

     

    Last edit: Ben Tesch 2020-11-01
  • Robert Pearce

    Robert Pearce - 2022-02-11

    The datasheet is inconsistent and GPUtils is correct, I believe. If you look closely at your third attachment, the one that shows "48 bytes" of RAM in page 1, you'll see that the address range is A0 to BF - which is only 32 bytes and matches the 1822. Since the datasheet also specifies that the 1571 has 128 bytes RAM in total, including the 16 bytes shared RAM, the 112 byte linear region is correct.

     
  • Molnár Károly

    Molnár Károly - 2022-02-13
    • assigned_to: Molnár Károly
     
  • Molnár Károly

    Molnár Károly - 2022-02-13

    It appears that the pic12f1571 has an incorrect ending address for linear_ram_addrs in static struct px pics[] in gpprocessor.c. The end address is 0x206F, indicating 112 general purpose registers, but per the datasheet, this processor has 128 general purpose registers. I think the end address should be 0x207F.

    The linear memory size is indeed incorrect. This is because the lkr file used as the source also contains incorrect data:

    // File: 12f1571_g.lkr
    // Generic linker script for the PIC12F1571 processor
    
    LIBPATH .
    
    CODEPAGE   NAME=page0      START=0x0               END=0x3FF
    CODEPAGE   NAME=.idlocs    START=0x8000            END=0x8003         PROTECTED
    CODEPAGE   NAME=.devid     START=0x8006            END=0x8006         PROTECTED
    CODEPAGE   NAME=.config    START=0x8007            END=0x8008         PROTECTED
    
    LINEARMEM  NAME=linear0    START=0x2000            END=0x206F         PROTECTED
    
    DATABANK   NAME=sfr0       START=0x0               END=0x1F           PROTECTED
    .
    .
    .
    

    The content of struct px pics[] is generated by a script based on the content of the inc and lkr files. That's why the error may have been introduced. I need to correct the lkr files. There have been examples of this before.

     
  • Molnár Károly

    Molnár Károly - 2022-02-13

    Thanks for the bug report. Version [r1326] is now free of this bug.

     

    Related

    Commit: [r1326]

  • Molnár Károly

    Molnár Károly - 2022-02-13
    • status: open --> closed-fixed
     
  • Robert Pearce

    Robert Pearce - 2022-02-15

    I'm sorry to say this but this "fix" needs reverting as the bug report is in error.

     
  • Molnár Károly

    Molnár Károly - 2022-02-16
    • status: closed-fixed --> closed-rejected
     
  • Molnár Károly

    Molnár Károly - 2022-02-16

    The relevant page of the datasheet contains misleading information.

     

Anonymous
Anonymous

Add attachments
Cancel