0

I want to jump from the application code to the bootloader when i receive a FW upgrade command from the PC. The bootloader checks 2 conditions-valid application and a external trigger. In my case, i do not want to use a switch press a s an external condition. Can i set a GPIO Pin(as a condition for external trigger) and then jump to the bootloader without any reset? Is there any other register that can be set in PIC32 for this implementation which can retain its value even on reset? Do we have a sample code for that?

i want to check the register value in the bootloader code and then proceed with the fw upgrade process.

Any other idea for PIC32 MCu will be accepted.

k11
  • 167
  • 1
  • 3
  • 16

1 Answers1

0

This is easy..

asm("reset");

Will get you back to address 0x0 and you can check the RCON register value for a Software reset and trigger the FW update on that. I've done it before and it works great. For the GPIO trigger, simply setup an INT pin with an interrupt and have it trigger the asm("reset"); instruction. As for the way to check a variable, in your code setup an non volatile area and you can read write from it. http://www.microchip.com/forums/m721413.aspx

blsmit5728
  • 434
  • 3
  • 11