Kinetis KL15z128 SDK with power manager problem

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

Kinetis KL15z128 SDK with power manager problem

618 Views
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 Kudos
2 Replies

336 Views
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 Kudos

336 Views
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 Kudos