I still haven't got a good understanding of how determining what pins are used for the UART that eventually sends its data to the virtual COM port when using the Segger jlink firmware.
I have a bare metal project where printf goes to the console window in KDS, which is pretty nice.
I have a FRDM-K64F project that connects fsl_debug_console to UART0, and output from debug_printf goes to the virtual COM port. I have to open a terminal program to see the output, but that's fine. Rx goes to UART1_RX_TGTMCU and Tx goes to UART1_TX_TGTMCU. The issue for me here is that I wouldn't have known how to determine those are the right pins, if I hadn't read someone else's tutorial. :smileysad:
I have a FRDM-K22F project that connects fsl_debug_console to UART0, and I have assigned Tx to PTB17, but none of the options are free or make sense. For example, here are the available options:
Rx has no available options:
So how does one determine what pins should be assigned to the UART that will go to the virtual COM port or the console window?
At this point, I really only need Tx working so I can output to the terminal, but I can't even get that to work when set to PTB17, which is the only available option...
Solved! Go to Solution.
Hello Dave:
The correct interface for the FRDM-K22F virtual COM (via OpenSDA) is UART1, pins PTE0/PTE1. Usual ways to determine this:
1) From the board user guide:
2) The board schematics:
:smileyalert: IMPORTANT: A bug has been identified with the fsl_debug_console component for FRDM-K22F. It generates an erroneous UART index in the file DbgCs1.h:
#define BOARD_DEBUG_UART_INSTANCE 2
Please change it to 1 and disable code generation only for that component:
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Dave:
The correct interface for the FRDM-K22F virtual COM (via OpenSDA) is UART1, pins PTE0/PTE1. Usual ways to determine this:
1) From the board user guide:
2) The board schematics:
:smileyalert: IMPORTANT: A bug has been identified with the fsl_debug_console component for FRDM-K22F. It generates an erroneous UART index in the file DbgCs1.h:
#define BOARD_DEBUG_UART_INSTANCE 2
Please change it to 1 and disable code generation only for that component:
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi Jorge, I'm currently revisiting my K64F project, and figured I'd close the loop and see how your explanation matches up. Can you please explain one more thing? I'm looking at the K64F schematic right now, and this is what I see:
Normally, I believe I have the osa1 UART device set to UART0, and RxD and TxD are UART1_RX_TGTMCU and UART1_TX_TGTMCU. Is this a bug in PEx? I'm jumping between so many projects right now I can't remember if this is the one where printf to the virtual COM port isn't working, but if not, maybe this is why.
If I select UART1 from Device, then I can't assign the RxD and TxD signals in PEx as they appear in the schematic.
Hi Dave:
That is for the K20 MCU (OpenSDA interface).
Actually the pins used from the K64 MCU correspond to UART0 module. Check the next image:
Regards!
Jorge Gonzalez
AH! Such a dumb mistake on my end. Thank you for the clarification.
Ok, thank you, I will give that a try!
EDIT -- Yup, that did the trick!!! Thanks!