How to disable the SDK debug console?

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

How to disable the SDK debug console?

3,744 次查看
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

标签 (1)
3 回复数

2,676 次查看
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 项奖励
回复

2,676 次查看
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

2,676 次查看
ashesman
Contributor III

OK, good point.  Thanks...

0 项奖励
回复