Failure in ble_stack_init during startup

We are trying to bring up a new run of an existing PCB design. No changes in the area of the processor, but a different assembly house. The first call inside ble_stack_init, a call to nrf_sdh_enable_request(), fails and returns an error code of 8. No reference anywhere gives a usable explanation.

Strangely, if started by "copying" the hex file onto the Jlink "drive" (the nRF52832 DevKit), it succeeds.

What should we be looking for?

Parents
  • Hello,

    It seems like the issue might be with how the firmware is programmed since it appears to work when you use drag&drop programming. How are you programming the device when it fails? Is the same error also returned after a reset? Note that the "SoftDevice enable" function may return NRF_ERROR_INVALID_STATE (8) if the debugger forces execution to start from the application start address instead of address 0x0. This prevents the softdevice's reset handler from running on startup.

    Best regards,

    Vidar

  • I was starting it from SES (Segger) just as I have on dozens of previous nRF52832 projects, and indeed successfully on previous runs of this board. So there's something different in the hardware, and I'm asking where to look. What sort of "invalid state" is likely?

  • That's no help because the reset doesn't occur if run with the debugger. I already record RESETREAS into NV memory right at hte beginning of main(), and it's all zeroes in the failure case. ?!?!?

  • that is exactly why I am suggesting you attach the debugger to the running target after the reset has occurred. 

  • How do I go about that? Any time I run the debugger, it resets the code to the start of main(), and stepping or just running from there runs flawlessly. Apparently you know some new and very useful trick I need to learn.

  • You can use nrfutil from the command line (cmd.exe) as described earlier. First step is to install nrfutil and the "device" subcommand. Installation instructions can be found here: https://docs.nordicsemi.com/r/bundle/nrfutil/page/readme.html/about-nrf-util 

  • What am I missing??

    2026-06-19  8:13:08.51 d:\Download>nrfutil device read --address 0x40000400 --direct
    Error: nrfutil command `device` not found. See `nrfutil list` for full list of installed commands, `nrfutil search` for installable commands, and `nrfutil install` for installation of new commands.

    Caused by:
        Subcommand nrfutil-device.exe not found

    2026-06-19  8:13:55.88 d:\Download>nrfutil search
    Command           Installed Latest Status
    91                          0.4.1  Not installed
    ble-sniffer                 0.12.0 Not installed
    completion                  1.4.0  Not installed
    device                      2.3.6  Not installed
    npm                         0.3.0  Not installed
    nrf5sdk-tools               1.0.1  Not installed
    toolchain-manager           0.14.4 Not installed
    trace                       2.1.0  Not installed

    Found 8 installable command(s)

    2026-06-19  8:14:12.76 d:\Download>nrfutil install device
    Error: Failed to install nrfutil-device

    Caused by:
        0: Could not download package
        1: failed to download from `developer.nordicsemi.com/.../nrfutil-device-x86_64-pc-windows-msvc-2.3.6.tar.gz`
        2: failed to get 200 response from `developer.nordicsemi.com/.../nrfutil-device-x86_64-pc-windows-msvc-2.3.6.tar.gz`, got 410

Reply
  • What am I missing??

    2026-06-19  8:13:08.51 d:\Download>nrfutil device read --address 0x40000400 --direct
    Error: nrfutil command `device` not found. See `nrfutil list` for full list of installed commands, `nrfutil search` for installable commands, and `nrfutil install` for installation of new commands.

    Caused by:
        Subcommand nrfutil-device.exe not found

    2026-06-19  8:13:55.88 d:\Download>nrfutil search
    Command           Installed Latest Status
    91                          0.4.1  Not installed
    ble-sniffer                 0.12.0 Not installed
    completion                  1.4.0  Not installed
    device                      2.3.6  Not installed
    npm                         0.3.0  Not installed
    nrf5sdk-tools               1.0.1  Not installed
    toolchain-manager           0.14.4 Not installed
    trace                       2.1.0  Not installed

    Found 8 installable command(s)

    2026-06-19  8:14:12.76 d:\Download>nrfutil install device
    Error: Failed to install nrfutil-device

    Caused by:
        0: Could not download package
        1: failed to download from `developer.nordicsemi.com/.../nrfutil-device-x86_64-pc-windows-msvc-2.3.6.tar.gz`
        2: failed to get 200 response from `developer.nordicsemi.com/.../nrfutil-device-x86_64-pc-windows-msvc-2.3.6.tar.gz`, got 410

Children
Related