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

  • I just tried your first suggestion with both boards. With the board that isn't working (no regulator), the LFCLK does not start and goes into the else statement. With the board that is working, the LFCLK does start and goes into the if statement. 

    I also tried your second suggestion and the internal RC does in fact work on the bad board and goes into advertising, but when I set LF_SRC to 1 again, it goes into fatal error. 

    So I guess this points to my 32kHz xtal either being defective or out of spec? I don't think my rework on the PCBs affected anything. It's odd because both boards are the same and one just has the regulator removed, that is it. I've tried on multiple boards with the same result. 

  • Aaron said:
    So I guess this points to my 32kHz xtal either being defective or out of spec?

    Yes it's defective, I suggest to check that there is no short (e.g. solderbridge) to ground and try a different/new 32kHz crystal.

    The NRF_SDH_CLOCK_LF_RC_TEMP_CTIV can't be used with external crystal, so it should be 0 when using external crystal.

    Best regards,
    Kenneth

  • Ok, I replaced the xtal with the same type and it works.

    However, I'm still unsure how the boards are failing. This is for a product, so I'll need to determine why. All I did was hot air off the regulator and the board's xtal fails. To fix the boards, I hot air the "defective" xtal off and hot air the same type back on and it works. 

    Any idea why this would be happening?

Reply
  • Ok, I replaced the xtal with the same type and it works.

    However, I'm still unsure how the boards are failing. This is for a product, so I'll need to determine why. All I did was hot air off the regulator and the board's xtal fails. To fix the boards, I hot air the "defective" xtal off and hot air the same type back on and it works. 

    Any idea why this would be happening?

Children
Related