PIC32MZ Live Update Bootloader

General discussion on mikroC PRO for PIC32.
Post Reply
Author
Message
kferrari
Posts: 2
Joined: 13 Nov 2020 09:25

PIC32MZ Live Update Bootloader

#1 Post by kferrari » 02 Sep 2022 10:45

Hi everyone

Has anyone here succeeded writing a live update bootloader for PIC32 as described Section 52 of the docs?

Our bootloader now seems to write BFM and PFM to upper aliases and updates sequence registers BF1SEQ3 and BF2SEQ3. But the PIC32 hangs after reset. I suppose this is because it swaps BFM but not PFM. Various topics on the microchip board suggest to modify the _on_reset() routine to check which BFM is active and swap PFM accordingly. We're currently stuck with accessing said _on_reset() routine. I found __BootStartUp() in __Lib_System_MZ_EF.c but can't modify it (i.e. the compiler won't care about me modifying it).

So my first questions are:
* Has anyone succeeded writing an application using live update with mikroC compilers?
* Can I edit __BootStartUp() or could I place a custom function somewhere at the very start to swap PFM? If yes, how?

It feels like we're very close to the thing actually working. Any help would be very much appreciated.

Thank you,
Kim

Setup:
MCU: PIC32MZ2048EFH100
IDE/Compiler: Necto Studio v1.8.6 / mikroC AI for PIC32

Resources:
https://ww1.microchip.com/downloads/aem ... 01320H.pdf
https://ww1.microchip.com/downloads/en/ ... 01193B.pdf
https://www.microchip.com/forums/m946552.aspx
https://www.microchip.com/forums/m967933.aspx

Post Reply

Return to “mikroC PRO for PIC32 General”