Hi, I have a problem with waking up a device, description as below.
Application description:
I made some application which is based on Serial example - all is working fine till I want to add low power mode functionality.
The application logic looks that nRF52840-DK is talking with a modem (AT commands) via Serial port and each i.e. 2 minutes is sending data to the server. Timer and Serial interrupts are working with Scheduler, application without low power mode are working fine but there is a need to apply low power mode because the device will work from battery. Regarding PWR_MGMT example I try to add "low power mode" functionality to my application. Unfortunately, the application doesn't want to wake up after going to sleep mode.
Problem description:
I have no idea about power mode on NRF so I took "pwr_mgmt/" example (SDK 15.2) and try to apply changes to my application which was based on "Serial/" example. Regarding below code:
int main(void)
{
board_system_init();
modem_rst();
// ret_code_t ret_code = nrf_pwr_mgmt_init();
// APP_ERROR_CHECK(ret_code);
ret_code_t mainErrCode = nrf_serial_write(&serial_uart, "\r\nSensor ready.\r\n", strlen("\r\nSensor ready.\r\n"), NULL, NRF_SERIAL_MAX_TIMEOUT);
APP_ERROR_CHECK(mainErrCode);
application_timers_start();
while (true)
{
app_sched_execute();
// nrf_pwr_mgmt_run();
}
}
When nrf_pwr_mgmt_init(); and nrf_pwr_mgmt_run(); are off application works properly - I men when low power mode is disabled then logs from nRF board looks like below:
[14:56:27:301] Changing time interval to 3s␍␊
[14:56:30:280] ␍␊
[14:56:30:280] AT+CSQ␍␊
[14:56:30:317] ␍␊
[14:56:30:317] no range...␍␊
[14:56:33:280] ␍␊
[14:56:33:280] AT+CSQ␍␊
[14:56:33:333] ␍␊
[14:56:33:333] Range OK - Changing time interval to 20s␍␊
etc...
[14:56:27:249] REBOOT_CAUSE_SECURITY_RESET_UNKNOWN␍␊
[14:56:27:270] Neul ␍␊
[14:56:27:270] OK␍␊
[14:56:30:301] ␍␊
[14:56:30:301] +CSQ:99,99␍␊
[14:56:30:301] ␍␊
[14:56:30:301] OK␍␊
[14:56:33:302] ␍␊
[14:56:33:302] +CSQ:23,99␍␊
[14:56:33:302] ␍␊
[14:56:33:302] OK␍␊
etc...
But when I turn on low power mode I mean - when I uncomment part responsible for pwr mgmt: nrf_pwr_mgmt_init(); and nrf_pwr_mgmt_run();
Logs from board UART and modem looks like below:
BOARD:
[14:57:59:287] ␍␊
[14:57:59:287] Changing time interval to 3s␍␊
(and he is never wake up)
MODEM
[14:57:59:235] REBOOT_CAUSE_SECURITY_RESET_UNKNOWN␍␊
[14:57:59:256] Neul ␍␊
[14:57:59:256] OK␍␊
need(modem works OK)
If you need more info about the code pleas fell free to write.
BR's
Frank.