• AVR Freaks

Issue with PSV not being set

Author
DuaneH
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2009/10/15 11:49:22
  • Location: Sandy, UT
  • Status: offline
2019/09/19 10:32:26 (permalink)
0

Issue with PSV not being set

I'm a newbie to these forums, but not to Microchip. I have a bootloader that insists on putting constants and strings at the upper end of my code, well out of the range of PSV page 0.  Although the strings are defined as auto_psv, there is nothing in the generated code that actually sets the PSVPAG register. When I am single-stepping through the code, if I set PSVPAG to 1, then everything works ok, so the only issue is that the generated code is not managing PSVPAG as it is supposed to.
Processor: 24FJ256GA106
Compiler XC16 1.40
LARGE code, data and scalar models
Any ideas on what I would be missing that is preventing the PSVPAG from being managed as it should?

duaneh
#1

1 Reply Related Threads

    aschen0866
    Super Member
    • Total Posts : 4504
    • Reward points : 0
    • Joined: 2006/01/08 22:18:32
    • Location: San Diego
    • Status: offline
    Re: Issue with PSV not being set 2019/09/19 19:27:08 (permalink)
    0
    You shouldn't need to manipulate PSVPAG. If you define a mapping for .const input section, the linker should respect.
     
    In my PIC24FJ256GA106 bootloader, I use the last page for auto_psv because I have graphic to support.

    MEMORY
    {
    data(a!xr) : ORIGIN = 0x800, LENGTH = 0x4000
    reset : ORIGIN = 0x0, LENGTH = 0x4
    ivt : ORIGIN = 0x4, LENGTH = 0xFC
    aivt : ORIGIN = 0x104, LENGTH = 0xFC
    program(xr) : ORIGIN = 0x200, LENGTH = 0xE00
    last_block : ORIGIN = 0x2A800, LENGTH = 0x3F8
    config3 : ORIGIN = 0x2ABFA, LENGTH = 0x2
    config2 : ORIGIN = 0x2ABFC, LENGTH = 0x2
    config1 : ORIGIN = 0x2ABFE, LENGTH = 0x2
    }
     
    SECTIONS
    {
    ...
    /* Force all const data to go to the last PM page */
    .const :
    {
    *(.const);
    } >last_block
    ...
    }
     

    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5