I am trying to keep an output pin asserted while I jump to the DFU on the 52840.
We have a dead-man switch hooked up to pin 19. I need to hold this pin high while I jump to the bootloader. However, it seems like it is being reset to an input or toggle low when I jump.
Here is how I jump to the bootloader.
// Save update in restart register NRF_POWER->GPREGRET = BOOTLOADER_DFU_START; nrf_sdh_disable_request(); StartApplication(0xf1000);
void StartApplication(uint32_t start_addr) { __ASM volatile( "LDR R2, [%0] \n" // Get App MSP. "MSR MSP, R2 \n" // Set the main stack pointer to the applications MSP. "LDR R3, [%0, #0x00000004] \n" // Get application reset vector address. "BX R3 \n" // No return - stack code is now activated only through SVC // and plain interrupts. ".ALIGN \n" ::"r"( start_addr) // Argument list for the gcc assembly. start_addr is %0. ); }