Hello everyone,
Using Driver Suite 10.4 Ported to Keil, I am having trouble waking up from Sleep (LLS), using the Low Power Timer (LPTMR0) on a Kinetis KL15Z128xxx4.
I understand all that is needed to get it all to be set up in driver suite:
- under component inspector of the CPU, add LLS, and add LPTMR0 as a deivce for LLWU functionality.
- For Methods, add GetLLSWakeUpFlags(), and SetOperationMode()
- Make sure there is a Cpu_OnLLSWakeUpINT() function in the events list.
- Add a TimerUnit, which is LPTMR0, and add functions for setting offset and getting count, etc.
- I configure the LPTMR counter to be 1 sec ahead of the current grabbed Count (X + 1000), using a 1024 Hz Tick (~1ms)
- in main, call SetOperationMode(DOM_STOP, NULL, NULL); then I enter sleep.
- In the event Cpu_OnLLSWakeUpINT() call I check the flags as the following:
void Cpu_OnLLSWakeUpINT(void)
{
/* Write your code here ... */
(void)Cpu_SetOperationMode(DOM_RUN, PARAM_UNUSED_NULL, PARAM_UNUSED_NULL);
if(Cpu_GetLLSWakeUpFlags() == LLWU_INT_MODULE0)
WUT_LLWUFlag = true;
else
WUT_LLWUFlag = false;
}
**I then check the flag in main.
- When sleeping, I never wake up and enter PE_ISR(Cpu_INT_LLWInterrupt), I just d onot wake up.
As a basic test of the sleep/LLS, in main:
T0 = WUT_GetCounterValue(WUT_DevDrvPtr);
(void)WUT_SetOffsetTicks(WUT_DevDrvPtr, (uint8_t)WUT_CHANNEL_ID, (WUT_TValueType)(T0 + (uint16_t)1000));
(void)WUT_SetOperationMode(WUT_DevDrvPtr, DOM_STOP, PARAM_UNUSED_NULL, PARAM_UNUSED_NULL);
(void)Cpu_SetOperationMode(DOM_STOP, PARAM_UNUSED_NULL, PARAM_UNUSED_NULL);
sprintf(Buf, "\n\rHELLO WORLD\n");
(void)UART_SendString(Buf, (uint16_t)14);
I never wake up and I am locked out of SWD.