This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2652R: Service changed indication in ble5stack

Part Number: CC2652R

Hello.

Our project is based on the example of Simple Peripheral OAD on-chip for ble5stack. We found that the project did not implement service changed indication when switching from the user application to the persistent app and back. We tried to use the GAPBondMgr_ServiceChangeInd function for this, however when linking, we get an unresolved symbol error. We use the simplelink_cc13x2_26x2_sdk_3_10_01_11 SDK.

How to correctly implement the service changed indication in our project?

  • Vitaliy,

    I've looped in someone from our team who will assist. 

  • Hi Vitaliy,

    This is a bug that is currently being fixed and will probably be solved by the next quarterly release (or the one after it).
    The fix lies completely in changes within the user application.
    I can guide you on how to temporarily fix it so you won't have to wait for the next SDK release.

    1) Add the service changed indication call to the boot process:

    In your main application c file:
    Inside the function "SimplePeripheral_processGapMessage",
    Under the case of "GAP_LINK_ESTABLISHED_EVEN,
    At the end of the "if (pPkt->hdr.status == SUCCESS)" case,

    Add the following code:

    // If we are just connecting after an OAD send SVC changed
    if(sendSvcChngdOnNextBoot == TRUE)
    {
      GAPBondMgr_ServiceChangeInd(pPkt->connectionHandle, TRUE);
    
      sendSvcChngdOnNextBoot = FALSE;
    }

    2) Add the relevant called functions to your build process (without this, calling GAPBondMgr_ServiceChangeInd will fail):

    In your build_config.opt file add the following:

    -DV41_FEATURES=L2CAP_COC_CFG

    Please notice!
    As this is a temporary fix, it enables the use of L2CAP COC (Connection Oriented Channels) functions which will probably occupy some extra flash space. This should be corrected by the time the fix is out with the newer SDK.

    Please update if this fixed your issue.

    Best Regards,
    Yuval

  • Hello,  

    Thank you fo reply. We tried this in the Persistent App, but still got the "unresolved symbol" error.

  • Hey Vitaliy,

    Did you make sure that you clicked on "Rebuild Project" and not on "Build Project"?

    Best Regards,
    Yuval

  • Hey Vitaliy,

    Can you attach your map and projectspec files?

    Best Regards,
    Yuval

  • Hello,  

    What is ProjectSpec file? We cannot find it.

  • Hey Vitaliy,

    You need to add the -DV41_FEATURES=L2CAP_COC_CFG definition to the stack's opt file, not the app's.

    Best Regards,
    Yuval

  • Hello,  

    Thanks, now the project was built without errors. However, the service change notification still does not work. We even removed the if condition if(sendSvcChngdOnNextBoot == TRUE) from our code so that the indication would be sent every time when connected to the Persistant App. However, the Android smartphone displays the services that were in the user application.

  • Hi Vitaliy,

    Can you attach your map file?

    Best Regards,
    Yuval

  • Hello,  

    Yesterday we transferred our project to SDK 3.20.0.68, which does not have a separate stack project. Tell us, please, how in this case we can solve this problem?

  • Hi Vitaliy,

    In order to define COC in the new folder structure you can enable the define mentioned before in build_config.opt inside the app project.
    In addition, you will need to change the libraries used by the linker under "Extra Options" in the linker section inside the project settings:

    1) OneLib.a -> OneLib_coc.a

    2) ble_r2.symbols -> ble_r2_coc.symbols

    3) StackWrapper.a -> StackWrapper_coc.a

    In regards to the service not changing, have you tried attaching a debugger to a running target to see whether the variable in flash is set?

    You can also flash a led once the the variable gets written to flash to see if you reach this far. This would help eliminate many other issues.

    Best Regards,
    Yuval

  • Hi Vitaliy,

     

    I'm going to close this post due to inactivity. To reopen this thread, just post a follow up question. Otherwise, after 30-days of inactivity from this post, this thread will lock.
     

    Best Regards,

    Yuval

  • Hello,  

    Thanks for your answer.

    We did everything as you proposed and the project was built without problems.
    However, the notification does not work. The condition if(sendSvcChngdOnNextBoot == TRUE) has been removed, so a notification is sent every time it connects. We want to note that this problem arose on the Android smartphone after pairing with our device. Now, in order to forcefully update services, we have to re-pair and disconnect from the device. This is a very big problem when running OAD.

  • Hi Vitaliy,

    Just to see I'm understanding correctly:

    - You have you tested the same application with a launchpad and a PC running BTool and there the service changed indication is sent just fine

    - When you test your application with an Android smartphone, you do not get the service changed indication unless you unpair and pair again

    Is that correct?

    If that is the case, are you positive that it is the same image that is being downloaded from both distributors?

    In either case, have you tried attaching a debugger to a running target and seeing if that line of code (the one below the condition you mentioned) is being called?

    Best Regards,
    Yuval

  • Hi,  

    No, we have not tested our software with BTool.
    Yes, we connected the debugger and made sure that the line of code with notification is being called.

  • Hi Vitaliy,

    Please test the application with BTool.

    I suspect this might be an issue with the mobile app.

    Best Regards,
    Yuval

  • Hi,  

    We cannot test our device in BTool, because it does not find many of our BLE services (see screenshoot).

    We faced a similar problem on both Android and iPhone smartphones. For testing, we used many applications, including TI Simple Link Starter.