Hey,
We've been having issues with a subset of a batch of devices produced recently, with an unacceptably high failure rate when switching to DFU from firmware (the switch is done via BLE). This has worked until now, and I'm very puzzled as to how this could be happening, or steps to take to remedy. As it is ~10% of a batch of 300 devices, it is kind of a big deal. The bootloader is almost stock nrf, and the few modifications we made are not in this path.
The in-firmware switching code was a standard DFU assignment, it is temporarily like so to make sure the register is actually properly set:
err_code = sd_power_gpregret_clr(0, 0xffffffff); APP_ERROR_CHECK(err_code); err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START); APP_ERROR_CHECK(err_code); uint32_t reg_val = 0x00; while (!(reg_val & BOOTLOADER_DFU_START)) { sd_power_gpregret_get(0, ®_val); } m_dfu.evt_handler(BLE_DFU_EVT_BOOTLOADER_ENTER); nrf_pwr_mgmt_shutdown(NRF_PWR_MGMT_SHUTDOWN_GOTO_DFU);
Following this, the device properly switches over to bootloader (we can see this), attempts to read the DFU register (seen by its entry into dfu_enter_check), and... hard-faults coming out of it and resets, thus going back into app mode since the register is RAM-backed.
What could be causing this? And, more importantly, is there another way to remedy this?