Hot!Building Harmony Based Boot Loaders

Author
Michael Karas
Starting Member
  • Total Posts : 57
  • Reward points : 0
  • Joined: 2015/03/25 01:08:36
  • Location: 0
  • Status: offline
2018/02/12 17:10:33 (permalink)
0

Building Harmony Based Boot Loaders

I have a couple of questions regarding building a boot loader for a Harmony sample project. One of the options in the Harmony configuration is to Build the Boot Loader versus a Linker Script. I fully understand what the "Build the boot loader" is all about. It creates the run time for the boot loader code itself that gets loaded into the PIC32 MCU in the boot loader portion of the Flash Memory address map. From there it is possible to load and debug the boot loader code itself.
 
What I do not understand is what the "Linker script" option is for and how it is supposed to be used. Could someone who is familiar with this please explain to me what this "Linker script' is and how it is to be used?
 
I also want to understand a peripheral issue of how one goes about creating a merged executable that combines the bootloader binary with an application binary so that they can both be used together to perform initial programming of a PIC32 part using a tool such as the Microchip IPE tool with the ICD3.
 
post edited by Michael Karas - 2018/02/12 17:58:31
#1

7 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 15829
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Building Harmony Based Boot Loaders 2018/02/12 19:53:10 (permalink)
    0
    The Main program / Application can not overlap the Bootloader.  The Linker script insures that its code is not in the same place as the bootloader.
    #2
    Michael Karas
    Starting Member
    • Total Posts : 57
    • Reward points : 0
    • Joined: 2015/03/25 01:08:36
    • Location: 0
    • Status: offline
    Re: Building Harmony Based Boot Loaders 2018/02/13 01:35:53 (permalink)
    0
    Your answer does not really get to the root of the linker script and now it is used and applied.
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 15829
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Building Harmony Based Boot Loaders 2018/02/13 06:14:21 (permalink)
    0
    The “app” linker script generated by the bootloader must be added to the main programs project in the MPLabX linker script “folder” note that project will no longer run stand alone with the script. You may want to make a seperate build configuration for it , or all a bootloader stub.
    #4
    friesen
    Super Member
    • Total Posts : 1881
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: online
    Re: Building Harmony Based Boot Loaders 2018/02/13 10:09:08 (permalink)
    0
    The bootloader linker uses bootflash, and puts interrupt vector tables there, etc.  The standard linker puts it there too.  So you have to use a different application linker so they don't overlap.  Nkurzman's first answer really is correct here, but it may take a bit to digest this.
     
    Do you have a clear concept of what the linker script does?
     
    To combine into a single hex file, you pretty much just need to add the bootloader project to your application project. Project->Properties->Loading.  If you get any linker warnings after doing this, don't ignore them.

    Erik Friesen
    #5
    jeevanjee
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2018/03/13 09:51:00
    • Location: 0
    • Status: offline
    Re: Building Harmony Based Boot Loaders 2018/05/23 09:54:19 (permalink)
    0
    Following up on building bootloader with harmony I have some other questions:
     
    1. If you are running short of space in boot flash is it possible to increase the boot code size by using some portion of program memory?
     
    2. What is the maximum size of boot flash for PIC32MK and PIC32MZ ?
     
    3. PIC32 seems to have two segments of boot flash memory. When building a bootloader code using harmony how can we make sure the linker uses both the segments?
     
     
     
     
    #6
    friesen
    Super Member
    • Total Posts : 1881
    • Reward points : 0
    • Joined: 2008/05/08 05:23:35
    • Location: Indiana, USA
    • Status: online
    Re: Building Harmony Based Boot Loaders 2018/05/23 10:07:36 (permalink)
    0
    @jeevanjee you really should start a new thread for these questions.
     
    1. Yes
    2. It depends on the MCU
    3. Yes, you can use both segments if you aren't doing live flash udpates.

    Erik Friesen
    #7
    jeevanjee
    New Member
    • Total Posts : 15
    • Reward points : 0
    • Joined: 2018/03/13 09:51:00
    • Location: 0
    • Status: offline
    Re: Building Harmony Based Boot Loaders 2018/05/23 10:51:48 (permalink)
    0
    Thanks Erik!
     
    So if answer to questions 1 and 3 is yes then how do I do it?  Is there a document that describes the procedure? I am compiling the boot code on PIC32MK and the linker fails if my bootloader code size goes beyond 12K.
     
    Thanks again!
    #8
    Jump to:
    © 2018 APG vNext Trial Version 4.5