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: CC2541

Part Number: CC2541
Other Parts Discussed in Thread: BLE-STACK

Hello everyone!

Sometimes BLE connection between CC2541 and smartphone on Android can be broken with error, but CC2541 stay on connected mode ( GAPROLE_CONNECTED ), or in error mode ( GAPROLE_ERROR ). In this case i try to force disconnected (GAPRole_TerminateConnection()) or reanable Advertising mode ( GAPRole_SetParameter( GAPROLE_ADVERT_ENABLED, sizeof( uint8 ), &enable_adv ); where enable_adv is TRUE ), but this does not always work.

Sometimes mode is still GAPROLE_CONNECTED or GAPROLE_ADVERTISING but there is no signal on the air.

So I have three questions:

1) What should I do if I get GAPROLE_ERROR or GAPROLE_WAITING GAPROLE_WAITING_AFTER_TIMEOUT status?

2) How to find out that the Advertising (or something else in the stack) does not work correctly?

3) Can I completely reinitialize the entire stack without restarting the entire controller?

  • Hello Vasyl,
    Sorry for the late reply.
    Which ble-stack version do you use?
  • Hello Eirik!

    That's OK. My questions are more general in nature, and problems with BLE occur very rarely. Over the last 2 years, we have manufactured over 50,000 devices and has got only 3 complaints.

    I just want to find out how to identify the fault of the BLE and how to restore the correct work.

    I use BLE-CC254x-1.4.2.2.

    Thanks.

  • Hello Vasyl,
    1) In simple_peripheral, you will get GAPROLE_WAITING state change event if either side initiates disconnection or you will get GAPROLE_WAITING_AFTER_TIMEOUT after supervision timeout has been reached due to not receiving any packet from the master. Therefore you could for example try to restart advertising in these states. I am not familiar with any usual suspects for GAPROLE_ERROR. There can be multiple reasons as you can observe in profile role source peripheral.c. A hard device reset might be required.
    2) Not that I know of. There is no way to ping the stack.
    3) No,
    HCI_ResetCmd will reset the link layer, but not the host which would also be required. Best bet is a hard device reset with HAL_SYSTEM_RESET.
  • Hello Eirik!

    What should pay attention when using observe? I have migrated a part of the code from the SimpleBLEObserver example in the SimpleBLEPeripheral. I use continuous scan and for that, when I get GAP_DEVICE_DISCOVERY_EVENT state change event, I call function GAPObserverRole_StartDiscovery again. Scan Duration 1 seconds.

    Best regard, Vasyl

  • Hello Vasyl,
    I am not sure what you mean.
    The GAP_DEVICE_INFO_EVENT will be received for every new device found before the end of the scan (scan duration reached) and the GAP_DEVICE_DISCOVERY_EVENT is received.

    Although the Simplelink academy trainings are for a newer generation of devices (C26xx) many of the key concept in the "Bluetooth Low Energy Scanning and Advertising" are also relevant for a CC2541 device:
    dev.ti.com/.../
  • 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.