How to disable the SDK debug console?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to disable the SDK debug console?

3,756件の閲覧回数
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,688件の閲覧回数
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,688件の閲覧回数
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,688件の閲覧回数
ashesman
Contributor III

OK, good point.  Thanks...

0 件の賞賛
返信