• AVR Freaks

PIC32MZ bootloader, unified hex working, bootloaded hex crashes

Author
hamster
New Member
  • Total Posts : 6
  • Reward points : 0
  • Joined: 2019/08/23 06:16:37
  • Location: 0
  • Status: offline
2019/11/08 06:30:00 (permalink)
0

PIC32MZ bootloader, unified hex working, bootloaded hex crashes

I am using a PIC32MZ2048EFH144 with Harmony v2.06. I have made an SD card bootloader starting off from the example application in Harmony. If I compile the bootloader with the application as a loadable project everything work as expected, however, when I try to load the application with the bootloader it crashes during the second run-through of SYS_Tasks(). I have a few questions regarding that topic:

By toggling some LEDs I am able to see that the application has been loaded to program memory, but it crashes during a call to:
DRV_SDCARD_Tasks(sysObj.drvSDCard);
I comment out this line as the SD card is not crucial to the application, but now it crashes at:
DRV_USBHS_Tasks(sysObj.drvUSBObject);


1. Anyone experienced anything like this? Again, when the bootloader and the application is compiled together and loaded by the PICkit as a unified hex, the app runs without error. Could it still be due to a mismatch of the system config in the bootloader project and the application project? But why doesnt it surface in the unified hex?
2. Is there a good way to debug this scenario? Could I generate an hex with debug signals and debug the application after its been loaded into program memory by the bootloader?
#1

3 Replies Related Threads

    hamster
    New Member
    • Total Posts : 6
    • Reward points : 0
    • Joined: 2019/08/23 06:16:37
    • Location: 0
    • Status: offline
    Re: PIC32MZ bootloader, unified hex working, bootloaded hex crashes 2019/11/10 04:43:26 (permalink)
    0
    If this was not entirely clear from the first post:
    I compile and program a unified hex with the bootloader and the application onto the PIC32. The application runs as expected. But when I use the bootloader to load a new version of the application into program memory (by new I mean just toggeling som LEDs to demonstrate that I actually managed to update the program memory with a new application) I experience problems. The bootloader does indeed update the program memory but the new application crashes.

    Is this a typical problem? What can cause this? The very same application works as expected when compiled together with the Bootloader.
    #2
    NKurzman
    A Guy on the Net
    • Total Posts : 17916
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: online
    Re: PIC32MZ bootloader, unified hex working, bootloaded hex crashes 2019/11/10 11:12:03 (permalink)
    5 (1)
    Is IPE to extract the working and non working hex images and save them.
    Use a tool like “Beyond Compare” to compare the two hex files.
    See why they are different.
    Look for differences in the application. And in the bootloader.
    #3
    Jim Nickerson
    User 452
    • Total Posts : 6326
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: PIC32MZ bootloader, unified hex working, bootloaded hex crashes 2019/11/10 11:28:50 (permalink)
    0
    you might use the  ELFviewer plugin while building the application to see what memory  it is writing to.
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5