MCUXpresso SDK sprintf function

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

MCUXpresso SDK sprintf function

Jump to solution
1,541 Views
kk7xo
Contributor III

I'm using the SDK for the LPCXpresso845MAX board  I would like to use sprintf() but I see that it is not included in the SDK.  I see that in your devices/LPC845/utilities/debug_console_lite directory you have a files named fsl_debug_console.c/h.  I like using this driver because it provides a printf() function I can use with my UART. 

However, I notice that you declare DbgConsole_PrintfFormattedData() (line 605 in my copy) as static, which means I cannot access it from outside the file.  This is unfortunate because I could easily use that function to create a sprintf() by passing in a pointer to a function that writes to a character string.

Since I cannot do that and I do not want to alter my copy of the SDK, I am forced to include the libnano version of sprintf(), which drags in a bunch of unwanted library functions such as malloc() and free() that compete with my own versions.

I would ask that you make DbgConsole_PrintfFormattedData() non-static in future versions of the SDK so we can access its functionality from our code without modifying the SDK files themselves.

Regards,

Albert

0 Kudos
1 Solution
1,535 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Albert,

Thanks for your sharing.

Just kindly reminder, you can create PRINTF by Config Tool:

Alice_Yang_0-1647504731268.png

BR

Alice

 

View solution in original post

0 Kudos
3 Replies
1,529 Views
kk7xo
Contributor III

Yes I realize I can get printf.  It's sprintf that I'm looking for. 

I don't want to edit my copy of fsl_debug_console.c/h to make the necessary function accessible externally, otherwise my changes will get overwritten whenever I update my copy of the SDK.

0 Kudos
1,522 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello,

OK, I know your meaning, and will submit request to SDK team, thanks for your suggestion.

 

BR

Alice

0 Kudos
1,536 Views
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello Albert,

Thanks for your sharing.

Just kindly reminder, you can create PRINTF by Config Tool:

Alice_Yang_0-1647504731268.png

BR

Alice

 

0 Kudos