2 Replies Latest reply on Feb 25, 2020 2:38 AM by BiKa_2115371

    Mail loop stucks randomly on  functionn

    BiKa_2115371

      Hi there,

       

      My code -running on a PSoC 4200BLE 4248 family- stuck randomly on mail loop CyBle_ProcessEvents() calling. The priority of BLE Interrupt is the highest possible (0). This malfunction disappeared if the deep sleep mode is disabled, of if my BLE Event handling routine is empty (no functional BLE). When code is stucking my BLE handling routine does not executed at all.

       

      Any glue about it?

       

      Regards

      Bill

        • 1. Re: Mail loop stucks randomly on  functionn
          GaneshD_41

          Hi Bill,

           

          Please program your board with the BLE_Findme code example available in PSoC Creator code examples section to check whether there is some issue with the hardware you are using. This code example will work flawlessly.

           

          If the above code example works, your hardware is fine. Have you gone through BLESS deep sleep code example? If yes, please check whether your firmware flow is according to the flow in example project.

           

          https://www.cypress.com/documentation/application-notes/an92584-designing-low-power-and-estimating-battery-life-ble

           

          If you have followed the flow and still if you are seeing issue then, please comment the events in Eventhandler function and check which event is causing the issue.

           

          If possible please attach your project here. We will check it at our side.

           

          Thanks

          Ganesh

          • 2. Re: Mail loop stucks randomly on  functionn
            BiKa_2115371

            Good morning GaneshD,

             

            let me apologize for my delayed answer but, I was delving on this very disturbing situation of CPU stuck.

             

            Finally I managed to find out the reason for CPU stucking. Actually there were 3  (yes three!!) reasons:

             

            1. A forgotten CyDelay(20). It seems that 20 ms delay is not permittable for BLE in wake up from Deep Sleep mode

            2. Wrong Power CPU handling at CYBLE_BLESS_STATE_EVENT_CLOSE state

            3. Writing on FLASH (the FLASH clock is gated at Deep Sleep)

             

            I hope my flaws could be valuable for other developers

             

            Best Regards

            Bill