How to use scanf using KSDK v2

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

How to use scanf using KSDK v2

跳至解决方案
1,379 次查看
shauldorf
Contributor V

How I can use scanf in baremetal project, using "Drivers minimal set"  printf is working at 11520 boud.

I'm using KDS v3.2, KSDK v2.0 and FRDM-K64f

标签 (1)
1 解答
1,081 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Can you please refer rtc demo code which includes SCANF usage.

...\SDK_2.0_FRDM-K64F\boards\frdmk64f\driver_examples\rtc


Have a great day,
Jennie Zhang

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

在原帖中查看解决方案

0 项奖励
回复
5 回复数
1,081 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Shaul,

Regarding to your statement:

>>What I understand now is, creating new project I have to use "Drivers minimal set" because only there <stdio.> "printf" is supported no getc() and putc().

I don't quite understand. Can you please be more specific?

>>For strings and char I have to include "fsl_debug_console.h" and use debug console functions instead <sdtio.h>

according to my test, Yes, I think so.

Jennie

0 项奖励
回复
1,081 次查看
shauldorf
Contributor V

Hello Jennie

Using KSDK v2 to be able to use debug_console you have to create project using "project wizard" that at least will include "Drivers Minimal set" configuration (no Empty).

pastedImage_1.png

In this case "printf()" (which is supported by <stdio.h>) statement is working without using

#include "fsl_debug_console.h". 

But only printf(), other stdio statemens like  scanf(), getc() and putc() doesn’t work.

To get similar function I have to #include "fsl_debug_console.h" and use  SCANF(), PUTCHAR() and GETCHAR() equivalent functions.

This is what I wanted to confirm.

 

Thanks

 

Shaul

0 项奖励
回复
1,081 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi Shaul,

yes, I think so. This is the same testing result as my side.

Normally if I choose SDK, I use SDK defined io functions rather than stdio


Have a great day,
Jennie Zhang

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

1,082 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi,

Can you please refer rtc demo code which includes SCANF usage.

...\SDK_2.0_FRDM-K64F\boards\frdmk64f\driver_examples\rtc


Have a great day,
Jennie Zhang

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

0 项奖励
回复
1,081 次查看
shauldorf
Contributor V

Jennie Thanks,

My initial mean was not to use "fsl_debug_console".

Can you please confirm my assumption?

What I understand now is, creating new project I have to use "Drivers minimal set" because only there <stdio.> "printf" is supported no getc() and putc().

For strings and char I have to include "fsl_debug_console.h" and use debug console functions instead <sdtio.h>

Shaul

0 项奖励
回复