<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LPC55 sprintf float values in LPC Microcontrollers</title>
    <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2161277#M58716</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240955"&gt;@SvenAsbach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you include "stdio.h"? We need to make sure we have this header file included.&lt;/P&gt;
&lt;P&gt;I just tested sprintf with your code, there is no issue on my side. See attached video.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please also make sure you use floating point version of printf.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1756713922369.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/354958i8204846956BF91D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1756713922369.png" alt="ZhangJennie_0-1756713922369.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you please checking your issue with refering my screenshot and testing video?&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Jun Zhang&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 01 Sep 2025 08:08:26 GMT</pubDate>
    <dc:creator>ZhangJennie</dc:creator>
    <dc:date>2025-09-01T08:08:26Z</dc:date>
    <item>
      <title>LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2158988#M58697</link>
      <description>&lt;P&gt;Hi community,&lt;BR /&gt;I am trying to setup sprintf to print float numbers to string.&lt;BR /&gt;I tried everything I found, changed libraries, but nothing brought a success.&lt;BR /&gt;Either I get not the right result or I get an hardfault when trying to print negative float values.&lt;BR /&gt;&lt;BR /&gt;Actual processor LPC5506&lt;BR /&gt;Floating point unit FPv5-SP-D16 Hard ABI set&lt;BR /&gt;current library setting Redlib semihost&lt;BR /&gt;I am using UART0 to print&lt;BR /&gt;&lt;BR /&gt;PreProcessor settings&lt;BR /&gt;CPU_LPC5506JBD64&lt;BR /&gt;CPU_LPC5506JBD64_cm33&lt;BR /&gt;SDK_OS_BAREMETAL&lt;BR /&gt;SDK_DEBUGCONSOLE=2&lt;BR /&gt;SERIAL_PORT_TYPE_UART=1&lt;BR /&gt;PRINTF_FLOAT_ENABLE=1&lt;BR /&gt;SCANF_FLOAT_ENABLE=1&lt;BR /&gt;PRINTF_ADVANCED_ENABLE=1&lt;BR /&gt;SCANF_ADVANCED_ENABLE=1&lt;BR /&gt;__MCUXPRESSO&lt;BR /&gt;__USE_CMSIS&lt;BR /&gt;DEBUG&lt;BR /&gt;DISABLEFLOAT16&lt;BR /&gt;__REDLIB__&lt;/P&gt;&lt;P&gt;trying this code&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;P&gt;&lt;SPAN&gt;float&lt;/SPAN&gt;&lt;SPAN&gt; P_Value = 3.123456f;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;float&lt;/SPAN&gt;&lt;SPAN&gt; I_Value = 123.4567f;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;float&lt;/SPAN&gt;&lt;SPAN&gt; D_Value = 0.654321f;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sprintf(g_txBuffer, "rpm = %d, P_Value = %f, I_Value = %f, D_Value = %f \r", rpm_ist, P_Value, I_Value, D_Value);&lt;BR /&gt;&lt;BR /&gt;no warnings or errors&lt;BR /&gt;&lt;BR /&gt;And the result is&lt;BR /&gt;&lt;/SPAN&gt;rpm = 206, P_Value = -0.000000, I_Value = -0.000000, D_Value = -0.000000 &amp;lt;CR&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to get sprintf to print the right values including negative values or do I have to write my own converter?&lt;BR /&gt;What I do not see?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Aug 2025 08:37:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2158988#M58697</guid>
      <dc:creator>SvenAsbach</dc:creator>
      <dc:date>2025-08-27T08:37:07Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159131#M58701</link>
      <description>&lt;P&gt;Usually the problem is that&amp;nbsp;CR_INTEGER_PRINTF&amp;nbsp; is still defined in the -D options list.&lt;/P&gt;&lt;P&gt;Make sure you do a full 'clean' of the build an retry.&lt;/P&gt;&lt;P&gt;These are my (working) defines and Linker settings:&lt;/P&gt;&lt;P&gt;__REDLIB__&lt;BR /&gt;CPU_LPC55S69JBD100&lt;BR /&gt;CPU_LPC55S69JBD100_cm33&lt;BR /&gt;CPU_LPC55S69JBD100_cm33_core0&lt;BR /&gt;SDK_DEBUGCONSOLE=1&lt;BR /&gt;PRINTF_FLOAT_ENABLE=1&lt;BR /&gt;SERIAL_PORT_TYPE_UART=1&lt;BR /&gt;__MCUXPRESSO&lt;BR /&gt;__USE_CMSIS&lt;BR /&gt;DEBUG&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ErichStyger_0-1756291258397.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/354374iB33B2EFD743797E1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ErichStyger_0-1756291258397.png" alt="ErichStyger_0-1756291258397.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 10:42:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159131#M58701</guid>
      <dc:creator>ErichStyger</dc:creator>
      <dc:date>2025-08-27T10:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159135#M58702</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240955"&gt;@SvenAsbach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use SDK demo, please try to enable floating support&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_1-1756291243616.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/354373iC8402FF15DF60B3C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_1-1756291243616.png" alt="ZhangJennie_1-1756291243616.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Make sure the defined symbols, printf float is enabled.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_2-1756291670584.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/354375i2BAEA2BEDCC29A5A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_2-1756291670584.png" alt="ZhangJennie_2-1756291670584.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this work for you?&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 10:49:22 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159135#M58702</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-08-27T10:49:22Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159154#M58704</link>
      <description>&lt;P&gt;Thanks for the fast answer, but this does not help.&lt;BR /&gt;All what you are proposing is already set and tried, but no success.&lt;BR /&gt;Compiler uses this&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;arm-none-eabi-gcc -DCPU_LPC5506JBD64 -DCPU_LPC5506JBD64_cm33 -DSDK_OS_BAREMETAL -DSDK_DEBUGCONSOLE=2 -DSERIAL_PORT_TYPE_UART=1 -DPRINTF_FLOAT_ENABLE=1 -DSCANF_FLOAT_ENABLE=1 -DPRINTF_ADVANCED_ENABLE=1 -DSCANF_ADVANCED_ENABLE=1 -D__MCUXPRESSO -D__USE_CMSIS -DDEBUG -DDISABLEFLOAT16 -D__REDLIB__ -I"D:\Software\FC5706P_workspace\FC5706P101B001\drivers" -I"D:\Software\FC5706P_workspace\FC5706P101B001\device" -I"D:\Software\FC5706P_workspace\FC5706P101B001\component\serial_manager" -I"D:\Software\FC5706P_workspace\FC5706P101B001\utilities" -I"D:\Software\FC5706P_workspace\FC5706P101B001\component\uart" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS" -I"D:\Software\FC5706P_workspace\FC5706P101B001\component\lists" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS_driver\Include" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS\DSP\Include" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS\DSP\PrivateInclude" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS\DSP\Source\DistanceFunctions" -I"D:\Software\FC5706P_workspace\FC5706P101B001\CMSIS\NN\Include" -I"D:\Software\FC5706P_workspace\FC5706P101B001\board" -I"D:\Software\FC5706P_workspace\FC5706P101B001\source" -O0 -fno-common -g3 -gdwarf-4 -Wall -c -ffunction-sections -fdata-sections -fno-builtin -fmerge-constants -fmacro-prefix-map="../CMSIS/DSP/Source/BasicMathFunctions/"= -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP -MF"CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctionsF16.d" -MT"CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctionsF16.o" -MT"CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctionsF16.d" -o "CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctionsF16.o" "../CMSIS/DSP/Source/BasicMathFunctions/BasicMathFunctionsF16.c"&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Aug 2025 11:15:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2159154#M58704</guid>
      <dc:creator>SvenAsbach</dc:creator>
      <dc:date>2025-08-27T11:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2161277#M58716</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240955"&gt;@SvenAsbach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Did you include "stdio.h"? We need to make sure we have this header file included.&lt;/P&gt;
