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.

CC2541 is not advertising

Other Parts Discussed in Thread: CC2541

Hi,

I am using CC2541 in my project. And during testing I came across very strange behavior. Following is the scenario:

1. Start advertising and connect using BLE  Device monitor.

2. Run for few seconds.

Repeat above steps for around 5-6 times and the device stops advertising. 

The device has one LED which turns on when starts the advertising by pressing the button on the device. When the issue occurs the LED turns on, but the BLE device monitor is not able to discover the device. Please note that the device is very much near to BLE dongle and I am turning on the LED in the peripheral state notification callback registered with GAPRole_StartDevice() function.

To come out of this condition, I have to reset the device. And after that device works normally.

It seems that the state machine of BLE Stack goes into some inconsistent stage and that is why it is not able advertise.

Has anyone face this issue? Any help is appreciated.

This is really major blocking issue for me. Please reply ASAP.

Thanks,

Dhaval

  • Hi Dhaval,

    Are you using the latest BLEv1.4 SDK?

    I think you you should be able to reproduce the behaviour in debug mode. When the issue occurs, please break and check what the GAP state is set to. Also, setup a sniffer to verify that the device isn't advertising (i.e. bug in Device Monitor)

    Best Regards

    Joakim

  • Hi Joakim,

    Thanks for your quick response!

    Yes, I am using BLE Stack v1.4. I am trying to reproduce the issue with Debug Mode. But it is bit difficult, as issue is random. There isn't any well defined steps to reproduce the issue. After doing connect-start data transfer over BLE-disconnect sequence multiple times issue appears.

    Device is not advertising when issue comes and that is for sure. As I have also tried to discover with Mobile application as well as with BLE device monitor. And both of them was not able to discover the device!!

    So it would be great if you can spare some time and give me some pointer on this.

    Thanks,

    Dhaval

  • Generally it is advisable to keep the scan interval on scan devices to a high value. At least advertising interval of peripheral + 10 ms for better chance of getting detected. 

    What is the advertising interval you have kept  on the peripheral device? Can you shorten that interval(DEFAULT_ADVERTISING_INTERVAL) and check again?

    Regards,

    Arun

  • Hi Arun,

    Thanks for your valuable suggestion! I will try after modifying the advertising interval.

    In out case advertising interval is 100ms.

    But I was wondering -

    1. Why this issue occurs after multiple try of connect-transfer data-disconnect?

    2. Once this problem occurs, even after trying so many times device won't be discover able in both, BLE Device monitor and mobile applications? With both of this it was discoverable previously.

    Thanks,

    Dhaval

     

  • Hi Dhaval,

    Ok. It looks like the GAP profile may not have initialized properly. There is no particular reason this should occur, but as Joakim said, you can interrupt the cpu when this occurs and check the gapProfileState value and check its state. This may require you to disable POWER_SAVING so that IAR debugger can stop you when required.

    Regards,

    Arun

  • Hi Joakim/Arun,

    Let me share few more observations on this issue:

    1. I am turning on the LED and it remains on till device is advertising. And when the issue occurs, LED was on. I am turning on the LED in the peripheral state notification callback function under 'GAPROLE_ADVERTISING' state. So I think the state is correct.

    Also, I am changing the 'gapProfileState' in this callback function with the state I received as an argument of the callback function.

    2. Also I have checked the state of 'gapRole_AdvEnabled' in that callback and it was TRUE.

    I have tried to reproduce this issue in debug mode, but no luck.

    It would be great if you can spare sometime and help me resolve this major blocking issue for us.

    Thanks,

    Dhaval

  • Hi,

    Can anyone, please help me to understand the disconnection sequence on Peripheral device? I mean once the central device sent the disconnection request what are all the sequence of events that happen on Peripheral device side?

    I think, this issues happens when I am still sending data to the Central device and at that time Central device sends disconnection request. And because of that the BLE stack on the peripheral device goes into some unrecoverable inconsistent stage.

    Any quick help is appreciated.

    Thanks,

    Dhaval

  • Waiting for the possible solution/suggestions on this problem.

    Please reply ASAP, as this is really a blocking issue for us.

    Thanks in Advance.

  • Hi Dhaval,

    Dhaval V said:
    I am turning on the LED in the peripheral state notification callback function under 'GAPROLE_ADVERTISING' state.

    Are you also turning it off in all other states? 

  • Yes Joakim, I am turning off the LED for any other state.

  • Hi Dhaval,

    Let's take a couple of steps back. You state that disconnects occur, which are not manually triggered, correct?

    Are you performing any Flash Write procedures or maybe running long algorithms?

    Could you describe what your application is doing once it connects?

  • Hi Joakim,

    1. No, the disconnect was the manual triggered. The disconnect action was triggered from Central device.

    2. No, there are no flash write or any long algorithm running after central device connects. We are capturing data from various peripherals connected and send it over the BLE.

  • Hi Dhaval,

    Hmm, that's interesting. So in your case, the Peripheral device gets disconnected from the Central and goes into GAPROLE_ADVERTISING, but doesn't actually advertise. Not sure what's going on there to be honest.

    I would be very helpful if you could catch it in debug mode to verify that there's no exception or error state.

     

  • Hi Joakim,

    Have you come across this type of issue? If possible, please try to reproduce the same at your end. To reproduce, you can keep sending data on various BLE services after connection and disconnect it. Do this for around 10-15 times. You might encounter with this issue.

    Do you know there is any limitation/known issue that we should not disconnect the device when we are sending data over BLE service? It will also help, if you can let me know the flow/sequence of disconnection.

    Thanks,

    Dhaval

  • I would like to share observation that I made with one more experiments.

    1. First, I have disabled all the data sending over the BLE i.e. I was capturing the data from various peripherals but was not sending it over BLE. That was working fine. Everytime it was advertising normally.

    2. After that I have enabled sending of each sensor one by one. And till before I enabled the last one it was working fine. But as soon as I enabled the last one the issue starts appearing. 

    Then I also change the sequence of enabling the data sending of the each sensor, then also same behavior. So from that it seems that when I am sending data for all the peripherals together it creates some problem.

  • Dhaval V said:
    But as soon as I enabled the last one the issue starts appearing. 

    Are you using Sensor tag or do you have your own design? Which serial protocol are you using?

    It could be that the serial communication takes up a lot of processing and in some cases not allowing the BLE Stack (or GAP Role) to perform necessary tasks.

    Best Regards

    Joakim

  • Hi Joakim,

    Yes, I am our own board. And I am using on board I2C and SPI to get data from various peripherals. But I really doubt that they are causing this issue. Why they are not allowing the device to advertising.. And also we are disabling all the peripherals when the central device disconnects from our peripheral device.

    It seems that the state machine of BLE stack goes into inconsistent stage and because of that even if the firmware requests for advertising, the BLE stack believes that it is already advertising.

    Thanks,

    Dhaval

  • Any update on this issue?

    Please spare a time to look at this issue.

    Thanks,

    Dhaval 

  • Hi Dhaval,

    I'm sorry, but i'm not able to reproduce the issue with SensorTag (default software). Do you have a procedure to replicate it on TI board? It will then be easier for me to locate if this is a bug on our end.

    Best Regards

    Joakim

  • Hi Joakim,

    We are sending data on four BLE services continuously and disconnecting without disabling that. After repeating this step for around 6-7 times, I encounter this issue.

    Is it possible to do the same thing with TI Board? I really doubt that it is related TI board or our custom board.

    Thanks,

    Dhaval 

  • Hi Dhaval,

    Have you checked in the Bluetooth settings on the IOS device.Maybe it will be still connected state.I am also facing the same issue.

    I am working on ANCS alert notification profile ,where i am trying to get the notification data from the IOS device.I am able to get everything into working but after subscribing to IOS generated UUIDS i am not able to disconnect from the app.Then i have to forget the device from the IOS bluetooth settings.

    I think this is a limitation on the side of IOS .Are you able to find any workaround regarding this issue?

    Best Regards

    Don