FRDM-K64F - UART3 Issues With KSDK 2.0

cancel
Showing results for 
Search instead for 
Did you mean: 

FRDM-K64F - UART3 Issues With KSDK 2.0

1,008 Views
thunderfoot
Contributor II

I am using the FRDM-K64F for evaluation of the K64 for possible use in a commercial project. I am fairly new to KDS and the SDK 2.0 so please bare with me! I am able to get UART3 working via pins PTC16/PTC17 no problem with a simple mbed program, however when I try to do the same within Kinetis Design Studio using SDK 2.0 I can't get UART3 to work. I have UART3 connect to an RS485 transceiver, and when monitoring on a scope here is what I see when using mbed firmware:

 

182113_182113.pngRS485_Scope_GOOD.png

 

And I receive the message as expected. However, here is what I see when I attempt to use UART3 with firmware created with KDS and SDK 2.0:

 

182123_182123.pngRS485_Scope_BAD.png

 

I am assuming I must just not be muxing or initializing something correctly but haven't been able to figure it out. In my firmware, I am beginning with the Hello World demo app from the SDK2.0, and only adding minimal code to attempt to get basic functionality from UART3. 

 

I've attached my entire hello_world.c and pin_mux.c files.

 

This is urgent so any help would be much appreciated!

 

Thanks

Original Attachment has been moved to: hello_world.c.zip

Original Attachment has been moved to: pin_mux.c.zip

Labels (1)
Tags (3)
6 Replies

315 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Michael,

I think your code is okay, especially, the pin assignment part.

Regarding your issue that the noise is large, I suppose that you connect two board together, especially, the two boards ground together via float wire, which leads to the noise.

If you dismantle all the float wires, test only the FRDM-K64F board,  test the uart3 TX pin with scope, does the issue exist?

Hope it can help you

BR

Xiangjun Rong

0 Kudos

315 Views
thunderfoot
Contributor II

Hi Xiangjun,

As another update, I have now also tried using the OpenSDA bootloader instead but am still having the same results...

  1. Using only the FRDM-K64 board (no other boards connected) and scope hooked up to UART3
  2. Downloaded mbed bootloader and simple Serial mbed program, UART signals seen on scope as expected.
  3. Replaced bootloader with OpenSDA, run my Hello World program from above. I am able to smoothly step through debugging from KDS, no faults or code hanging, but as the UART_WriteBlocking() command runs I see no UART signals on the scope!

I'm really scratching my head on this. You said my code and pin muxing looks okay. I most likely am just missing something simple, but have an important show coming up in just a couple days so any help as to why I can't seem to get UART3 working when debugging through KDS would be greatly appreciated.

Thanks!

0 Kudos

315 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

How about trying to connect different GND of the board with the probe GND of scope, what is the result?

BR

Xiangjun Rong

0 Kudos

315 Views
thunderfoot
Contributor II

Hi Xiangjun,

I seem to have gotten UART3 working now by following the tips from this thread: https://community.nxp.com/thread/387282 

To be honest I'm not exactly sure why this is working and my previous tests were not. The code and pin muxing is very similar, I just started with a different SDK example (selecting the one mentioned in that thread) and swapped UART3 in place of UART0. If I discover the specific problem from before I will share it here, but otherwise at least now I can push forward with some working code!

Thanks.

0 Kudos

315 Views
thunderfoot
Contributor II

Hi Xiangjun,

Thank you for the reply, however I am not exactly sure what you mean by "try to connect different GND". As I mentioned, I don't change anything about my scope setup between trying UART3 with mbed code versus KDS code. When I run the mbed code I see the UART signals on the scope, but when I run the KDS code I don't see any UART signals showing up. So I'm pretty sure the issue isn't with how the scope is connected.

Are there any working KDS code examples I can see which use UART3 on the FRDM-K64F board? Just seeing one working example would probably help me a lot!

Thanks.

0 Kudos

315 Views
thunderfoot
Contributor II

Hi Xiangjun,

Thank you for the response. Unfortunately, I seem to be having the same issue even when I strip the setup down to only the FRDM-K64F. Here is my procedure:

  1. Scope hooked up to TX and RX of UART3 (PTC16/PTC17) on the FRDM-K64F
  2. Download a simple UART test firmware I made on mbed using their Serial class.
  3. Run the mbed firmware, and I see the UART signals show up on the scope as expected.
  4. Unplug USB cable from J26 plug on the FRDM-K64F (the USB port on the left), and switch over to J22 plug (the USB port on the right). I also then plug in my J-Link programmer into the JTAG pins J9.
  5. Flash the Kinetis SDK based firmware I shared in my last message. (I occasionally receive a Hard Fault when I attempt to flash with this method, seemingly randomly. Perhaps it is related to this noise issue).
  6. Step through the J-Link debugger until I get to the UART_WriteBlocking() command.
  7. Watch the scope, but no UART signals seen on the scope.
  8. I even then tried switching the USB cable back over to J26 in attempt to run the firmware without J-Link connected, but still didn't catch any signals on the scope. 

Is my procedure for connecting and flashing with a J-link programmer correct?

In my earlier test I had the RS485 transceiver, etc. connected and all seemed to work fine when flashed with mbed. So I don't believe the issue is directly related to those other boards. I suspect something may be wrong with my setup or procedure when attempting to use the J-Link programmer with the FRDM-K64F board.

Any suggestions?

Thanks!

0 Kudos