Hot!PIC32MZ Bootloader Panels Memory Size?

Author
mrpackethead
packet mangler
  • Total Posts : 913
  • Reward points : 0
  • Joined: 2007/04/01 23:33:39
  • Location: 0
  • Status: offline
2017/11/23 00:43:00 (permalink)
0

PIC32MZ Bootloader Panels Memory Size?

In the harmony documentation ( 2.04 ) it says "For PIC32MZ devices, with two 80 KB Boot Flash panels...
 
When i set up a basic bootloader, the linker reserves 193408 bytes..  that is somewhat more than 2 x 80KB.  I remember reading somewhere that there was historically a 16KB block at the top of each panel that coud'nt be accessed.  but that is now resolved?

What i'm doign is adding adding AES based hardware decryption for the bootloader.  this means that it is possible to encrypt an image so it is keyed to a specific bit of hardware, but its goign to use most of the avaiable memory..  I'm up to 151K to get the librarys in, with optimization level 1.     AT 2x 80KB i think i'd fail but at 193K i'm be ok.


 
 
 

Attached Image(s)

#1

6 Replies Related Threads

    Larry.Standage
    Moderator
    • Total Posts : 773
    • Reward points : 0
    • Joined: 2011/12/30 09:50:47
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/24 17:13:29 (permalink)
    0
    The 16K is at the top of the second boot panel, and it would be hard to access it with one space. With the combined linker script, there would be (80K * 2) - 0x100*2 (Config Space) -16K = 146944.
     
    The extra was probably because of the space between the boot flash panels.
     
    If you're willing to go through a little headache, you could set up the 16K space as a separate section in the linker, and put specific files there.
     
    All told, keeping out of the config spaces, there should be 163328 bytes of usable boot space.
    #2
    mrpackethead
    packet mangler
    • Total Posts : 913
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/24 19:13:17 (permalink)
    0
    Thanks Larry, I'm a bit confused though, why is the linker reserved program 193408 bytes ( see the attached picture above ).
     
     
    #3
    Larry.Standage
    Moderator
    • Total Posts : 773
    • Reward points : 0
    • Joined: 2011/12/30 09:50:47
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/24 23:10:28 (permalink)
    0
    It seems to be picking it up from the ELF or the linker script. The linker script specifies that the length of kseg0_program_mem is 0x2FF00 - 0x1000, which comes out to 0x2EF00 (decimal 192256). But the IDE seems to be ignoring the fill command, which blocks out the unimplemented area.
    #4
    mrpackethead
    packet mangler
    • Total Posts : 913
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/25 02:01:29 (permalink)
    0
    Does this mean that it's possible to compile some code that will actually be bigger than what is actually possible to run?
    #5
    mrpackethead
    packet mangler
    • Total Posts : 913
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/25 18:29:42 (permalink)
    0
    So, what do I do to get these extra 16k bytes of memory?   


    protected_reg3           : ORIGIN = 0x9FC14000, LENGTH = 0x20000-0x14000
     
    .fill1 :
    {
    FILL(0xFF);
    . = ORIGIN(protected_reg3) + LENGTH(protected_reg3) - 1;
    BYTE(0xFF)

    } > protected_reg3
    20000-0x14000
    #6
    mrpackethead
    packet mangler
    • Total Posts : 913
    • Reward points : 0
    • Joined: 2007/04/01 23:33:39
    • Location: 0
    • Status: offline
    Re: PIC32MZ Bootloader Panels Memory Size? 2017/11/25 19:01:49 (permalink)
    0
    Had a bit of an idea, that i'd see what happens when i compiled my code with a bit of optimization
     
    146944  <--- number of bytes avaialble

    0 - can't compile
    1 - 151628
    2 - 153332
    3 - 170412
    s - 145284

    Looks like 's' will just scrape in.. though i am keep to see what else i can loose.
     
    #7
    Jump to:
    © 2018 APG vNext Commercial Version 4.5