&lt;P&gt;I just tested sprintf with your code, there is no issue on my side. See attached video.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please also make sure you use floating point version of printf.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_0-1756713922369.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/354958i8204846956BF91D8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_0-1756713922369.png" alt="ZhangJennie_0-1756713922369.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Can you please checking your issue with refering my screenshot and testing video?&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Jun Zhang&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Sep 2025 08:08:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2161277#M58716</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-09-01T08:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2164113#M58733</link>
      <description>&lt;P&gt;Stdio.h is included and used.&lt;BR /&gt;&lt;BR /&gt;Where can I check in an existing project that the right printf version is used or where do I change it?&lt;BR /&gt;My preprocessor settings I have already send to you.&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;CR_INTEGER_PRINTF is not used in the build&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;Build is done with&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;arm-none-eabi-gcc -DCPU_LPC5506JBD64 -DCPU_LPC5506JBD64_cm33 -DSDK_OS_BAREMETAL -DSDK_DEBUGCONSOLE=2 -DSERIAL_PORT_TYPE_UART=1 -DPRINTF_FLOAT_ENABLE=1 -DSCANF_FLOAT_ENABLE=1 -DPRINTF_ADVANCED_ENABLE=1 -DSCANF_ADVANCED_ENABLE=1 -D__MCUXPRESSO -D__USE_CMSIS -DDEBUG -DDISABLEFLOAT16 -D__REDLIB__ xxxxx&amp;nbsp;-O0 -fno-common -g3 -gdwarf-4 -Wall -c -ffunction-sections -fdata-sections -fno-builtin -fmerge-constants -fmacro-prefix-map="../CMSIS/DSP/Source/BayesFunctions/"= -mcpu=cortex-m33 -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs -MMD -MP&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Sep 2025 06:31:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2164113#M58733</guid>
      <dc:creator>SvenAsbach</dc:creator>
      <dc:date>2025-09-05T06:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: LPC55 sprintf float values</title>
      <link>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2166408#M58742</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/240955"&gt;@SvenAsbach&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please make sure the project defined symbols and floating point set as below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_1-1757489388300.png" style="width: 842px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/356192i35A6FF3571BCDFB1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_1-1757489388300.png" alt="ZhangJennie_1-1757489388300.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ZhangJennie_2-1757489476615.png" style="width: 847px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/356193i3E77CF492C8D6624/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ZhangJennie_2-1757489476615.png" alt="ZhangJennie_2-1757489476615.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Jun Zhang&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Sep 2025 07:31:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPC-Microcontrollers/LPC55-sprintf-float-values/m-p/2166408#M58742</guid>
      <dc:creator>ZhangJennie</dc:creator>
      <dc:date>2025-09-10T07:31:34Z</dc:date>
    </item>
  </channel>
</rss>

