During first BLE OTA DFU attempt I get an error, second attempt always works

Hello. I am using an nRF52832 in an HCI UART connection with my application processor. I'm running Zephyr 4.2 on both MCUs. I'm using MCUMGR and MCUBOOT to get OTA FW updates working via BLE. 

On my first OTA DFU attempt, I always get the error message "<err> mcumgr_img_grp: Irrecoverable error: flash write failed: 12". This is ENOMEM. 

The second attempt always seems to work. 

It's not heap exhaustion, and I've increased workq stack sizes considerably. Any insight what might be the issue here?

Thanks,

Rob

Parents Reply Children
  • Hello Rob,

    Thanks. It seems that the issue is not related to flash erase operations. Please correct me if I am wrong, but you mention using Zephyr 4.2, which I assume means you are using vanilla Zephyr and not our nRF Connect SDK. To help narrow it down, would it be possible to switch or at least test the hci uart project with the nRF Connect SDK? The latter will by default select the qualified SoftDevice controller instead of the open source Zephyr bluetooth controller (the controller may affect flash scheduling)). Another thing you may do is try stepping into this function with your debugger to find out what error the flash driver is returning and enable more logging in the flash driver.

    Best regards,

    Vidar

Related