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

Firmware Crash on ble_stack_init()

The firmware crashes when passing the ble_stack_init() when the firmware is download but in debug mode it works fine. The screen shots below shows this event.

We are using S132 and nRF5_SDK_17.0.2_d674dde

Code Snippet

On this scope shots we can see that on debug mode the test point would go low after around 2 seconds but on downloaded it didn't go low even after 3 seconds and more.

Debug Mode

Downloaded

Any thoughts on what is causing this issue?

Parents
  • Thank you

    It seems like your clock peripheral still tries to use the external clock. Please try setting the

    CLOCK_CONFIG_LF_SRC define in your sdk_config.h file to 0 as well. If the application tries to start the LF clock while the GPIOs P0.00 /P0.01 is used for something else, this will cause issues as they can't be used for both clock operations and as a GPIO.
     
    Best regards,
    Simon
  • We added CLOCK_CONFIG_LF_SRC 0 but unfortunately it still didn't run. 

    As a clarification we basically should leave P0.00 and P0.01 as not connected? Could we disable this inside the code or should it be physically be not connected?

  • Hi

    P0.00 and P0.01 will be configured as GPIOs "automatically" when you choose the RC oscillator as your LF clock source, so it shouldn't be necessary to leave them not connected.

    Can you try moving the uint32_t ram_start = 0; to after the nrf_sdh_enable_request() so that the ble_stack_init() function is identical to the one in our SDK example projects?

    /**@brief Function for initializing the BLE stack.
     *
     * @details Initializes the SoftDevice and the BLE event interrupt.
     */
    static void ble_stack_init(void)
    {
        ret_code_t err_code;
    
        err_code = nrf_sdh_enable_request();
        APP_ERROR_CHECK(err_code);
    
        // Configure the BLE stack using the default settings.
        // Fetch the start address of the application RAM.
        uint32_t ram_start = 0;
        err_code = nrf_sdh_ble_default_cfg_set(APP_BLE_CONN_CFG_TAG, &ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Enable BLE stack.
        err_code = nrf_sdh_ble_enable(&ram_start);
        APP_ERROR_CHECK(err_code);
    
        // Register a handler for BLE events.
        NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);
    }
    

    Best regards,

    Simon

  • Hello Simon, we have tried your suggestion but we still encounter the issue.

    It works in debug mode but it doesn't work when the code is downloaded to the chip.

Reply Children
No Data
Related