What is the debug console used for (fsl_debug_console)?

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

What is the debug console used for (fsl_debug_console)?

Jump to solution
4,010 Views
dave408
Senior Contributor II

I've looked online for more information on this, but have come up short.  I'm interested because every time I use PEx, as soon as I add MQX this component gets added and it has to be configured.  Until now, I've just selected a random UART and configured it to make the errors go away, but now I actually need to use one of the UARTs and want to understand what fsl_debug_console is all about.

 

I tried to figure it out by temporarily fixing the PEx errors, generating the code, and then searching for references to fsl_uart* and DbgCs1.  The generated code files are empty.

 

So what is this actually used for?  I'd like to remove it if possible, but I recall reading a post from another user here that had some execution problems when the files were removed from his project.

Labels (1)
0 Kudos
Reply
1 Solution
3,604 Views
DavidS
NXP Employee
NXP Employee

Hi Dave,

Short answer is fsl_debug_console() is reduced functionality IO calls in source code for replacing bulky library calls printf/scantf/putchar/getchar.  The fsl_debug_console.h has following:

int debug_printf(const char  *fmt_s, ...);

int debug_putchar(int ch);

int debug_scanf(const char  *fmt_ptr, ...);

int debug_getchar(void);

So once you configure the Component for a particular UARTx, then the above function calls will use that UARTx.

ex: debug_printf("\nHello World");

unsigned char single_char=1;

debug_printf("%d", single_char);

Slightly old (but not too old) document to show how it is configured into a KSD/KSDK/PE/MQX project:

How To: Create an MQX RTOS for KSDK project with Processor Expert in Kinetis Design Studio IDE

Regards,

David

View solution in original post

0 Kudos
Reply
3 Replies
3,605 Views
DavidS
NXP Employee
NXP Employee

Hi Dave,

Short answer is fsl_debug_console() is reduced functionality IO calls in source code for replacing bulky library calls printf/scantf/putchar/getchar.  The fsl_debug_console.h has following:

int debug_printf(const char  *fmt_s, ...);

int debug_putchar(int ch);

int debug_scanf(const char  *fmt_ptr, ...);

int debug_getchar(void);

So once you configure the Component for a particular UARTx, then the above function calls will use that UARTx.

ex: debug_printf("\nHello World");

unsigned char single_char=1;

debug_printf("%d", single_char);

Slightly old (but not too old) document to show how it is configured into a KSD/KSDK/PE/MQX project:

How To: Create an MQX RTOS for KSDK project with Processor Expert in Kinetis Design Studio IDE

Regards,

David

0 Kudos
Reply
3,271 Views
gloom35
Contributor I
Hi there,
How can I download the file for adding "fsl_debug_console.h" into my main source code as a header in keil uvision5? I cannot find any libraries to download from.
0 Kudos
Reply
3,604 Views
dave408
Senior Contributor II

Thanks, David!  I had read that post before, but had already forgotten some of the information there.  :smileyhappy:

0 Kudos
Reply