How to disable the SDK debug console?

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

How to disable the SDK debug console?

2,406 Views
ashesman
Contributor III

Hi,

 

Using SDK 2.0, I wish to not use the debug console and instead write my own handling for serial ports...

 

The problem is that the driver file fsl_common.c includes "fsl_debug_console.h".  fsl_debug_console.h defines SDK_DEBUGCONSOLE which in turn defines PRINTF as DbgConsole_Printf.  fsc_common.c calls PRINTF in its assert handler.  So, if DbgConsole_Printf does not exist (ie dont include fsl_debug_console.c in the build), the SDK drivers can not compile.

 

Any ideas?

 

Thanks

 

Ashley

Labels (1)
3 Replies

1,338 Views
ashesman
Contributor III

Thanks for your feedback...

Ideally I don't want to mess with the SDK files to turn this off.  I cannot guarantee that someone wont replace these files with a newer SDK version in the future etc. 

I think it would make more sense if it was a feature that needed to be turned on, rather than one that can not be turned off....

I would like to leave NDEBUG not defined as I would like to keep the assert functions in.

0 Kudos

1,338 Views
Jmart
NXP Employee
NXP Employee

Ashley,

If you want to disable this in your project without modification to the source files, you can use a pre-processor directive with your compiler to set SDK_DEBUGCONSOLE to 0 during compilation. Since the #define of SDK_DEBUGCONSOLE is wrapped in an #ifndef, it will only set SDK_DEBUGCONSOLE to 1 if you haven't defined the value elsewhere.

https://gcc.gnu.org/onlinedocs/gcc/Preprocessor-Options.html - Review the -D option for gcc.

Regards,

Jason

1,338 Views
ashesman
Contributor III

OK, good point.  Thanks...

0 Kudos