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

custom hardware nRF52832 hangs during softdevice initialization

I have a custom board using the nRF52832 QFAA with SDK 15.3.0 and SoftDevice132 6.1.1. I'm also using an external 32kHz crystal for the softdevice clock. There are two hardware versions of this board I'm working with: one works fine my code runs and I can connect over bluetooth. The other version hangs within nrf_sdh_enable_request() in file nrf_sdm.h at this line: 

SVCALL(SD_SOFTDEVICE_ENABLE, uint32_t, sd_softdevice_enable(nrf_clock_lf_cfg_t const * p_clock_lf_cfg, nrf_fault_handler_t fault_handler));

In addition, the board seemed to be drawing 3 mA more than normal and I was not able to see any debug output in JLink Viewer until I started tweaking the softdevice clock configurations in sdk_config.h, specifically changing NRF_SDH_CLOCK_LF_RC_TEMP_CTIV  to 2 (from 0). Then I was able to also see the error output on line nrf_sdh_enable_request() and the power dropped to 100s of uA like it should, but it still hangs when enabling the softdevice.

On the hardware that works, I have a 3.3V regulator (LTC3335) in front of my regulated bench power supply. The power draw is expected and I don't see any errors. 

On the hardware that doesn't work, I'm powering the hardware with 3.3V directly from the bench supply, nothing else is connected to the nRF, other than power, the 32kHz xtal, and the debugger. I want to use this configuration for optimal power savings. 

It seems this has something to do with the 32kHz xtal and it's configuration, but I'm at a loss since there isn't any other hardware debugging I'm able to do. 

I've also made sure the RAM and flash start addresses are correct. And I've included NO_VTOR_CONFIG in my preprocessor definitions. 

Any ideas?

Parents
  • Have you tried to start the external 32kHz crytal manually without the softdevice, just to confirm it works as intended? You can try:

    	NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
    	NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    	NRF_CLOCK->TASKS_LFCLKSTART = 1;
    	
    	// Wait for the low frequency clock to start
    	nrf_delay_ms(1000);
    	
    	if(NRF_CLOCK->EVENTS_LFCLKSTARTED == 1)
    	{
    	// hurray there is an external LFCLK present.
    	// you can set external LFCLK when enable softdevice
    	NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    	}
    	else
    	{
    	// no external lfclk present, you can use internal LFCK when enable softdevice
    	}

    Also, can you try to use the internal RC for test (instead of external 32kHz) when enable softdevice? For instance by change in sdk_config.h:

    #define NRF_SDH_CLOCK_LF_SRC 0
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    #define NRF_SDH_CLOCK_LF_ACCURACY 1

  • Another thing I'm noticing, on the good boards I use these settings in sdk.config.h and everything works fine.

    #define NRF_SDH_CLOCK_LF_SRC 1
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 7

    When I change NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2 (from 0), I get the same fatal error as the bad boards. 

    Why does changing this value have an affect if I'm set to use external xtal (LF_SRC 1)? I'm not even using the internal RC.

Reply
  • Another thing I'm noticing, on the good boards I use these settings in sdk.config.h and everything works fine.

    #define NRF_SDH_CLOCK_LF_SRC 1
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    #define NRF_SDH_CLOCK_LF_ACCURACY 7

    When I change NRF_SDH_CLOCK_LF_RC_TEMP_CTIV to 2 (from 0), I get the same fatal error as the bad boards. 

    Why does changing this value have an affect if I'm set to use external xtal (LF_SRC 1)? I'm not even using the internal RC.

Children
No Data
Related