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

S130 Example Doesn't Work Out Of Box (Un touched)

I'm using the nRF51 DK (pca10028) with the S130 0.9.0-1 ALPHA release and the experimental_ble_app_s130 example from Keil 5 doesn't work out of the box. Also I'm running 7.2 SDK.

It'll compile and run, but the uart output shows the following:

S130_DEMO_LOG: ....\src\main.c: 1321: board_configure: Hardware initiated. Usign PCA100xx (Dev. kit) S130_DEMO_LOG: ....\src\main.c: 1232: main: Enabling SoftDevice... #########################

S130 Demo application

######################### INFO: Press button 0 to connect to peripherals. INFO: Press button 1 to see the buffered data INFO: Press both 0 and 1 buttons to quit demo. S130_DEMO_LOG: ....\src\main.c: 709: sd_ble_uuid_vs_add() error code 0x3001 S130_DEMO_LOG: ....\src\main.c: 1279: app_assert_callback: APP ASSERT: line = 710 file = ....\src\main.c

Any input that could be helpful would be amazing. Below is a snippet of the function being called with the error message:

static void own_service_setup(void) { uint32_t error_code = NRF_ERROR_NOT_FOUND; ble_uuid_t own_service_uuid = {0}; ble_uuid_t attr_uuid = {0}; ble_uuid_t desc_uuid = {0}; ble_gatts_char_md_t char_md = {0}; ble_gatts_attr_t attr = {0}; ble_gatts_attr_md_t attr_md = {0}; ble_gatts_attr_md_t cccd_md = {0};

uint8_t                 characteristic_value[]  = SERVICE_CHARACTERISTIC_VALUE;
ble_gatts_attr_md_t     desc_md                 = {0};
ble_gatts_attr_t        desc                    = {0};
uint8_t                 uuid_type               = 0;
ble_uuid128_t           uuid128                 = {SERVICE_UUID128};
uint16_t                own_desc_handle         = 0;    
uint8_t                 own_desc_value[]        = SERVICE_CHARACTERISTIC_DESC_VALUE;
uint16_t                own_service_handle      = 0;

if ((error_code = sd_ble_uuid_vs_add(&uuid128, &uuid_type)) != NRF_SUCCESS)
{
    LOG_DEBUG("sd_ble_uuid_vs_add() error code 0x%x", error_code);
    APP_ASSERT (false);
}

own_service_uuid.type = uuid_type;

if ((error_code = sd_ble_gatts_service_add(BLE_GATTS_SRVC_TYPE_PRIMARY, &own_service_uuid, &own_service_handle)) != NRF_SUCCESS)
{
    LOG_DEBUG("sd_ble_gatts_service_add() error code 0x%x", error_code);
    APP_ASSERT (false);
}
Parents
  • The S130 headers and the S130 example included in SDK 7.2.0 is actually for s130 0.5.0-1.alpha. This is what you need to do:

    1. Add the correct headers, you find these in the s130_nrf51822_0.9.0-1.alpha_API folder that comes with s130 0.9.0-1.alpha download. Copy them to \components\softdevice\s130.

    2. Change the flash start address from 0x1C000 to 0x1D000 in Options for Target.

    3. If you run it now you will get 0x3001 from sd_ble_uuid_vs_add(), with the new headers this corresponds to BLE_ERROR_NOT_ENABLED.

    You can enable ble by adding this to main():

    ble_enable_params_t ble_enable_params;
    memset(&ble_enable_params, 0, sizeof(ble_enable_params));
    ble_enable_params.gatts_enable_params.service_changed = 0;
    sd_ble_enable(&ble_enable_params);
    
Reply
  • The S130 headers and the S130 example included in SDK 7.2.0 is actually for s130 0.5.0-1.alpha. This is what you need to do:

    1. Add the correct headers, you find these in the s130_nrf51822_0.9.0-1.alpha_API folder that comes with s130 0.9.0-1.alpha download. Copy them to \components\softdevice\s130.

    2. Change the flash start address from 0x1C000 to 0x1D000 in Options for Target.

    3. If you run it now you will get 0x3001 from sd_ble_uuid_vs_add(), with the new headers this corresponds to BLE_ERROR_NOT_ENABLED.

    You can enable ble by adding this to main():

    ble_enable_params_t ble_enable_params;
    memset(&ble_enable_params, 0, sizeof(ble_enable_params));
    ble_enable_params.gatts_enable_params.service_changed = 0;
    sd_ble_enable(&ble_enable_params);
    
Children
No Data
Related