<?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>i.MX ProcessorsのトピックRe: I.MX9352 M33 Problems with output floating-point data when developing with IAR</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983360#M230208</link>
    <description>&lt;P&gt;Hi.@Zhiming_Liu&lt;BR /&gt;Thanks.&lt;BR /&gt;It seems that this approach is no better than using the sprintf function to convert to string output. Is there a way to print floating-point data directly using PRINTF?&lt;BR /&gt;Like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;main()
{
double pi = 3.1415926;
PRINTF("pi = %f\r\n", pi);
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The output:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;pi = 3.141593&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 29 Oct 2024 01:28:56 GMT</pubDate>
    <dc:creator>HL_G</dc:creator>
    <dc:date>2024-10-29T01:28:56Z</dc:date>
    <item>
      <title>I.MX9352 M33 Problems with output floating-point data when developing with IAR</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1981597#M230123</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;&lt;P&gt;When developing I.MX9352 Cortex-M33 with IAR1 9.50.2, it was not possible to output floating-point data via redirected printf.&lt;/P&gt;&lt;P&gt;The SDK used is SDK_2_16_000_MIMX9352xxxxM&lt;/P&gt;&lt;P&gt;The following Settings have been made in the IAR Settings.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HL_G_0-1729821245424.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/306875i6E410B59EF48F8A2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HL_G_0-1729821245424.png" alt="HL_G_0-1729821245424.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my code:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;/*
 * Copyright (c) 2015, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "fsl_rgpio.h"

/*******************************************************************************
 * Definitions
 ******************************************************************************/
#define BOARD_LED_RGPIO          GPIO3
#define BOARD_LED_RGPIO_PIN      26U
#define EXAMPLE_RGPIO_CLOCK_ROOT kCLOCK_Root_BusWakeup
#define EXAMPLE_RGPIO_CLOCK_GATE kCLOCK_Gpio3
double Pi = 3.1415926;

/*******************************************************************************
 * Prototypes
 ******************************************************************************/
/*!
 * @brief delay a while.
 */
void delay(void);

/*******************************************************************************
 * Variables
 ******************************************************************************/

/*******************************************************************************
 * Code
 ******************************************************************************/

/*!
 * @brief Main function
 */
int main(void)
{
    /* Define the init structure for the output LED pin*/
    rgpio_pin_config_t led_config = {
        kRGPIO_DigitalOutput,
        0,
    };

    /* Board pin, clock, debug console init */
    /* clang-format off */

    const clock_root_config_t rgpioClkCfg = {
        .clockOff = false,
        .mux = 0, // 24Mhz Mcore root buswake clock
        .div = 1
    };
    /* clang-format on */
    BOARD_InitBootPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();

    CLOCK_SetRootClock(EXAMPLE_RGPIO_CLOCK_ROOT, &amp;amp;rgpioClkCfg);
    CLOCK_EnableClock(EXAMPLE_RGPIO_CLOCK_GATE);
    CLOCK_EnableClock(kCLOCK_Gpio2);
    /* Set PCNS register value to 0x0 to prepare the RGPIO initialization */
    BOARD_LED_RGPIO-&amp;gt;PCNS = 0x0;

    /* Print a note to terminal. */
    PRINTF("\r\n RGPIO Driver example\r\n");
    PRINTF("\r\n The LED is taking turns to shine.\r\n");

    /* Init output LED GPIO. */
    RGPIO_PinInit(BOARD_LED_RGPIO, BOARD_LED_RGPIO_PIN, &amp;amp;led_config);

    while (1)
    {
      
      PRINTF("output float value:Pi=%f %lf\r\n", Pi, Pi);
        SDK_DelayAtLeastUs(1000000U, SystemCoreClock);
        RGPIO_PortToggle(BOARD_LED_RGPIO, 1u &amp;lt;&amp;lt; BOARD_LED_RGPIO_PIN);
    }
}&lt;/LI-CODE&gt;&lt;P&gt;The actual effect is as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HL_G_1-1729821805873.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/306877i2DF5F30BEAFE4AFE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="HL_G_1-1729821805873.png" alt="HL_G_1-1729821805873.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2024 02:04:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1981597#M230123</guid>
      <dc:creator>HL_G</dc:creator>
      <dc:date>2024-10-25T02:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: I.MX9352 M33 Problems with output floating-point data when developing with IAR</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983359#M230207</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/241757"&gt;@HL_G&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Please refer this case to modify PRINTF function in SDK:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407676#M186549" target="_blank"&gt;https://community.nxp.com/t5/i-MX-Processors/i-MX8MP-Cannot-print-float-values-from-SDK-M7-examples/m-p/1407676#M186549&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 01:09:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983359#M230207</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2024-10-29T01:09:30Z</dc:date>
    </item>
    <item>
      <title>Re: I.MX9352 M33 Problems with output floating-point data when developing with IAR</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983360#M230208</link>
      <description>&lt;P&gt;Hi.@Zhiming_Liu&lt;BR /&gt;Thanks.&lt;BR /&gt;It seems that this approach is no better than using the sprintf function to convert to string output. Is there a way to print floating-point data directly using PRINTF?&lt;BR /&gt;Like this:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;main()
{
double pi = 3.1415926;
PRINTF("pi = %f\r\n", pi);
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;The output:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;pi = 3.141593&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Oct 2024 01:28:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983360#M230208</guid>
      <dc:creator>HL_G</dc:creator>
      <dc:date>2024-10-29T01:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: I.MX9352 M33 Problems with output floating-point data when developing with IAR</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983373#M230209</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The existing PRINTF has a bit of a problem with float, or if you're not using serial printing and use printf inside the IAR&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 02:13:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/I-MX9352-M33-Problems-with-output-floating-point-data-when/m-p/1983373#M230209</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2024-10-29T02:13:38Z</dc:date>
    </item>
  </channel>
</rss>

