PRINTF (DbgConsole_Printf) doesn't work for negative float

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

PRINTF (DbgConsole_Printf) doesn't work for negative float

973 Views
blmckinley
Contributor II

Using MCUXpresso 
Product: MCUXpresso IDE
Version: MCUXpresso IDE v24.12 [Build 148] [2025-01-10]
Operating system: Windows 11
VM: OpenJDK 64-Bit Server VM (64 bit)

The PRINTF macro that resolves to DbgConsole_Printf is supposed to provide small, lightweight print to terminal features. But it does not print negative float values correctly. This is apparently a known issue but it took me 2 solid days of fooling around with my code trying to figure out why my values had the wrong sign. 

The solution proposed in https://community.nxp.com/t5/MCUXpresso-SDK/Printing-negative-floats-with-DbgConsole-Printf-in-mcuxp...
is not really adequate since stdio brings in all kinds of other libraries and expands the amount of flash memory required. That is the whole reason that the SDK even provides a lightweight print function.

So it is really NOT a good solution, and the issue should remain open. How is it that this bug still exists in the SDK after TWO entire years? This is a ridiculously straightforward problem to solve. Please fix the SDK and stop wasting your developers' valuable time.


0 Kudos
Reply
3 Replies

807 Views
mayliu1
NXP Employee
NXP Employee

Hi @blmckinley ,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

I suggest you can refer to this NXP community post:

Solved: Printing negative floats with DbgConsole_Printf in mcuxpresso SDK 2.15 - NXP Community

Please try it.

Best Regards

MayLiu

0 Kudos
Reply

780 Views
blmckinley
Contributor II
Thank you for the reply. As I mention in my post, although the printf() function does work for negative numbers, that is not a solution for a bug in the SDK function DbgConsole_Printf().

Your users deserve bug-free SDKs and I highly recommend you fix the bug as outlined.
0 Kudos
Reply

664 Views
mayliu1
NXP Employee
NXP Employee

Hi @blmckinley ,

Thanks for your feedback, I have already created an internal ticket for your question.

Best Regards

May Liu

0 Kudos
Reply