How to use scanf using KSDK v2

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to use scanf using KSDK v2

Jump to solution
1,209 Views
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

Labels (1)
1 Solution
911 Views
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!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
5 Replies
911 Views
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 Kudos
911 Views
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 Kudos
911 Views
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!
-----------------------------------------------------------------------------------------------------------------------

912 Views
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 Kudos
911 Views
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 Kudos