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

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

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

Jump to solution
1,440 Views
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 Kudos
1 Solution
1,423 Views
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.

 

 

View solution in original post

0 Kudos
5 Replies
1,437 Views
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 Kudos
1,424 Views
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 Kudos
1,402 Views
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 Kudos
1,385 Views
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 Kudos
1,376 Views
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 Kudos