1 Reply Latest reply on Apr 29, 2020 6:55 AM by GaneshD_41

    psoc 4 ble discovery problem


      when CYBLE_EVT_GAP_DEVICE_CONNECTED comes, I use CyBle_GattcStartDiscovery() to discover services of slave device.  Then the code in the main loop can not run, such as the LED blink. It seems like that the interrupt of BLE is always work. When CYBLE_EVT_GATTC_DISCOVERY_COMPLETE comes, the code in the main loop can run again. What is the reason, and how can i solve this problem.

        • 1. Re: psoc 4 ble discovery problem



          I guess you are calling the CyBLE_ProcessEvents() API in the main for loop. The execution of all the events which are in queue happens after calling the CyBLE_ProcessEvents() API. Please note that this is recommended practice to give importance to BLE events. Else the application may not work properly.


          Some tips:


          Please note that it is recommended to call the CyBLE_ProcessEvents() API atleast once in every connection interval. So you can configure a special timer and call the API inside that timer ISR.


          You can also configure another timer and call all your LED specific events in that timer ISR. You can give priority of this ISR more than than that of ISR above (which calls CyBLE_ProcessEvents() API).


          Please note that in any case the BLESS interrupt should have highest priority.