Re: Application communicating with Bootloader
☄ Helpfulby ViniciusL 2019/08/23 00:59:02
I have successfully used some of the SFR registers not used by the application for just this. This was for a PIC24FJ64GA004 but it could be working for PIC32 also. Depends what happens with the SFRs at reset.
When the main application receives a command to start a firmware upgrade it writes specific values to TMR1 and PR1 and does a soft reset. The bootloader always starts up after a reset so it checks in RCON if this is a software reset and that the specific values in TMR1 and PR1 is there. If so, the bootloader never jumps to the application but instead waits for the firmware download to start (triggered by the firmware download software). If TMR1 and PR1 is not the special values, the bootloader just waits the normal timeout before jumping to the application.