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

Blocked on SOFTDEVICE_HANDLER_INIT (RC clock source) with SDK nRF5_SDK_11.0.0-2.alpha_bc3f6a0

HI All,

I tried to migrate from nRF51_SDK_10.0.0_dc26b5e to nRF5_SDK_11.0.0-2.alpha_bc3f6a0

my migrated ble_stack_init:

static void ble_stack_init(void)
{
    uint32_t err_code;

    // Initialize the SoftDevice handler module.
    //SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_1000MS_CALIBRATION, NULL);
    SOFTDEVICE_HANDLER_INIT(NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION, false);

    ble_enable_params_t ble_enable_params;
    err_code = softdevice_enable_get_default_config(CENTRAL_LINK_COUNT,
                                                    PERIPHERAL_LINK_COUNT,
                                                    &ble_enable_params);
    APP_ERROR_CHECK(err_code);
    
    //Check the ram settings against the used number of links
    CHECK_RAM_START_ADDR(CENTRAL_LINK_COUNT,PERIPHERAL_LINK_COUNT);
    
    // Enable BLE stack.
    err_code = softdevice_enable(&ble_enable_params);
    APP_ERROR_CHECK(err_code);

    // Register with the SoftDevice handler module for BLE events.
    err_code = softdevice_ble_evt_handler_set(ble_evt_dispatch);
    APP_ERROR_CHECK(err_code);

    // Register with the SoftDevice handler module for System events.
    err_code = softdevice_sys_evt_handler_set(sys_evt_dispatch);
    APP_ERROR_CHECK(err_code);
}

The code blocked on SOFTDEVICE_HANDLER_INIT.

  1. I use NRF_CLOCK_LFCLKSRC_RC_250_PPM_TEMP_4000MS_CALIBRATION clock source.
  2. The clock source works find on SDK 9 and SDK 10
  3. Bootloader works fine so softdevice is flashed correctly.
  4. I use S130 stack (from 1.0.0 to 2.0.0)

Any idea ?

Parents
  • The cause is I use gcc toolchain and the SDK 11.0.0 linker script for s130 is wrong.

    <nRF5_SDK_11.0.0-2.alpha_bc3f6a0>/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld :

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x4000
    }
    
    SECTIONS
    {
      .fs_data_out ALIGN(4):
      {
        PROVIDE( __start_fs_data = .);
        KEEP(*(fs_data))
        PROVIDE( __stop_fs_data = .);
      } = 0
    }
    
    INCLUDE "nrf5x_common.ld"
    

    After change to:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20001f00, LENGTH = 0x2100
    }
    

    It works. SDK team please check the gcc linker script for later release.

Reply
  • The cause is I use gcc toolchain and the SDK 11.0.0 linker script for s130 is wrong.

    <nRF5_SDK_11.0.0-2.alpha_bc3f6a0>/components/softdevice/s130/toolchain/armgcc/armgcc_s130_nrf51822_xxaa.ld :

    /* Linker script to configure memory regions. */
    
    SEARCH_DIR(.)
    GROUP(-lgcc -lc -lnosys)
    
    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20000000, LENGTH = 0x4000
    }
    
    SECTIONS
    {
      .fs_data_out ALIGN(4):
      {
        PROVIDE( __start_fs_data = .);
        KEEP(*(fs_data))
        PROVIDE( __stop_fs_data = .);
      } = 0
    }
    
    INCLUDE "nrf5x_common.ld"
    

    After change to:

    MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1b000, LENGTH = 0x25000
      RAM (rwx) :  ORIGIN = 0x20001f00, LENGTH = 0x2100
    }
    

    It works. SDK team please check the gcc linker script for later release.

Children
No Data
Related