Kinetis KL15z128 SDK with power manager problem

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

Kinetis KL15z128 SDK with power manager problem

1,127 次查看
kamil-al
Contributor I

Hi,

I am currently testing behaviour of power manager example program, that can be found in kinetis SDK, and I have a strange problem.

Every time when I go to sleep in VLLS3, I would like to test wakeup source in LLWU_IRQ (I am using LPTMR0 as wakeup source - basically unchanged sample code), but it seems that code provided in LLWU_IRQ is not entering into if statement (condition based on GetInternalWakeupModuleFlag function).

I've manually checked LLWU->F3 register, and it is always 0 (no flags set) when it should have 1 bit set (the bit corresponding LPTMR0 wakeup flag).

Can anyone test this example and check if that works similar? Is that a bug in example code? How can I test wakeup source if GetInternalWakeupModuleFlag function is not working correctly?

0 项奖励
回复
2 回复数

845 次查看
Ryssus
Contributor II

Hi, I've tested that on FRDM-KL25 on the same sdk, and as far as I can see there are no flags set in register you've mentioned. Anyone else can test/check that?

0 项奖励
回复

845 次查看
jorge_a_vazquez
NXP Employee
NXP Employee

Hi Kamil Allaf, Ryssus

This is a normal behavior in this demo; This flag is actually setting, but MCU will reset from VLLS mode, a LLWU interrupt will be pending, but it will no be trigger until you get to the line NVIC_EnableIRQ(LLWU_IRQn);

But as you can see, this line is after the LPTMR_Init() function. Inside this function you change the value of the register CSR, and this clears the flag, so when you arrive to NVIC_EnableIRQ(LLWU_IRQn); the flag is already cleared. This is why in this demo, when you get to the handler, it is not entering into if statement.

Hope this information could clarify your question.

Best Regards

Jorge Alcala

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复