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.

CC2640R2F: Micro_ble advertisement issue

Part Number: CC2640R2F

Hi all,

I am currently working on CC2640R2F Microble stack of SDK_3_40_0_10. I am using this for MultiRole application(scanning and advertisement). I'm advertising immediately whenever a device is scanned and I also have half an hour publishes (to check device status). 

Every 1.30 hours I don't receive any advertisement from the device (packets are missed). But I get packets normally. This happens all the time.

I want to know why I miss packets at an interval of 1.30 hours.

Thanks,

Syed.

  • Hi Syed,

    I will have a look to your issue.

    - Are you using one of the example we provide in the SDK? If yes, have you modified it?

    - After 1.30 hours, what happen? Is the device crashed or is it possible to have it back receiving the data properly?

    - Have you tried to disable and re-enable the reception once every 30 minutes to see if the problem still happen?

    - Have you tried to connect the debugger to see what happens after 1.30 hours? (you can find some guidelines here to help you)

    Best regards,

  • hello ,

    Thanks for your immediate response,

    - We used your examples named uble_Bcast_scan under Micro_BLE_example simple link_2.20 and modified that routine code not touching the drivers.

    - After one and half hour the device doesn't crash or hung, only the publish on that instance is missing. I saw the next advertisement after half an hour till one and half hour and another packet is missing.

    - the advertisement is actually an Non-Connectable one, before performing the advertisement i turn off the scanning and start the advertisement. i didn't get the point of your question that disabling and re-enabling the reception for every 30 minutes.

    -actually i haven't tried with the debugger, let me have a try with it once.

    - One more thing is i tried to print the state after the advertisement done using the the callback function

    UBLEBcastScan_bcast_advDoneCB(ugapBcastState_t  newState)

    and tried to print the "newState" which is an integer that returns either 0 or 1.

     What i saw is that when that state is "0" i received the advertisement, when the state is "1" i miss the advertisement. I didn't know the meaning of the 1 and 0 i cant find in the documents, all the documents are saying that is the error code 

  • Hi, 

    I figured out that 0 means success and 1 means failure. I get the failure status (1) only after 1:30 hrs. But the very next advertisement(after 30 minute) I get success status. This cycle continues. In summary, every 30 minute I advertise and I miss packets every 1:30 hrs. 

    Note:

    This happens only when i do both scanning and advertising. If I just do advertising(every 30 min) I don't miss any packets after 1:30 hrs.

    Thanks,

    Syed.

  • Hi,

    Interesting. Try to verify if some memory issues (such as a too small heap size) could explain the issue. To do so, please use the debugger and ROV.

    Regards,

  • Hi Clement,

    I have analysed using ROV. Here is the output. At one point I got total free space only 19 but other than that it is mostly free. Is that an issue? Is there any document to analyse heap memory? 

      

    Thanks,

    syed.

  • Hi,

    I don't know the whole content of your application. But, clearly, with only 19 bytes of available memory at one point, the risk of a memory allocation fail is high.

    Try to find in your code which function(s) allocate(s) memory. See what happens if the function cannot allocate the expected amount of memory. Then instrument your code in order to see if this malloc is failing at one point.

    I hope this will help,

    Kind regards,

  • Hi,

    I removed all my functionalities. now my device is only scan (every minute for 10 seconds) and publishing (at an interval of 30 mins). I still have that packet missing issue.I also tested with the CC2640R2 launchpad. Results are same.

    My base code is  microBLEBcastScan in BLE5 examples.

  • Hi,

    Can you specify what "publishing" means in your case?

    Are you saying you are running the Out Of the Box example without any modification?

    Regards,

  • Hi Clement,

    I meant advertising when I said publishing. 

    I'm running the Out of the box demo with modifications in advertisement packet structure, frequency of scanning and advertising.

    Thanks,

    syed.