Leave GPIO pin state when jumping to bootloader
I have been using this solution to jump to the ROM bootloader and that is working fine. However, it only works if the chip is coming out of reset and none of the peripherals are initialized, FreeRTOS scheduler not running, etc. Basically the chip needs a fresh restart in order for this method to reliably get to the bootloader.
This means I need to write a magic number to a RAM location, call NVIC_SystemReset(), then invoke the linked code. However, in my application, I would like to leave on external circuit enabled while this happens, which means I would like to leave one GPIO pulled high while in bootloader. When I call the reset function, it (obviously) resets all the GPIO to high-impedance input and I lose the state of the external circuit.
Is there any way to 1) call some version of NVIC_SystemReset() that is less aggressive about resetting everything, or 2) modify the linked code so I can jump to the bootloader from the FreeRTOS task?
Thanks,
Jamie
