UART interrupt can't enter interruput

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

UART interrupt can't enter interruput

Jump to solution
974 Views
kent_gu
Contributor III

Hi, 

I am using MK22FN1M0AVLH12 processor, copy the part code of the No-Block UART example of frdmk22f in V1.3 KSDK. The SW hold at send function, seems that send function can't find the correct ISR.

Debug.jpg

My question is, 

  1. Why have the above issue? Should some place define interrupt vector?
  2. What evaluationd board is for MK22FN1M0AVLH12? TWR-K21F120M?
  3.  I use wrong code? Not the code from frdmk22f?

 

Best Regards,

Kent

0 Kudos
1 Solution
702 Views
kent_gu
Contributor III

I think I have found the reason. The reason is baud rate is wrong in the example, which is caused by "#define DEMO_UART_CLKSRC kCLOCK_BusClk", and get 60M, which cause wrong. If use "#define DEMO_UART_CLKSRC kCLOCK_CoreSysClk", then can fix make the example wrong well. 

I am not sure if I use MK22FN1M0AVLH12, may example "\twrk21f120m\driver_examples\uart\interrupt_transfer\kds" is for twrk21f120m.

 

View solution in original post

0 Kudos
3 Replies
702 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Kent,

    Your problem is mainly caused by the mismatching between your chip and code.

Answer your 3 question in details:

1.Why have the above issue? Should some place define interrupt vector?

If the code and the chip is mismatching, when the code access the area which the hardware don't have, then it may enter in the defaultISR.

2.What evaluationd board is for MK22FN1M0AVLH12? TWR-K21F120M?

 You can refer to TWR-K21F120M, but you should better refer to

TWR-K21F120MA|Tower System Board|Kinetis MCUs|NXP 

3.I use wrong code? Not the code from frdmk22f?

You can refer to KSDK2.0 code which can be download from this link:

Welcome to Kinetis Expert | Kinetis Expert 

Click build an sdk button,  then select the processor like this:

pastedImage_3.png

Generate the code ,and download it, you will find the uart code in folder: SDK_2.0_MK22FN1M0Axxx12\boards\twrk21f120m\driver_examples\uart

Wish it helps you!

If you still have question, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
702 Views
kent_gu
Contributor III

Kerry,

yes, I creat KSDK V2.0 UART example, do as following,

  •  Downloaded KSDK V2.0 for MK22FN1M0AVLH12
  •  Use "Kinets SDK 2x project" wizard to create empty project for MK22FN1M0AVLH12
  • Copy part code from "KSDK_2.0_MK22FN1M0A\boards\twrk21f120m\driver_examples\uart\interrupt_transfer\kds", include some part from uart_interrupt_transfer.c, board.c, board. h, etc.
  • Change UART5 to UART1 because I design a new board using MK22FN1M0AVLH12

 

PC COM tool can receive the data from the board, but have the below question,

  • Data is not right as  string in code. I try to change baud rate in PC COM tool, but can't work.
  • PC COM tool can't realize Rx/Tx loop function base on FW SW should have Rx/TX loop function.

UART.jpg

 

Best Regards,

Kent

0 Kudos
703 Views
kent_gu
Contributor III

I think I have found the reason. The reason is baud rate is wrong in the example, which is caused by "#define DEMO_UART_CLKSRC kCLOCK_BusClk", and get 60M, which cause wrong. If use "#define DEMO_UART_CLKSRC kCLOCK_CoreSysClk", then can fix make the example wrong well. 

I am not sure if I use MK22FN1M0AVLH12, may example "\twrk21f120m\driver_examples\uart\interrupt_transfer\kds" is for twrk21f120m.

 

0 Kudos