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

receiving ble evt callbacks using Mesh SDK 2.0.0 and SD6.0.0 (SDK15.0.0)

Hi @ll,

I'm not able to receive any ble events that should be triggered by the SoftDevice.

What I did:
- Using dfu_example (added beaconing advertiser and connectable advertiser)
- in mesh_softdevice_init.c:
  - replaced in mesh_softdevice_init(nrf_clock_lf_cfg_t lfc_cfg)
    //RETURN_ON_ERROR(sd_softdevice_enable(&lfc_cfg, app_error_fault_handler));
    RETURN_ON_ERROR(nrf_sdh_enable_request());
-  in my main(void):
  - after initialize() for initializing sd & mesh I added:
     NRF_SDH_BLE_OBSERVER(m_ble_observer, APP_BLE_OBSERVER_PRIO, ble_evt_handler, NULL);

But I never get the handler being called.

Is there something I missed?

Thank you in advance for your help!

Bye
Andrej

Parents
  • Hi Andrej, 

     

    I just tried here with the light server example and it worked for me. Not sure what could be wrong. I assume you have enable all the module needed in sdk_config.h ? 

    Which priority level did you set ? 

    Maybe you can have a look at my example ? When the device get connected it will print "connected". 

    server - advertise.zip

  • Hi Hung,

    thank you for your reply.

    I did the following:

    - extracted the Mesh_SDK_2.0.1 into a new directory
    - extracted your example into new_mesh_dir/examples/light_switch/(server - advertise)
    - the same for the SDK 15.0.0 into ~/SDKv15 to match your settings
    - compiled and flashed the example including SD6.0.0
    --> So I'm using the MeshSDK 2.0.1 NRF SDK 15.0.0 out of the box and your example including all settings you set.

    Device is coming up as unprovisioned device and "nRF5x Mesh Light".

    Once I'm trying to connect nRF Connect for mobile still gets stuck at Service Discovery and all Log I get over SEGGER is:

    <t: 0>, main.c, 206, ----- BLE Mesh Light Switch Server Demo -----
    <t: 544>, main.c, 156, Initializing and adding models
    <t: 5465>, main.c, 244, Device UUID : 0059FFFF00000000xx04xxxxxxxxxxxx

    So there is no Callback for the BLE Evt.

    I tried the SEGGER on Linux and Windows with the same result.

    So where is the problem?

    Could please someone else try your example and verify that it is working?

    Bye

    Andrej

  • Hi Andrej, 

     

    I just got my coworker tried and it worked for him. I also tried with a fresh copy of the 2 SDKs and it also worked. Have you tried with a fresh copy ?


    I attached here the project file as I fixed the SDK_ROOT instead of using hard coded Path as in the .zip file . I assume you fixed it. 

     

     

    light_switch_server_nrf52832_xxAA_s132_6_0_0.zip

  • Hi Hung,

    paths were fine as I could compile it.

    It turned out that compiling it on my Windows laptop I'm able to connect an get a callback and everything.
    Compiling it on my Linux (Ubuntu 17.10 with GNU Tools for Arm Embedded Processors 7-2017-q4-major) machine it is not working. I can scan and connect the device but service discovery and ble callback are not working.

    So this is a compiler/SES issue Disappointed

    Even though SES brings it's own gcc toolchain (which is the same version for Windows and Linux) it looks like the binary that is compiled and linked is different or buggy.

    Looks like the IDE is not that cross-platform as it tells to be.

  • Hi Andrej,

    Are you enabling the SDH BLE module?

    static void initialize(void)
    {
    //...
       uint32_t err_code = nrf_sdh_enable_request();
       APP_ERROR_CHECK(err_code);
    
       uint32_t ram_start = 0;
       /* Set the default configuration (as defined through sdk_config.h). */
       err_code = nrf_sdh_ble_default_cfg_set(MESH_SOFTDEVICE_CONN_CFG_TAG, &ram_start);
       APP_ERROR_CHECK(err_code);
    
       err_code = nrf_sdh_ble_enable(&ram_start);
       APP_ERROR_CHECK(err_code);
    //...
    }
    

    also make sure the SDK modules are enabled in the sdk_config.h. From examples/light_switch/proxy_server/include/app_config.h:

    #define NRF_SDH_ENABLED 1
    #define NRF_SDH_BLE_ENABLED 1
    #define NRF_SDH_SOC_ENABLED 1
    #define NRF_SDH_BLE_GATT_MAX_MTU_SIZE 69
    #define NRF_SDH_BLE_PERIPHERAL_LINK_COUNT 1
    #define NRF_SDH_BLE_SERVICE_CHANGED 1
    

    Best,
    Thomas

  • It's quite strange because if you can't get any BLE event when compiling in Linux , then the proxy example should have the same problem. But I assume that you can actually use the proxy example and connect to the phone ?

     

Reply Children
Related