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

NRF52840 unable to initialize the Bluetooth stack without the programmer.

Hey!

I have an isp1807 test board, which uses an nrf52840 chip, and an isp1p807 programmer (ISP130603E). Currently, my code is written using the nrf52 sdk v17. When I am connected and powered off the programming board, the test board boots up correctly and is able to connect to a tablet via Bluetooth. However, when I power the test the board from an external power supply, the mcu crashes on Bluetooth initialization. I was wondering if anyone has had issues powering the nrf52840, off an external power supply? 

Thanks for your help!

Vasav  

  • Hi Vasav, 

    I suspect there could be something wrong with the clock source configured for the chip. 

    Could you give more information on how you configure the LFCLK in sdk_config.h (NRF_SDH_CLOCK_LF_SRC) 

    You may want to test setting the NRF_SDH_CLOCK_LF_SRC to RC. Just in case there could be an issue with the 32kHz crystal on the module. 

    Do you have any error code when the device crashed, do you know at which line it crashed ? I assume you are using S140 v 7.2.0 ? 

  • Hi Hung,

    I have the NRF_SDH_CLOCK_LF_SRC set as NRF_CLOCK_LF_SRC_XTAL currently. I tried switching it to RC however that resulted in the Bluetooth stack not being initialized properly at all, even with the programmer board. The error code for the RC version was 7 and the error resulted in when calling the nrf_sdh_enable_request() function. 

    When I had set the LF_SRC to XTAL, the Bluetooth stack failed to initialize nrf_sdh_enable_request() as well. I do not have the error code for this since I only notice this error when I'm not connected to the programming board. 

    We are using the nrf52sdk v 16.0.0, with S140 of v7.0.1. 

    Do you think it would be beneficial to upgrade the sdk to v17? 


    Thank you for your help!

    Vasav 

  • Hi Vasav, 

    If you look at the description of sd_softdevice_enable() you can find error 7 is:


    * @retval ::NRF_ERROR_INVALID_PARAM Invalid clock source configuration supplied in p_clock_lf_cfg.

    So there could be something wrong in the configuration of clock_lf_cfg. Please try : 

    NRF_SDH_CLOCK_LF_RC_CTIV = 16 

    NRF_SDH_CLOCK_LF_RC_TEMP_CTIV = 2 

    and NRF_SDH_CLOCK_LF_ACCURACY = 0. 


    I don't think updating to SDK v17 and S140 v7.2 would help as they are very similar to SDK v16 and S140 v7.0.1 

  • Hi Hung,


    I tried to change the sdk_config to the parameters you suggested and it still didn't make a difference. I also noticed that it doesn't actually return an error from the nrf_sdh_enable_request. The program is either hanging during the function call or crashing. 

    Based on what the function does, I think the only way it can get hung is if the Critical region is never exited? Do you have any suggestions as to what can cause this?

    Also, is there a reason why you think the clock configuration is incorrect?

    Also, I think the link I have here is similar to the issue I am facing, however, the chipset is different. Was there a specific workaround for the nrf52840 chip that I might not have? (+) sd_softdevice_enable does not return - Nordic Q&A - Nordic DevZone - Nordic DevZone (nordicsemi.com)


    Thanks for your help!

    Vasav  

  • Hi Vasav, 

    The nRF52840 doesn't have the issue that require errata_108. So it should be something else. 

    In addition SDK v17.x should have all the errata needed for the specific chip implemented. 

    Which firmware did you use to test? have you tried to test with the default BLE example in the SDK ? 

    In the application do you enable DCDC ? Seems that the isp1807 does have DCDC support components. 

    Could you send the schematic of your test board ? 

    If you test with other board/module  do you see the same problem  ? 

    Could you try to do what Kenneth suggested in this case to start the LFCLK manually before the softdevice ? 

Related