mpls_init hang, suspect infinite loop in nordic proprietary code

NCS 2.8

NRF52840

Sysbuild with MCUBOOT

LFCLK in Synth mode

CONFIG_BT=y
CONFIG_BT_LL_SOFTDEVICE=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_BROADCASTER=y

CONFIG_BT_CTLR=y
CONFIG_BT_HCI=y
CONFIG_BT_SMP=y

Previously functioning hardware, has now started hanging.  In the debugger I find the hang occurs within mpsl_init(..)    on line 395 on mpsl_init.c.  The hang is specifically within a obfuscated name sym_GYXW4XY25R4ELPOOTEBFKAUAI3X7A5AGZZV7OTI.

A wild guess on my part is that perhaps this code is waiting for HFCLK to start.  Looking at the registers the CLOCK module indicates the LF clock is running in SYNC mode and HF clock is in RC mode.

1) Init functions should not hang.  They should indicate a failure and allow system to continue.

2) Since this code is obfuscated, I'm completely blind to what might be causing the issue. 

  • Hi,

     

    Is there a problem with the HFXO on your board?

    LFCLK synth is derived from the HFXO, and if there is any problems with the HFXO, it will hang trying to start it up.

     

    Kind regards,

    Håkon

  • I don't know if there is a problem with the HFXO on the board.  The board is extremely small and observing the high frequency crystals on any board is difficult.  I was hoping you might be able to tell me something about why mpsl_init is hanging. 

    Is there any other condition besides HFXO not starting that could cause mpsl_init to hang?  I'm not able to debug since the code is obfuscated.  

    Its really strange since the board was working just a few days ago but not now.

  • Also perhaps you could request that future releases NOT hang in obfuscated code, it makes it really hard to diagnose problems.

  • Hi,

     

    I agree that firmware shall not hang. I will bring this up with the softdevice/mpsl team.

    Anthony Ambuehl said:
    The board is extremely small and observing the high frequency crystals on any board is difficult. 

    Run this in firmware to check your clock connection:

    When testing, try to use "CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y" to enable the internal 32k RC oscillator.

     

    Kind regards,

    Håkon