sdk_standard mqx +PE -- printf -kds3.0

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

sdk_standard mqx +PE -- printf -kds3.0

跳至解决方案
1,373 次查看
Fan_xy
Contributor III

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 !!!!!!

0 项奖励
回复
1 解答
1,127 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

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

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,127 次查看
Fan_xy
Contributor III

Who can help me ?

0 项奖励
回复
1,127 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

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!
-----------------------------------------------------------------------------------------------------------------------

1,127 次查看
Fan_xy
Contributor III

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 !

0 项奖励
回复
1,128 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

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

0 项奖励
回复