MPSL error although I am not using MPSL

Some Context:

I am developing a code to send an advertisement using NRF_RADIO registers.

Although I could get the READY, ADDRESS, PAYLOAD, and END events and all the radio state sequence ramping up, idle, transmission, stop, my code did not seem to work.


So, I thought it may have something to do with my prjconf.conf and configuration. So, I added CONFIG_BT=y to the configuration file and now when the interrupt occurs, I get the following error

[00:00:02.018,585] <err> mpsl_init:MPSL ASSERT: 112, 2236
[00:00:02.024,993] <err> os:***** HARD FAULT *****
[00:00:02.030,761] <err> os:  Fault escalation (see below)
[00:00:02.037,261] <err> os:ARCH_EXCEPT with reason 3

[00:00:02.043,395] <err> os:r0/a1:  0x00000003  r1/a2:  0x00000000  r2/a3:  0x00000000
[00:00:02.052,459] <err> os:r3/a4:  0x000154b5 r12/ip:  0x00000000 r14/lr:  0x000155e9
[00:00:02.061,523] <err> os: xpsr:  0x41000011
[00:00:02.066,986] <err> os:Faulting instruction address (r15/pc): 0x0000fae4
[00:00:02.075,225] <err> os:>>> ZEPHYR FATAL ERROR 3: Kernel oops on CPU 0
[00:00:02.083,160] <err> os:Fault during interrupt handling

[00:00:02.089,843] <err> os:Current thread: 0x200014d8 (unknown)
[00:00:02.116,882] <err> os:Halting system
 

I was wondering how I can fix this.

It is strange that I get MPSL related error although I am not using MPSL.

Also, here is the configs that I have:

CONFIG_BT=y



CONFIG_DEBUG=y


CONFIG_SERIAL=y

CONFIG_GPIO=y

CONFIG_NRFX_PPI=y
CONFIG_NRFX_GPIOTE=y
CONFIG_NRFX_TIMER1=y
 
CONFIG_DK_LIBRARY=y


CONFIG_LOG=y

CONFIG_LOG_MODE_IMMEDIATE=y
CONFIG_USE_SEGGER_RTT=y
CONFIG_LOG_BACKEND_RTT=y

  • Hi,

    The MPSL is always used if you are using the SoftDevice Controller, which you are using. In this case, the MPSL "owns" the radio, and you will get asserts if you access the radio and some other peripherals directly. If you want to both use the radio directly and use Bluetooth, you need to use MPSL timeslots so that the MPSL grants you time slots where you are allowed to use the radio in between Bluetooth events. You also need some other configurations as explained in the next post (edited).

    Alternatively, if you don't need Bluetooth, don't set " CONFIG_BT=y", and then you are free to use the radio as you like.

  • Thanks, the link to the configuration explanation does not work.

  • Hi,

    Sorry about the link, that was my bad. The content I wanted to link to was these configs that are needed for multiprotocol applications:

    CONFIG_MPSL_DYNAMIC_INTERRUPTS=y
    CONFIG_ESB_DYNAMIC_INTERRUPTS=y
    CONFIG_DYNAMIC_INTERRUPTS=y
    CONFIG_DYNAMIC_DIRECT_INTERRUPTS=y

    And you likely want this

    CONFIG_BT_UNINIT_MPSL_ON_DISABLE=y

    as well. When enabled, it uninitializes MPSL when bt_disable() is used. This releases all peripherals used by the MPSL.

    With these configs you can change protocol at run-time.

Related