Hot!Bootloader for PIC32MX150F128B

Page: 12 > Showing page 1 of 2
Author
p_stoyanoff
Starting Member
  • Total Posts : 36
  • Reward points : 0
  • Joined: 2011/06/30 00:23:55
  • Location: 0
  • Status: offline
2017/09/15 09:32:59 (permalink)
0

Bootloader for PIC32MX150F128B

Greetings! I want to load a bootloader to PIC32MX150F128B. I downloaded the Harmony library, but I can`t compile even the demo project for PIC32. I tried to copy only the necessary files to new project - without any success! I want to load newer version of a program through UART!
Help!
#1

21 Replies Related Threads

    Michael.W.Mann
    Super Member
    • Total Posts : 235
    • Reward points : 0
    • Joined: 2011/01/24 09:58:24
    • Location: Chandler, Arizona
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/15 09:47:45 (permalink)
    0
    p_stoyanoff
    I tried to copy only the necessary files to new project - without any success!



    You really need to work within a full installation of Harmony.

    Michael W. Mann
    Principal Applications Engineer
    MCU32 Applications, Microchip
    #2
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/16 04:40:09 (permalink)
    0
    Ok! Is there any AN with step by step example how to modify the standard bootloader for my controller?
    #3
    NKurzman
    A Guy on the Net
    • Total Posts : 14959
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/16 08:14:52 (permalink)
    0
    There is a bootloader appnotes.
    And the harmony documentation should have a bootloader section.
    #4
    NKurzman
    A Guy on the Net
    • Total Posts : 14959
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/16 10:14:00 (permalink)
    0
    An1388
    #5
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/17 03:09:49 (permalink)
    0
    I read that! I can`t compile the pic32c_app for my processor! There are so many files with the same name in the library so I can`t find the correct files I have to include in the compilation. Do I have to try installing only bootloader library - without anything else? So I could easier find the correct files? 
    I`m doing this for a very first time and I`m quite confused!
    I tried to use the Basic example! The problem is when I change the configuration to UART one I always receive error:
    ../src/system_config/usart_pic32mz_da_sk_intddr/bsp/bsp.c:1:0: error: Detected corrupt executable file [-Werror]

    What else do I have to change to compile this?
    Thanks!
    post edited by p_stoyanoff - 2017/09/17 05:36:33
    #6
    NKurzman
    A Guy on the Net
    • Total Posts : 14959
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/17 10:55:34 (permalink)
    0
    IF you are using Harmony you can create a standalone project to minimize the files.
    Otherwise Mpab list the files included.
    But get it to work first, then deal with saving files.
    #7
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/23 10:36:14 (permalink)
    0
    Ok! I compiled the project for my controller! I have a few questions.
    I the demo I don`t see UART interrupt! So where the bootloader loads the data I`m about to pass  through UART?
    I see only _CORE_TIMER_VECTOR int! And how the bootloader separates regular data from bootloader data? If I try to use the UART in my program can I use for bootloader too??
    Thanks!
    #8
    NKurzman
    A Guy on the Net
    • Total Posts : 14959
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/23 14:11:17 (permalink)
    3 (1)
    Either the bootloader runs or your program. Your program does not run on top of the bootloader like it is a O/S. since a bootloader usually has only the one task it can poll for UART data. Interrupts are optional on a PIC32.
    #9
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/23 23:30:33 (permalink)
    0
    So if I understood you right, I have had a jumper for example, using which to switch between main program and bootloader?
    Or this is done automaticaly? I don`t see any of the functions in the main from the AN in the example project?
    Is the bootloader in the linker file? 
    Thanks!
    #10
    NKurzman
    A Guy on the Net
    • Total Posts : 14959
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/09/24 00:15:46 (permalink)
    3 (1)
    You need to read Up on the core concept.
    The main app can trigger the bootloader. Or the bootloader can either run or jump to the main app. On a pic 32 the bootloader usually holds the reset vector. Or a combination of both can be used. The bootloader and the main program both need linker scripts. The linker scripts insure they do not overlap.
    post edited by NKurzman - 2017/09/24 08:52:02
    #11
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/07 06:45:43 (permalink)
    0
    Ok! I`ve prepared a project for UART. Now I`m trying to connect to load a new firmware through UART. I have a USB to TTL232 converter. It`s working fine, but the program in the package can`t open a port. When I press "open" it returns an error! What is the standart interface I have to use for connection? I don`t have physical com port on the laptop. 
    Thanks!
    #12
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 03:21:21 (permalink)
    0
    Hi, again! I compiled a project and I have a connection between the uC and the PC app. So I want to make a simple firmware change.
    Here is my bootloader code:
     
    while(1)
        {
         
            
            while(!FRAMEWORK_ExitFirmwareUpgradeMode()) // Be in loop till framework recieves "run application" command from PC
      {
       // Enter firmware upgrade mode.
       // Be in loop, looking for commands from PC
       TRANS_LAYER_Task(); // Run Transport layer tasks
       FRAMEWORK_FrameWorkTask(); // Run frame work related tasks (Handling Rx frame, process frame and so on)
       // Blink LED (Indicates the user that bootloader is running).
      }
      // Close trasnport layer.
      TRANS_LAYER_Close();
            JumpToApp();
        }

    and I want to change this program with a simple  program, just to verify the controller is programed:
        while(1)
        {
            LED_Set(0);
            Delay_ms(1000);
            LED_Set(1);
            Delay_ms(1000);
        }

    The problem is it doesn`t work. This is the app log:
    Device connected
    Bootloader Firmware Version: 1.0
    Hex file loaded successfully
    Flash Erased
    Programming completed
    Verification failed

    Command issued to run application

    And the program is not loaded. Can you give me an advice where the problem may be?
    Thanks!
    #13
    Akshayy
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 06:02:11 (permalink)
    0
    U just do one thing.U must have got file like application.ld and bootloader.ld for your specific controller in PC application installation directory.Just put application.ld in your application and bootloder.ld in you bootloader.Dont try to make your own linker file for now.
     
    http://www.microchip.com/....aspx?appnote=en554836
    #14
    Akshayy
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 06:03:17 (permalink)
    3 (1)
    Verification fails is just because of Wrong linker files
     
    #15
    Akshayy
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 06:12:09 (permalink)
    0
    Same problem i came across few days back
    #16
    p_stoyanoff
    Starting Member
    • Total Posts : 36
    • Reward points : 0
    • Joined: 2011/06/30 00:23:55
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 08:13:24 (permalink)
    0
    Ok! Now I have 2 ld files in my project - app_32MX150F128B.ld and  btl_32MX150F128B_uart.ld. But again verification fails!
    Did I choose wrong files?!
    #17
    Akshayy
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/27 23:59:59 (permalink)
    0
    Have u gone through An1388 application note.?What is the size of hex file of your bootloader and application?
    #18
    Akshayy
    Super Member
    • Total Posts : 196
    • Reward points : 0
    • Joined: 2016/07/29 06:35:35
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/28 00:04:57 (permalink)
    0
    Do one thing.Burn the bootloader into your controller into non-erasable area.And then debug application after.
    Normally what happens is controller go through boot memory and jumps to application.Here you have to place bootloader in middle of boot memory and application code.It will verify whether your application is working with bootloader or not.
     
    This is just for testing.
     
    Regards,
    Akshay
     
    #19
    Liem Dung Phan
    New Member
    • Total Posts : 5
    • Reward points : 0
    • Joined: 2017/09/14 21:09:39
    • Location: 0
    • Status: offline
    Re: Bootloader for PIC32MX150F128B 2017/10/28 02:33:40 (permalink)
    0
    It's so crazy to read ANs which are used for the old XC32 version - linker files are so different from  linker file in newer XC32. This my bootloader, hope to help you!
    https://1drv.ms/u/s!AsM2h9SXDzxQiIRIt6dVJzvxv20qpw
    #20
    Page: 12 > Showing page 1 of 2
    Jump to:
    © 2017 APG vNext Commercial Version 4.5