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.

Parents
  • Hello,

    I assume you have ported the example from Keil or another compiler to SES, since you are using SDK12.3.0, so using two different versions, depending on how you ported it, it may behave a bit different. The security mode that you speak of can be an addon from SDK12.3.0 to SDK16.0.0.

    Before you dig too deep into this, perhaps you can just use the SES version that works? 

    If you decide to dig into it:

    When it isn't generating any events. Do you get anything in the log on the peripheral? Does it behave different on the phone side? Any messages indicating that it wouldn't work? Does it stay connected? Does it disconnect? Is the log different from the two SES versions?

  • Hi,

    I would like to delete/uninstall older SES,

    Yes, I ported the proximity application and removed IAS client and added server there (need to implement a find me application).

    There is no event in log as well also tried with break point. The older SES has logged these.

    Since the program has connection events, why no event for IAS (no event at ble_evt_dispatch).?

    No difference in connected mobile app.

  • If you get hold of an nRF52 DK, I believe you will have a much easier time for developing. If you get nothing out, then it is difficult to say what the error is.

    Regarding logging:

    In your project, are there any calls to: NRF_LOG_INFO()? Can you send me the sdk_config.h file that you are using?

  • Hi,

    Yes, nRF52 is easier than nRF51, but this was an bit old project and I don't want to update it now. Config file is attached.

    8422.sdk_config.h

  • Edvin said:
    In your project, are there any calls to: NRF_LOG_INFO()?

     

    So where do you look for the log? Have you tried segger RTT viewer?

  • 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.

Reply
  • 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.

Children
Related