Hello everyone ,
On KDS3.0+KSDK1.3+PE --- FRDM-K22 , in KSDK select the "MQX Standard" .
I delete the "console " component, for if not, there will be error , i see someone say in the SDK-Standard MQX , it can not include this component .
When create one simple project , then :
printf("hello\n");
There is show nothing in the terminal .
Please tell me how to printf to the terminal through UART when i create one project as is saide .
Thank you very much !!!!!!
Solved! Go to Solution.
Hello fan xy:
Good to know you can print now.
MQX for KSDK has its own STDIO library, which uses the NIO drivers. The NIO driver for STDIO calls (printf, sprintf, etc.) is installed during bsp initialization, in the function _bsp_init(). Then all the printf calls will use the installed NIO_STDIO driver through the selected UART port.
That all happens under the hood of MQX. You just need to configure the inherited fsl_uart component.
Regards!
Jorge Gonzalez
Who can help me ?
Hello fan xy:
Sorry for the delay.
Attached there is a project for the FRDM-K22F that uses printf in the Main task. Just as you mentioned, the fsl_debug_console component is not required, so you need to remove it or simply disable it.
The MQX_KSDK must inherit a fsl_uart component configured to use UART1 with pins PTE0/PTE1, since those are pins mapped to the OpenSDA interface in FRDM-K22F.
Let me know if you face any issues are have any questions.
Regards!,
Jorge Gonzalez
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thank you very mcuh Jorge.
I can print it now .
While i have still have a question , could you tell me why i only need add the UART driver and configure it , then the UART port can connected to
prinrf function ? I debug step by step , and have not fund the printf function connected to the UART function .
Thank again !
fan !
Hello fan xy:
Good to know you can print now.
MQX for KSDK has its own STDIO library, which uses the NIO drivers. The NIO driver for STDIO calls (printf, sprintf, etc.) is installed during bsp initialization, in the function _bsp_init(). Then all the printf calls will use the installed NIO_STDIO driver through the selected UART port.
That all happens under the hood of MQX. You just need to configure the inherited fsl_uart component.
Regards!
Jorge Gonzalez