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

Code stuck at ble_init_stack() fuction after programming first time nRF52832

Hi,

I have got new nRF52832 custom board. I am able to send AT commands and getting responses. After that i tired programming ble_app_uart Example and it stuck at ble_init_stack function.

1.I have used nRF51422 DV for programming device.

2.I programmed ble_app_uart using nrfprogj command line utilities.

3. When i program LED blink or UART from peripheral folder it works fine.

4.I realized that chip is factory programmed and to recover from that i have to use nrfjprog -f nrf52 --recover  

5. I used recover command and then programmed softdevice_s132 and ble application.

Is chip is gone? 

Is there a way to make this device work?

Please help if there is way as i am stuck at this point.

Thanks,

Vitry 

Parents
  • Hi Vitry,

    The SDK BLE examples are configured to use an external 32KHz crystal as the low-frequency clock source. Maybe you don't have 32K crystal on your custom board? In that case, you need to change the clock source to the internal RC oscillator. The LF Clock source can be configured in sdk_config.h:

    // </h> 
    //==========================================================
    
    // <h> Clock - SoftDevice clock configuration
    
    //==========================================================
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #ifndef NRF_SDH_CLOCK_LF_SRC
    #define NRF_SDH_CLOCK_LF_SRC 1
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #ifndef NRF_SDH_CLOCK_LF_RC_CTIV
    #define NRF_SDH_CLOCK_LF_RC_CTIV 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #ifndef NRF_SDH_CLOCK_LF_RC_TEMP_CTIV
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 0
    #endif
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #ifndef NRF_SDH_CLOCK_LF_ACCURACY
    #define NRF_SDH_CLOCK_LF_ACCURACY 7
    #endif

    Best regards,

    Vidar

  • Hi Vidar,

    Thanks for the reply.

    We are using 32.7680 crystal. And board is working as a beacon when we configure using programmer tools(BMD-301).

    We want to program our own application and removing default factory bin.

    After factory configuration i am following below steps.

    1.For recovery 

    nrfjprog -f nrf52 --recover  

    2. to program softdevice

    make flash_softdevice

    2. To erase chip and program application

    make
    nrfjprog --family nRF52 -e
    nrfjprog --family nRF52 --program .\_build\nrf52832_xxaa.hex
    nrfjprog --family nRF52 -r

    Thanks & regards

    Vitry

  • Hi Vitry,

    Just to confirm, the program does not get stuck in ble_stack_init when you run the beacon example, only with your custom application, correct? Have you attempted to debug your custom application to verify that it is hanging in ble_stack_init()? Also, what is the program counter value when it hangs?

    Regards,

    Vidar 

Reply Children
No Data
Related