• AVR Freaks

Hot!Not able to find in which memory are the bootloader code is programmed.

Author
kblb@0910
New Member
  • Total Posts : 10
  • Reward points : 0
  • Joined: 2019/04/30 03:34:45
  • Location: 0
  • Status: offline
2019/05/14 22:55:23 (permalink)
0

Not able to find in which memory are the bootloader code is programmed.

I am new to the PIC32 controllers and MPLAB x IDE.
I am generating USART bootloader using Microchip harmony configurator. When I am flashing this code into the controller I am getting following messages
"The following memory area(s) will be programmed:
boot config memory
configuration memory
Programming/Verify complete"
But I am not sure where exactly the Bootloader is  programmed.
How can I find the memory area where the bootloader is programmed using MPLAB x IDE?
#1

12 Replies Related Threads

    GreenDragonSA
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2012/04/16 01:44:33
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 00:30:29 (permalink)
    0
    Hello kblb@0910
     
    Normally you can find the locations in the datasheet.
     
     

     
    Never used the 32 bootloader but I always set the program location for 18F and dsPIC33 series.
     
    Hope this help
     
    #2
    kblb@0910
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/30 03:34:45
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 00:58:38 (permalink)
    0
    Hi GreenDragon,
    I tried by setting the range that is mentioned in the datasheet for Boot flash while programming the bootloader but programming is failed and I am getting following error.
     
    Failed to program device
    The selected program range, BFC00000-BFC73FFF, does not fall within the proper range for the memory area selected. Please check the manual program ranges on the debug tool's, "Memories to Program" property page.
     
    #3
    GreenDragonSA
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2012/04/16 01:44:33
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 01:04:00 (permalink)
    0
    What PIC32 are you using?
     
    Also can you show the linker scrip or method you used to select the memory area?
    #4
    kblb@0910
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/30 03:34:45
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 04:06:54 (permalink)
    0
    I am using PIC32MZ2048EFH144 controller.
    I am sharing the Linker file as well as in setting where I am changing the memory location in MPLAB X IDE.
    post edited by kblb@0910 - 2019/05/15 04:09:10

    Attached Image(s)

    #5
    Paul PortSol
    Super Member
    • Total Posts : 430
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 04:32:19 (permalink)
    0
    Don't mess with the settings, leave them as defaults.
    For first stab let MHC create the linker file, and let ICD3 pick the memory ranges.
    Careful about BSP setting in MHC - MHC may enable BSP when select some modules, and there can be issues disabling BSP depending on the Bootloader type (I have submitted tickets about this).
     
    If you are going to create custom bootloader protocol and matching app then come back with details and we'll share our latest experience. I only just got my custom UART Bootloader protocol running on PIC32MX and PIC32MZ with control flags in NVM/FLASH, and simple Load from USB for PIC32MZ - it wasn't easy!
     
    Always provide versions of:
    PIC32... full part number
    MPLABXv5.15 ?
    XC32v215 ?
    HarmonyV2.06 ?   (If using new Haremony3 please be in subject line: Hv3)
    MHCv2060 ? (Must be Matched to harmony version)
     
    Paul
     
    post edited by Paul PortSol - 2019/05/15 05:35:04
    #6
    GreenDragonSA
    New Member
    • Total Posts : 14
    • Reward points : 0
    • Joined: 2012/04/16 01:44:33
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 07:33:32 (permalink)
    0
    I agree with Paul.
     
    Was that a default linker or one that you edited?
     
    Try maybe just using the default linker file.
     
    @Paul I never worked with the PIC32 boot loader before. But nice to see that there is allocated memory for it.
    Do you just select the Boot and config for your boot loader program?
     

    Attached Image(s)

    #7
    Jim Nickerson
    User 452
    • Total Posts : 5892
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 08:13:43 (permalink)
    0
    I find the "ELFViewer" plugin of use in knowing what goes where

    Attached Image(s)

    #8
    Paul PortSol
    Super Member
    • Total Posts : 430
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/15 10:06:20 (permalink)
    0
    @GreenDragonSA/frikkiemarais
     
    Those options are grayed out since I use "Let ICD select memories", even when I do custom Bootloader protocol and Apps.
    The programmer seems to properly follow the Linker script, so I happily don't mess with those settings.
     
    *If you have messed with the settings you might need to start a fresh project to truly get back to defaults. My experience tells me to start fresh when things get weird, I'm not into debugging the Microchip tools themselves - too much on my plate already.
     
    Paul
    #9
    kblb@0910
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/30 03:34:45
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/16 19:32:39 (permalink)
    0
    Hi Paul,
     
    "Don't mess with the settings, leave them as defaults.
    For first stab let MHC create the linker file, and let ICD3 pick the memory ranges.
    Careful about BSP setting in MHC - MHC may enable BSP when select some modules, and there can be issues disabling BSP depending on the Bootloader type (I have submitted tickets about this)."
     
    Thanks for your suggestion.
     
    " MPLABXv5.15 ?
    XC32v215 ?
    HarmonyV2.06 ?   (If using new Haremony3 please be in subject line: Hv3)
    MHCv2060 ? (Must be Matched to harmony version)"

     
    Early I used PIC32MZ2048EFH144 controller but now I am using PIC32MZ2048EFH064 controller.
    I am using:
    Harmony v2.06, MPLABXv5.15 and XC32v215 compiler.
    So I generated the USART bootloader code using the harmony v2.06 for PIC32MZ2048EFH064 controller.  Now I am facing a issue where I am not able use the USART to print the values on the "teraterm" UART terminal. I want to create a custom bootloader which supports UART interface using this Harmony generated bootloader. 
     
    My controller is having pins on the board which supports for UART4, so I tried to map USART to UART4 base address by making following changes.
    I have changed from 
    PLIB_USART_InitializeOperation(USART_ID_1,
    USART_RECEIVE_FIFO_ONE_CHAR,
    USART_TRANSMIT_FIFO_IDLE,
    USART_ENABLE_TX_RX_USED);
     
    to
    PLIB_USART_InitializeOperation(USART_ID_4,
    USART_RECEIVE_FIFO_ONE_CHAR,
    USART_TRANSMIT_FIFO_IDLE,
    USART_ENABLE_TX_RX_USED);
     
    Please suggest me how to proceed further and how can I implement UART functionality in this as harmony configurator v2.06 not supporting UART driver in it.
     
    Kishor.
     
    post edited by kblb@0910 - 2019/05/16 23:22:57
    #10
    kblb@0910
    New Member
    • Total Posts : 10
    • Reward points : 0
    • Joined: 2019/04/30 03:34:45
    • Location: 0
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/17 02:48:22 (permalink)
    0
    @GreenDragonSA
     
    In that attached image I just changed Program memory range area except that all are default only.
     
    #11
    Paul PortSol
    Super Member
    • Total Posts : 430
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/21 05:36:27 (permalink)
    0
    Danger... You are messing with MHC generated code.
    Don't change the MHC generated code (unless you are 100% sure what you are fixing), 
    instead in MHC change the UART settings for the first UART (UART Instance and UART ID are different, one is software, one is hardware, and the naming isn't so clear so be careful, but basically you can map each software UART to any Hardware UART).
     
    Also for diagnostics.... Add a second UART and direct your diag to it so it doesn't mess with the bootloader protocol.
    (When you are more familiar with what's happening then you can decide to put all on one UART).
     
    To direct printf() to your own UART write your own _mon_putc() that will override the low priority one in the libraries, something like:
    void _mon_putc(char cData)//Redirect STDOUT to Diag (Used by printf, etc.)
    {// Ref: [microchipdeveloper.com/xc32:redirect-stdout]
         vDiagTx(cData);//Your own code here
    }
     
    Alternately you can set up a USB CDC Virtual Console, I haven't used it but I understand that with some PIC32 and appropriate programmer/debugger tool you can add a console without any real hardware. There are other posts and tutorials that discuss it.
     
    Paul
    #12
    Paul PortSol
    Super Member
    • Total Posts : 430
    • Reward points : 0
    • Joined: 2015/07/03 11:52:03
    • Location: Newfoundland, Canada
    • Status: offline
    Re: Not able to find in which memory are the bootloader code is programmed. 2019/05/21 05:38:24 (permalink)
    0
    ((previous submitted as 'x' then edited with real message to get past the blocked message bug))
    #13
    Jump to:
    © 2019 APG vNext Commercial Version 4.5