This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Soft device assert

Hi, I`m working on our firmware for nRF51822 and I received the assert from soft device when turning off the global interrupts for our time-dependent procedure which have 100us duration. I worked on 8.0.0 soft device and 9.0.0 SDK. The assert data: file = src/ll_adv.c line = 841.

  • Are you saying you turned off all interrupts by setting PRIMASK or similar? You can't do that when you're running the softdevice, you cannot turn off its interrupts, it must be able to service the bluetooth systems at regular and precise intervals. If you prevent it from doing so it will assert soon after when it finds its interrupt has come outside the specs.

    If you are trying to do time critical operations when the softdevice is running, you basically can't, there must be 5-10 questions a week about this - if you do a few searches you'll see some of the options you have for getting interrupt-free periods of time.

  • Ok, maybe there are some FAST API to pause the Bluetooth operation then in Advertising mode. Because my time critical operations are started by interrupt from lpcomp and I must response to it as fast as it possible.

  • You can turn advertising off and turn it back on again later, that's all you can do however and even that takes time. Depending on what you're doing with the LPCOMP you might be able to use PPI to trigger something which bypasses the CPU, but with the Softdevice running in any mode your interrupts will get randomly delayed (see the documentation for how much) and your user code will be subject to being interrupted.

    If you can move your operations around then you can use the timeslot api, if you're hoping to respond to an external event on a guaranteed low latency basis with the softdevice running, you can't do it.

Related