Adl_pwrdwn and SLEEP mode


I would like to use API functions of adl_pwrdwn.h library to allow SLEEP mode with GSM stack turn-on to save some power in my application.

I have made a very simple openAT which subscribe to service and then call the pwrdwnAllowed API. There is also a timer every 1 minute to check the exit of the sleep mode, which as stated in documentation, cause the sleep exit

#include "adl_global.h"
#include "adl_pwrdwn.h"

adl_tmr_t *AppInit_Timer;
s32 PwrDwn_Handler;

// callback of cyclic timer
void AppInitFunc (u8 TimerId)
	 adl_rtcTime_t Time;
	 adl_rtcTimeStamp_t Stamp;
	 ascii buff[20];


	 adl_rtcConvertTime(&Time, &Stamp, ADL_RTC_CONVERT_TO_TIMESTAMP);

	 wm_sprintf(buff, "TimerAPP:%ld\r", Stamp.TimeStamp);
	 adl_atSendResponse(ADL_AT_RSP, buff);

// Callback for 32Khz mode entrance
void CB_SleepEntrance ( void )
	 adl_atSendResponse(ADL_AT_RSP, "Sleep entrace\r");

// Callback for 32Khz mode exit
void CB_SleepExit ( void )
	adl_atSendResponse(ADL_AT_RSP, "Sleep exit\r");

// Start function
void Start(void)
    	adl_atSendResponse(ADL_AT_RSP, "START\r");

	PwrDwn_Handler = adl_pwrdwnSubscribe(CB_SleepEntrance, CB_SleepExit);

	if (PwrDwn_Handler > 0)
		s32 ret;

		ret = adl_pwrdwnAllowed(PwrDwn_Handler);

		if (ret == OK)
			adl_atSendResponse(ADL_AT_RSP, "OK power down\r");
			adl_atSendResponse(ADL_AT_RSP, "Error allow power down\r");
		adl_atSendResponse(ADL_AT_RSP, "Error power down\r");

	// Set up 1 minute cyclic timer
       AppInit_Timer = adl_tmrSubscribe (TRUE,600,ADL_TMR_TYPE_100MS,(adl_tmrHandler_t)AppInitFunc );

However, I never see the entrance of sleep.
If I give at+w32k command, then I get the entrace of sleep but the module reset (maybe it is not allowed when prwdwn service is enabled)

Anyone has use the adl_pwrdwn library or is there any sample?

That’s my current configuration:

“DWL”,“V08b13”,"",“Sierra Wireless”,55344,“111611 18:03”,“dda36757”,“00010000”
“FW”,“FW_SRC_747_8_F4_3.Q2687G”,“R7.47.4.201208311102.Q26CL702”,“Sierra Wireless”,2221264,“083112 11:02”,“6aa633a2”,“00020000”
“OAT”,“01.00.20140731120828”,“Mobi.Nyx”,“Contrive srl”,75944,“073114 12:08”,“1a19cfa4”,“00260000”
-“Developer Studio”,“”
-“Open AT Application Framework package”,“”
-“Open AT OS Package”,“”
-“Firmware Package”,“”
-“ExtendedATApplication Library Package”,“”
-“Internet Library Package”,“”

Thank you.

Best Regards,


The power down service only provides you with the ability to have callbacks on the entry and exit of 32KHz mode, it does not trigger the unit to go into sleep mode.

To get it to go into sleep mode you need to use the w32k command and either set it to go into the mode without DTR which is designed for units running Open AT that do not specifically want to control the DTR line to take the unit in and out of sleep mode. As you have noted the w32k setting is not persistent across power cycles you do need to set it when the application runs.



Hi Matt,

thank you for reply.

I finally tried using just w32k command and the module current consumption drops as expected. I will not use pwrdwn feature, because I don’t need those callbacks.

What I have see is that I’m able to read digital inputs using adl_gpio API (and for me is good) in SLEEP mode, despite documentation state that peripheral are disabled during this mode…

I will check if other resource (in particular the SIM card) are available in SLEEP mode.