I have seen a few postings concerning this topic but have not read anything that helps.
I am using the CYBLE-022001 module and in an attempt to keep the power usage as low as possible it has been configured to use Deep Sleep as much as possible.
The BLE module is setup with a long connection interval which brings the unit out of Deep Sleep on a regular basis but I also need to react quickly to a couple of external sources.
I have an external input GPIO which has an interrupt component attached and a callback function setup so I know if this input caused the exit from Deep Sleep. The callback clears the interrupt and toggles GPIO pin as feedback.
I am also using a UART with the "enable wakeup from deep sleep" option enabled so that the incoming serial stream will bring the system out of deep sleep also. In a similar manner to the GPIO interrupt callback, I have set up a callback on the UART_RX_WAKEUP_IRQ_Interrupt(). The interrupt sets an activity flag and toggles a GPIO pin so I can detect when serial data has woken up the system from Deep Sleep. The activity flag can then hold off Deep Sleep until the serial data has been received.
In addition I am toggling another GPIO pin showing when the system goes in and out of Deep Sleep as a reference.
When the GPIO wake up input is asserted the module wakes and toggles the GPIO output pin so I can see this caused the wakeup.
When I send serial data to the UART I can see the module wake up from Deep Sleep but there is no indication that the callback function is called. Because my code is not aware that the incoming serial stream caused the interrupt (as the callback function is not called) the module enters Deep Sleep again before the whole character is received by the UART.
I am at a loss why the GPIO pin interrupt callback works fine but UART interrupt callback is failing.
I have tried using the StartEx(xxx_isr) function also which again works with the GPIO input but not the UART!
If anyone can point me in the right direction I would appreciate the input.
- PSoc Creator 3.3
- All components at latest versions.