How can I verify that my system is entering sleep mode? Are there specific callbacks that get called when going to sleep/waking up?
My code is currently calling the following functions:
/* * Upon a wakeup cycle, wait for the XTAL32M crystal to settle. * BLE, USB and UART blocks require the XTAL32M to be up and * running to work properly. */ pm_set_wakeup_mode(true); /* Set the desired sleep mode. */ pm_sleep_mode_set(pm_mode_extended_sleep); /* Set the desired wakeup mode. */ pm_set_sys_wakeup_mode(pm_sys_wakeup_mode_fast);
Is this all I need to set to make sure between advertisments we sleep?
If I am the central and I'm scanning, what type of sleep schedule can I expect?
我读SmartSnippe在另一篇文章ts Toolbox cannot properly read sleep cycle values in the uA. If we want to confirm the current usage of our device over a long sleep cycle how do you recommend we procede?
Thank you,
John
Device:
Hi John,
Many thanks for your question. We will reach out directly in your registered email address.
Thanks, PM_Dialog
Hello
Here is an answer for the DA1468x
If you want to be sure that the system is in sleep mode you can use a JTAG probe and use a breakpoint on the WFI instruction. The JTAG probe will help to identify the precise moment when all conditions are met to go to sleep (no waiting tasks in os, ble, peripherals adapters, ...). At this precise moment, all ressources shut-down by the sleep are not available (for instance I2C register bank or any register bank in a shut-down power domain). The code line for WFI is located in the CMSIS file delivered by ARM (sdk/bsp/include/cmsis_gcc.h). This break should allow you to check the power supplies of your peripherals and your GPIO states to be sure that nothing is missing to maintain minimal services.
After wake-up, all these register banks are restored by the wake-up procedure so you can see them going to zero during shut-down and get back to their previous states after wake-up.
The system uses Timer 1 to manage its sleeping time so you could also send signals from the Timer1 Interrupt handler for instance a GPIO and a scope or a LED.
Bob
Hi Bob,
Many thanks for your indication and for your answer.
Regards, PM_Dialog