KDS Redirect printf to debug_printf

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

KDS Redirect printf to debug_printf

Jump to solution
1,520 Views
audi_mcavoy
Contributor IV

I'm missing something subtle here.

 

I originally created a project with KDS 3.0 and KSDK 1.2 (and PEx) which included a fsl_debug_console brought out on UART0.  I had plenty of printf() calls sprinkled throughout my code, and everything worked great.

 

Today I migrated the project to KSDK 1.3.  I cleaned up all of the PEx issues, regenerated the code, and surprisingly enough, compiled with zero errors.  However, my printf() calls are now broke (cause an unhandled interrupt?).  On a whim, I changed the first printf() to debug_printf(), and that line works!

 

What do I have to do to redirect printf() to debug_printf()?

- Audi

Labels (1)
0 Kudos
1 Solution
1,084 Views
DavidS
NXP Employee
NXP Employee

Hi Audi,

Quick peek around the KSDK_1.3 source indicates that the printer class is not present where is was in KSDK_1.2.

The project Properties for your example has the path to the printer class still present so you get the warning.

Remove it from the project to get rid of the warning (Properties->C/C++ Build->Tool Setting-> Cross ARM C Compiler->Includes):

Delete the "../../../../../../../../../../usb/usb_core/host/sources/classes/printer" entry.

Regards,

David

View solution in original post

4 Replies
1,084 Views
audi_mcavoy
Contributor IV

I think the "subtle" thing that I am missing might be that I forgot to build the 1.3 libraries.

So I imported the dev_hid_keyboard_bm_frdmk64f project set, which also pulled in ksdk_platform_lib_K64F12 and usbd_sdk_bm_lib_MK64F12.  The two libraries built with no problem, but the example project is giving me an invalid project path warning.  It says the include path is not found, and references "C:\Freescale\KSDK_1.3.0\usb\usb_core\host\sources\classes\printer"

- Audi

0 Kudos
1,085 Views
DavidS
NXP Employee
NXP Employee

Hi Audi,

Quick peek around the KSDK_1.3 source indicates that the printer class is not present where is was in KSDK_1.2.

The project Properties for your example has the path to the printer class still present so you get the warning.

Remove it from the project to get rid of the warning (Properties->C/C++ Build->Tool Setting-> Cross ARM C Compiler->Includes):

Delete the "../../../../../../../../../../usb/usb_core/host/sources/classes/printer" entry.

Regards,

David

1,082 Views
audi_mcavoy
Contributor IV

Yep, that took care of it.

Thanks for the help.

- Audi

0 Kudos
1,082 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Audi,

Do you want to use debug_printf or printf ?

If you want to use print , you can

#define debug_printf printf  

then have a test.

Or you can directly use debug_printf .

Hope it helps

Alice

0 Kudos