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 Reply Children
  • That's quite strange. Build&Run (F5) has always worked in the past, and still works fine on the previous round of boards. It's only on the newest batch of boards that it fails, and the connections to the processor are electrically and physically identical. So I speculate there's some kind of fabrication problem. What should I be looking for?

  • The problem I have tried to describe where the debugger interferes with the boot sequence does not have anything to do with the HW, and there must be some other explanation for why you have not noticed this before with the other batches or revisions of your boards. The device will boot correctly after a system reset, so if the error handler calls NVIC_SystemReset(), it may mask the issue.

  • You need to flash prerequisites (like SoftDevice and Bootloader) only once before Build&Run starts working.

    Edit: Disregard, I confused that with different tooling from another IDE. Below part could still mess things up though - but only outside IDE when running from POR.

    Note that some module vendors may ship parts with pre flashed firmware - you also want to include a complete flash erase in the first flash step.

  • Build&Run will load the additional hex files specified in the project the same way as Build&Debug, so it's not that the softdevice isn't loaded. As mentioned in my previous replies, the problem is that Build&Run starts execution directly from the app's reset handler, which means the SoftDevice never gets initialized, hence the invalid state error. 

  • Getting back to this problem now after a few very busy days on family issues. In a nutshell: If I load the firmware via drag-and-drop to the "drive" representing the nRF52832 DevKit I'm using as a programmer, it runs fine. If I then cycle power, it hangs up in a loop that resets every time nrf_sdh_enable_request() is called. The latter behavior also happens if I program by pressing F5 in SES, and also if I program via the nRF Connect Programmer app. But none of the above problems occur on previous revs of the PCB, and there have been no changes to connectivity or even physical placement in the area of the processor. There is one additional I/O line in use as an input, with a 1K resistor connecting a signal to what was previously a thru-hole testpoint. However, the symptoms are the same even with that line disconnected. What should I be looking for?

Related