Please share the project we will look and see the issue.
Unfortunately i cannot post my full project here.
i can specify my sleep function :
CyBle_ProcessEvents(); // service BLE stack events
CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP); // put BLESS into lowest power mode
intrStatus = CyEnterCriticalSection(); // disable interrupts
blessState = CyBle_GetBleSsState(); // get current BLESS state
iprintf("BLE_STATE: %d, CPU_STATE: %d");
CyExitCriticalSection(intrStatus); // re-enable interrupts
// SEND SOME STUFF.
Also see CYBLE_EVT_HCI_STATUS.
The BLESS system can be wakeup from Deep Sleep mode whenever BLE events (advertisement/connection events) are generated. We generally put the BLESS system into Deep Sleep mode between these advertisement/connection events. These events are responsible for waking the BLESS from Deep Sleep and further this BLESS interrupt will wakeup the CPU from Deep Sleep mode. Please refer the section A.1 Current profile in these document for more information.
This may be the case if we stop advertising before entering into the Deep Sleep mode (where there is not having any other interrupt or connection events to wakeup) may not go into Deep Sleep mode.
Can you please specify a set of commands for BLE, before sleep,
that will enable me going to sleep, and waking up Only by a WTD interrupt?
No advertising or any other BLE interrupts.
Pure WDT wakeup, and continue BLE from there.
Can you please tell me up to how much time you need to advertise and after that stop advertising. And also the time you need to stop advertise.
i am using a 1 second interval in my system. i want to send a packet, go to sleep for the rest of the time, knowing nothing will wake me up until the next second.
Trying hard to make this happen:
(1) Do stuff.. ( system can be advertising during this period)
(2) Send 1 packet over BLE, make sure it arrived. - (even better)
(3) Stop advertising, Send BLE to Sleep.
(4) Deep Sleep of system without waking up for anything. (as much sleep time as possible ~1 sec)
(5) wake up only by WDT after 1 second passed. and go to (1) again....
* can either advertise while (1) or just send a packet during (2), one of them happening is just fine.
Please refer the attached project where BLE enters into the Deep Sleep mode after stopping the advertisement and WDT interrupt will enable the system and starts advertising. You can see the code flow in the TERA_TERM where UART is used for printing the statements.
BLE interrupt priority should be 0 and wdt interrupt priority is 1.
Please let me know if this helps you.