UART Tx/Rx not Working in FRDM-MK40Z Board using Keil IDE

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

UART Tx/Rx not Working in FRDM-MK40Z Board using Keil IDE

跳至解决方案
3,826 次查看
iamsaranvs
Contributor II

Hi,

Pls help me in sorting out this issue.

I have an Working code in IAR for FRDM-KW40Z regarding UART Receiving and Transmitting.

I have Ported that code to Keil IDE, to make it work with CMSIS RTOS Driver.

For Initial test i have configured the UART but seems to be issue in Transmitting and Receiving data.

I have cross checked the Configuration with IAR. Both seems to be same.

While Debugging I found there is a mismatch in UART_STAT us register, Once on Enabling the Transmit Enable and Receive Enable bits in the UART_CTRL Register, It seems that the "Transmission Complete Flag" in UART_STAT[TC] Register bit is set (Transmitter active).

I have attached the UART.c and main.c Files. Any help is greatly appreciated. 

 

0 项奖励
回复
1 解答
3,809 次查看
iamsaranvs
Contributor II

Hi Kerry,

Thanks for Your Reply.

 

I have replaced the Header file with the latest version"MKW40Z4.h". But still facing the same issue. Transmitter is active even before writing any data to LPUART0_DATA Register.

 

 

在原帖中查看解决方案

0 项奖励
回复
5 回复数
3,823 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi iamsaranvs,

   FRDM-KW40Z board is really a little old, and the SDK even don't have the KW40 code, you can consider the new FRDM-KW41 board.

   About your question that MDK UART TX and RX not working, but the IAR project can work, you also mentioned that the UART register are mismatching, so the issue should in the KW40 header file.

  Could you please check the register address information in your MDK header file and compare it with the IAR version, any difference or not?

 

Any updated information from your side, please kindly let me know.

Best Regards,

Kerry

   

0 项奖励
回复
3,810 次查看
iamsaranvs
Contributor II

Hi Kerry,

Thanks for Your Reply.

 

I have replaced the Header file with the latest version"MKW40Z4.h". But still facing the same issue. Transmitter is active even before writing any data to LPUART0_DATA Register.

 

 

0 项奖励
回复
3,788 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi iamsaranvs

  Please share me your working IAR project and the issue MDK project, I will help you to test it on my side.

 

Waiting for your reply!

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.
-----------------------------------------------------------------------------

0 项奖励
回复
3,771 次查看
iamsaranvs
Contributor II

Hi Kerry,

 

 Thanks for the Reply & Support.

The issue is resolved. I failed to do a system init, after doing that it is working fine.

0 项奖励
回复
3,762 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi iamsaranvs,

   That's good to hear your issue is solved.

   If you have any new questions in the future, welcome to create the new question post.

 

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.
-----------------------------------------------------------------------------

  

0 项奖励
回复