Hi,
I am using FRDMKE06z Board .
In code I am testing the stop mode by calling stop() api and i want to wake up controller using uart wake up.
I am using CANalyser and sending LIN wakeup signal.
Now when i am connecting the debugger I am able to wake up the controller.
When I am disconnecting the debugger it seems the wakeup is not causing controller to wake.
I have written the code as stated in 33.4.6.2 Stop mode operation of MKE06P80M48SF0RM.pdf.
Please provide some sample code for the same or solution to this problem.
Regards
Ajith Arikkath
Hi Ajith
Are you using processor expert? Can you share your sample code. Maybe processor expert's setting you need to check. If you share your code along with the IDE name you are using, People will recreate that issue and you will get your solution soon.
Regards
Amit
Hi Amit,
Please find the code which is implemented before calling stop(); functionality.
And I am expecting interrupt and waiting in ISR.
Please check this and let me know anything else I have to initialize.
void lin_lld_uart_sleep(uart_channel_name channel, l_ifc_handle iii)
{
lin_node *lnode_p;
lnode_p = (lin_node *)&lin_node_descrs[channel];
tUART* _pUART;
pUART = (tUART*)(lnodep->pUART);
lnode_p->state=SLEEP_MODE;
/* checks before going for Controller Stop mode*/
while ((!(_pUART->uartsr1.byte & UART_S1_TDRE_MASK))||
(!(_pUART->uartsr1.byte & UART_S1_TC_MASK))||
((_pUART->uartsr2.byte & UART_S2_RAF_MASK))) ;
/* Clear flag */
_pUART->uartsr2.bit.rxedgif = 1;
pUART->uartbdh.byte |= UARTBDHRXEDGIE_MASK;
/* clear LIN Break Detection flag */
pUART->uartsr2.byte |= (UARTSR2LBKDIF_MASK | UARTSR2_BRK13_MASK | UARTSR2_LBKDE_MASK);
pUART->uartcr2.byte |= UARTCR2RWU_MASK;
lin_wakeupflag = 0;
}
Regards
Ajith
Hi Ajith
Please check that you have enable the ICS to operate in stop mode
ICS_C1 |= ICS_C1_IRCLKEN_MASK;
ICS_C1 |= ICS_C1_IREFSTEN_MASK;
I have a sample code that use the uart1 and go to sleep and wake up using the uart 1, this sample code does not use LIN break detection, but the way to wake up is the same
I hope this will help you.
Note the code is for CodeWarrior 10.6
Have a great day,
Vicente
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Vicente,
Thanks for the solution. And it is working.
Here I have one more query.
When i wake up LIN after some 10 seconds its working. But when I do immediately uart is not getting interrupt.
Can you please provide any solutions for the same.
Thanks and Regards
Ajith Arikkath
Hi Ajith
Have you check the UART interrupt flag, maybe is set (1) and this is causing that the the MCU did not enter to the interrupt again.
Also check all the UART configuration, depending how you are wake up maybe you need to enable the UART again.
Regards
Vicente