KW36 LOWPOWER

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

KW36 LOWPOWER

1,691 次查看
wjw2026
Contributor II

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 项奖励
回复
5 回复数

1,661 次查看
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 项奖励
回复

1,617 次查看
wjw2026
Contributor II

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 项奖励
回复

1,552 次查看
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 项奖励
回复

1,587 次查看
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 项奖励
回复

1,567 次查看
wjw2026
Contributor II

Hello

FreeRTOS example.

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

0 项奖励
回复