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

nRF51 IAS Service no BLE event (when compiled different machine)

Hi,

I have implemented ias serive with nRF51 and SDK 12.3, but not generating any ble event with IAS service. The code is working fine when compiled in a different machine running with SES 4.30c, but I don't think this will be compiler issue. I used the same files in both machines including startup files. The other machine has SES 4.50.

The device can successfully connect to "nRF Connect" running in a mobile but no event is generated for an alert level write/update. I have found the newer version of IAS (with SDK 16) has a security mode, but not in SDK 12.3. Is this an issue?

Initialization is

/**@brief Function for initializing services that will be used by the application.
 */
static void services_init(void)
{
    /* Initialize the services used by the application */
    uint32_t                           err_code;
    ble_ias_init_t                     ias_init;
    ble_bas_init_t                     bas_init;

    // Initialize IAS Service.
    memset(&ias_init, 0, sizeof(ias_init));

    ias_init.evt_handler                = on_ias_evt;

    err_code = ble_ias_init(&m_ias, &ias_init);
    APP_ERROR_CHECK(err_code);

    // Initialize BAS Service.
    memset(&bas_init, 0, sizeof(bas_init));
    bas_init.evt_handler                = on_bas_evt;
    bas_init.support_notification       = true;
    bas_init.p_report_ref               = NULL;
    bas_init.initial_batt_level         = 0;
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_char_attr_md.cccd_write_perm);
    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_char_attr_md.read_perm);
    BLE_GAP_CONN_SEC_MODE_SET_NO_ACCESS(&bas_init.battery_level_char_attr_md.write_perm);

    BLE_GAP_CONN_SEC_MODE_SET_OPEN(&bas_init.battery_level_report_read_perm);

    err_code = ble_bas_init(&m_bas, &bas_init);
    APP_ERROR_CHECK(err_code);
}

s130_nrf51_2.0.1_softdevice.hex is used with the project.

  • Hi,

    I used RTT Terminal and/or RTT viewer

    SDH:DEBUG:sd_ble_enable: RAM start at 0x200033c0
    SDH:WARNING:sd_ble_enable: RAM start should be adjusted to 0x20001fe8
    SDH:WARNING:RAM size should be adjusted to 0x6018 
    Find_Me:INFO:Bonds erased!
    Find_Me:INFO:Find me app started
    Find_Me:INFO:Fast advertising
    Find_Me:INFO:ADC Event Handler
    Find_Me:INFO:Connected.
    Find_Me:INFO:BATT Notification Enalbled!
    Find_Me:INFO:BATT Notification Disabled!

    I think it might be hard to debug, so I will continue with the older version, but I was curious to know why some events working and some not.

  • First of all, you should adjust the RAM settings according to the log. The log doesn't say anything about a crash. Only that the connected device enabled and then disabled notifications on the battery service. I don't know what your application is supposed to do. But from the log it doesn't seem to be anything wrong.

    Does the log say anything else when it is not acting as you intend? What does the log on the working device look like?

  • What kind of messages are you expected in the log? There was no crash, the device still running. The older compiler program log has the IAS event messages also.


    Is there any strategy we can try for debugging?

  • I don't know what your application is supposed to do. Compare it with the working version. What are you expecting to happen? What is it that doesn't work compared to the working version?

Related