Hi,
I am using FRDM K64 and UART EDMA example code to communicate with BG95 modem over UART.
I would like to reset UART communication with BG95. What is the good way to execute this?
I just tried to reset the modem(not UART), yet after this I am not receiving any data from modem (TX is working fine).
解決済! 解決策の投稿を見る。
Hi darshan_shah1,
If you want to reset the UART module, you can deinit it, then init it again, you can find the code in the K64 SDK fsl_uart.c:
void UART_Deinit(UART_Type *base)
{
#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO
/* Wait tx FIFO send out*/
while (0U != base->TCFIFO)
{
}
#endif
/* Wait last char shoft out */
while (0U == (base->S1 & UART_S1_TC_MASK))
{
}
/* Disable the module. */
base->C2 = 0;
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/* Disable uart clock */
CLOCK_DisableClock(s_uartClock[UART_GetInstance(base)]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
}
Please try it on your side.
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
Hi darshan_shah1,
If you want to reset the UART module, you can deinit it, then init it again, you can find the code in the K64 SDK fsl_uart.c:
void UART_Deinit(UART_Type *base)
{
#if defined(FSL_FEATURE_UART_HAS_FIFO) && FSL_FEATURE_UART_HAS_FIFO
/* Wait tx FIFO send out*/
while (0U != base->TCFIFO)
{
}
#endif
/* Wait last char shoft out */
while (0U == (base->S1 & UART_S1_TC_MASK))
{
}
/* Disable the module. */
base->C2 = 0;
#if !(defined(FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL) && FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL)
/* Disable uart clock */
CLOCK_DisableClock(s_uartClock[UART_GetInstance(base)]);
#endif /* FSL_SDK_DISABLE_DRIVER_CLOCK_CONTROL */
}
Please try it on your side.
If you still have questions about it, please kindly let me know.
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------
@kerryzhou , Thanks for your response. I am using EDMA with ringbuffer so it needs other deinit as well.
Well, I got the sequence.
Thank you.
Hi darshan_shah1,
Thanks for letting me know your updated situation.
If you have any new question in the future, welcome to create the new question post in the community.
Wish it helps you!
If you still have questions about it, please kindly let me know!
Best Regards,
Kerry
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!
- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-----------------------------------------------------------------------------