custom nrf board turning off in between dfu ota update partition swap

hey i am using a custom nrf52840 board and i keep my device on by setting a gpio pin high and device turns off as soon as it sets to low .

during ota update when the bootloader switches the partition device resets hence the pin is pulled low and the ota fails on verification stage

please tell me a method such that either i can keep this pin high during swap or swap the partition during next reboot stage.

Related