Hi,
I'm struggling to understand the behaviour of our software running on an nrf52832 and SoftDevice S132 v2.0 (SDK11.0).
The main function is something like this:
for (;;)
{
NRF_LOG_PRINTF("PM in\n");
power_manage();
NRF_LOG_PRINTF("PM out\n");
if (bGoToSleep == true)
{
NRF_LOG_PRINTF("Going to sleep\n");
nrf_drv_spis_uninit(&com_spi.spi_instance);
if (sd_power_system_off() != NRF_SUCCESS)
{
NRF_LOG_PRINTF("Unable to go to system off\n");
}
}
}
the bGoToSleep variable is set when a certain SPI frame is received on SPI slave device (an STM32 MCU is the SPI master).
Everything is working normally most of the times, I have all the debug information ("PM in", "PM out", and all my other debug log from advertising events, SPI frames, ...).
But from time to time, it seems that after several cycle of sd_power_system_off, and a wake up by a GPIO, I only get the debug log from the events like advertising, I don't see anymore "PM in", "PM out", and the software never enter the "if (bGoToSleep == true)". As if the software never execute the code outside the software events.
Any idea of what I am doing wrong?
thank you