Hello,
I propose theses evolutions in nrf_bootloader.c, it allows to use gpregret and gpregret2 for other things:
(nrf_power_gpregret2_get() & BOOTLOADER_DFU_SKIP_CRC)
=>
((nrf_power_gpregret2_get() & 0xF8) == BOOTLOADER_DFU_GPREGRET2_MASK) && (nrf_power_gpregret2_get() & BOOTLOADER_DFU_SKIP_CRC)
and
(nrf_power_gpregret_get() & BOOTLOADER_DFU_START)
=>
((nrf_power_gpregret_get() & 0xF8) == BOOTLOADER_DFU_GPREGRET_MASK) && (nrf_power_gpregret_get() & BOOTLOADER_DFU_START)