KW36 LOWPOWER

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KW36 LOWPOWER

1,432 Views
wjw2023
Contributor I

KW36 enter lowpower mode,start low power timer,It was found that the timer was inaccurate .

test_timer = TMR_AllocateTimer();
TMR_StartLowPowerTimer(test_timer , gTmrLowPowerIntervalMillisTimer_c, 1000, set_event, NULL);

0 Kudos
Reply
5 Replies

1,402 Views
luis_maravilla
NXP Employee
NXP Employee

Hello, Could you help us bring more information please?

What example are you running?

What version of MCUXpresso and SDK are you using?

Are you using the FRDM-KW36 or a custom board?

Do you have any other modifications on your code?

0 Kudos
Reply

1,358 Views
wjw2023
Contributor I

sdk ver 2.2.5

example:w_uart

 

Create a task and implement the following code :

static void set_event(void *param)
{
OSA_EventSet(event, 1);
}
 
static tmrTimerID_t p_timer = gTmrInvalidTimerID_c;
 
void test_service()
{
uint32_t count = 0;
    osaStatus_t status;
    osaEventFlags_t flags = 0;
    p_timer = TMR_AllocateTimer();
TMR_StartLowPowerTimer(p_timer, gTmrLowPowerIntervalMillisTimer_c, 200, set_event, NULL);
event = OSA_EventCreate(true);
 
    for (;;) {
status = OSA_EventWait(event, ~0, false, 1000, &flags);
if (status == osaStatus_Success && (flags & 1)) {
if (++count >= 300) {
count = 0;
PWR_DisallowDeviceToSleep();
printf("test.........\n");//1分钟打印一次
PWR_AllowDeviceToSleep();
}
}
}
}
 
The execution result is shown in the figure. After entering low power consumption, the timing is inaccurate 
wjw2023_0-1746614965548.png

 

 

0 Kudos
Reply

1,293 Views
luis_maravilla
NXP Employee
NXP Employee

Hello

When you use FreeRTOS in low power mode for your demo application, Its necessary to check when the next task it is going to change, and set a timer that synchronizes the timer you created as it exits the low power mode, and recover the time and make the call to adjust to the time that was sleep during the Low power mode, this synchronization recovers time from low power use.

Also, I would recommend checking the priority of the task you created to be set appropriately; If other tasks have higher priority the timer task might get delayed.

Best Regards

Luis

0 Kudos
Reply

1,328 Views
luis_maravilla
NXP Employee
NXP Employee

Hello

I need to confirm if the example w_uart is the bm or the FreeRTOS example.

Best Regards

Luis

0 Kudos
Reply

1,308 Views
wjw2023
Contributor I

Hello

FreeRTOS example.

I have provided the source code and operation logs above. Can we conduct analysis based on these? 

0 Kudos
Reply