<?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>MCX MicrocontrollersのトピックRe: MCXN947 DLL auto-adjusted function not working</title>
    <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2420348#M6027</link>
    <description>&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;Here is the information on the parameters I use with the `flexspi_config_t` structure:&lt;/P&gt;&lt;LI-CODE lang="c"&gt; 

   flexspi_config_t config;

    /* Get FLEXSPI default settings and configure the flexspi. */
    FLEXSPI_GetDefaultConfig(&amp;amp;config);

    config.rxSampleClock = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad;

    /*Set AHB buffer size for reading data through AHB bus. */
    config.ahbConfig.enableAHBPrefetch = true;
    config.ahbConfig.enableAHBBufferable = true;
    config.ahbConfig.enableAHBCachable = true;
    config.ahbConfig.enableReadAddressOpt = true;

    for (uint8_t i = 1; i &amp;lt; FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1; i++)
    {
        config.ahbConfig.buffer[i].bufferSize = 0;
    }

    config.ahbConfig.buffer[0].masterIndex = 4;  /* DMA0 */
    config.ahbConfig.buffer[0].bufferSize = 512; /* Allocate 512B bytes for DMA0 */
    config.ahbConfig.buffer[0].enablePrefetch = true;
    config.ahbConfig.buffer[0].priority = 0;
    /* All other masters use last buffer with 512B bytes. */
    config.ahbConfig.buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1].bufferSize = 512;
#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) &amp;amp;&amp;amp; FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN)
    config.enableCombination = true;
#endif

    FLEXSPI_Init(BUNNY_FLEXSPI, &amp;amp;config);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the code for the “SDK_DelayAtLeastUs” and “FLEXSPI_SetFlashConfig” functions:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;SDK_DelayAtLeastUs(10U, CLOCK_GetCoreSysClkFreq());

/*!
 * @brief Delay at least for some time.
 *  Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have
 *  effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and
 *  coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports
 *  up to 4294967 in current code. If long time delay is needed, please implement a new delay function.
 *
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; delayTime_us  Delay time in unit of microsecond.
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; coreClock_Hz  Core clock frequency with Hz.
 */
void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz)
{
    uint64_t count;

    if (delayTime_us &amp;gt; 0U)
    {
        count = USEC_TO_COUNT(delayTime_us, coreClock_Hz);

        assert(count &amp;lt;= UINT32_MAX);

#if defined(SDK_DELAY_USE_DWT) &amp;amp;&amp;amp; defined(DWT) /* Use DWT for better accuracy */

        MSDK_EnableCpuCycleCounter();
        /* Calculate the count ticks. */
        count += MSDK_GetCpuCycleCount();

        if (count &amp;gt; UINT32_MAX)
        {
            count -= UINT32_MAX;
            /* Wait for cyccnt overflow. */
            while (count &amp;lt; MSDK_GetCpuCycleCount())
            {
            }
        }

        /* Wait for cyccnt reach count value. */
        while (count &amp;gt; MSDK_GetCpuCycleCount())
        {
        }
#else
        /* Divide value may be different in various environment to ensure delay is precise.
         * Every loop count includes three instructions, due to Cortex-M7 sometimes executes
         * two instructions in one period, through test here set divide 1.5. Other M cores use
         * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does
         * not matter because other instructions outside while loop is enough to fill the time.
         */
#if (__CORTEX_M == 7)
        count = count / 3U * 2U;
#else
        count = count / 4U;
#endif
        DelayLoop((uint32_t)count);
#endif /* defined(SDK_DELAY_USE_DWT) &amp;amp;&amp;amp; defined(DWT) */
    }
}

/*!
 * brief Configures the connected device parameter.
 *
 * This function configures the connected device relevant parameters, such as the size, command, and so on.
 * The flash configuration value cannot have a default value. The user needs to configure it according to the
 * connected device.
 *
 * param base FLEXSPI peripheral base address.
 * param config Flash configuration parameters.
 * param port FLEXSPI Operation port.
 */
void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port)
{
    uint32_t configValue = 0;
    uint8_t index        = (uint8_t)port &amp;gt;&amp;gt; 1U; /* PortA with index 0, PortB with index 1. */

    /* Wait for bus to be idle before changing flash configuration. */
    while (!FLEXSPI_GetBusIdleStatus(base))
    {
    }

    /* Configure flash size and address shift. */
#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) &amp;amp;&amp;amp; (FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT)
    base-&amp;gt;FLSHCR0[port] = config-&amp;gt;flashSize | FLEXSPI_FLSHCR0_ADDRSHIFT(config-&amp;gt;addressShift);
#else
    base-&amp;gt;FLSHCR0[port] = config-&amp;gt;flashSize;
#endif /* FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT */

    /* Configure flash parameters. */
    base-&amp;gt;FLSHCR1[port] = FLEXSPI_FLSHCR1_CSINTERVAL(config-&amp;gt;CSInterval) |
                          FLEXSPI_FLSHCR1_CSINTERVALUNIT(config-&amp;gt;CSIntervalUnit) |
                          FLEXSPI_FLSHCR1_TCSH(config-&amp;gt;CSHoldTime) | FLEXSPI_FLSHCR1_TCSS(config-&amp;gt;CSSetupTime) |
                          FLEXSPI_FLSHCR1_CAS(config-&amp;gt;columnspace) | FLEXSPI_FLSHCR1_WA(config-&amp;gt;enableWordAddress);

    /* Configure AHB operation items. */
    configValue = base-&amp;gt;FLSHCR2[port];

    configValue &amp;amp;= ~(FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK | FLEXSPI_FLSHCR2_AWRWAIT_MASK | FLEXSPI_FLSHCR2_AWRSEQNUM_MASK |
                     FLEXSPI_FLSHCR2_AWRSEQID_MASK | FLEXSPI_FLSHCR2_ARDSEQNUM_MASK | FLEXSPI_FLSHCR2_ARDSEQID_MASK);

    configValue |=
        FLEXSPI_FLSHCR2_AWRWAITUNIT(config-&amp;gt;AHBWriteWaitUnit) | FLEXSPI_FLSHCR2_AWRWAIT(config-&amp;gt;AHBWriteWaitInterval);

    if (config-&amp;gt;AWRSeqNumber &amp;gt; 0U)
    {
        configValue |= FLEXSPI_FLSHCR2_AWRSEQID((uint32_t)config-&amp;gt;AWRSeqIndex) |
                       FLEXSPI_FLSHCR2_AWRSEQNUM((uint32_t)config-&amp;gt;AWRSeqNumber - 1U);
    }

    if (config-&amp;gt;ARDSeqNumber &amp;gt; 0U)
    {
        configValue |= FLEXSPI_FLSHCR2_ARDSEQID((uint32_t)config-&amp;gt;ARDSeqIndex) |
                       FLEXSPI_FLSHCR2_ARDSEQNUM((uint32_t)config-&amp;gt;ARDSeqNumber - 1U);
    }

    base-&amp;gt;FLSHCR2[port] = configValue;

    /* Configure DLL. */
    FLEXSPI_UpdateDllValue(base, config, port);

    /* Step into stop mode. */
    base-&amp;gt;MCR0 |= FLEXSPI_MCR0_MDIS_MASK;

    /* Configure write mask. */
    if (config-&amp;gt;enableWriteMask)
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMOPT1_MASK;
    }
    else
    {
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMOPT1_MASK;
    }

    if (index == 0U) /*PortA*/
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMENA_MASK;
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMENA(config-&amp;gt;enableWriteMask);
    }
#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB)) &amp;amp;&amp;amp; (FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB))
    else
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMENB_MASK;
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMENB(config-&amp;gt;enableWriteMask);
    }
#endif

    /* Exit stop mode. */
    base-&amp;gt;MCR0 &amp;amp;= ~FLEXSPI_MCR0_MDIS_MASK;

    /* Wait for bus to be idle before use it access to external flash. */
    while (!FLEXSPI_GetBusIdleStatus(base))
    {
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your great support!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
    <pubDate>Mon, 12 Oct 2026 08:57:39 GMT</pubDate>
    <dc:creator>IbhDaniel</dc:creator>
    <dc:date>2026-10-12T08:57:39Z</dc:date>
    <item>
      <title>MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2415955#M5951</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using the MCXN947 via FlexSPI with an OctalRAM (IS66WVO32M8DALL-200BLI).&lt;BR /&gt;The FlexSPI root clock is supplied at 150 MHz via PLL1, and since the RAM operates in DDR mode, I have an output clock rate of 75 MHz.&lt;BR /&gt;The `flexspi_device_config_t` has the following parameters:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;flexspi_device_config_t psram_config =
{
    .flexspiRootClk = 150000000U,
    .isSck2Enabled = false,
    .flashSize = OCTALRAM_ISSI_SIZE,
    .CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle,
    .CSInterval = 2,
    .CSHoldTime = 2,
    .CSSetupTime = 2,
    .dataValidTime = 2,
	.columnspace = 4,
    .enableWordAddress = false,
    .AWRSeqIndex = HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA,
    .AWRSeqNumber = 1,
    .ARDSeqIndex = HYPERRAM_CMD_LUT_SEQ_IDX_READDATA,
    .ARDSeqNumber = 1,
    .AHBWriteWaitUnit = kFLEXSPI_AhbWriteWaitUnit2AhbCycle,
    .AHBWriteWaitInterval = 0,
    .enableWriteMask = true,
};&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To initialize FlexSpi, I use the SDK FLEXSPI_DRIVER, version 2.6.0.&lt;BR /&gt;When I configure the delay cells using the auto-adjusted function (as described in the manual under section 10.3.15.6, “DLL configuration for sampling”) with the following values:&lt;BR /&gt;• SLVDLYTARGET=0x0F (divider 16/32 * root_clock = 3.33 ns)&lt;BR /&gt;• REFPHASEGAP=0x02&lt;BR /&gt;• DLLEN=0x01&lt;BR /&gt;• OVRDEN=0x01&lt;/P&gt;&lt;P&gt;After waiting for the ASLVLOCK and AREFLOCK lock bits, I get 0x01 for ASLVSEL and 0x00 for AREFSEL. Consequently, the RAM's read and write functions do not work, since the set delay time is approximately 120 ps!&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    /* Configure DLL. */
    configValue        = FLEXSPI_CalculateDll(base, config);
    base-&amp;gt;DLLCR[index] = configValue;

    /* DLL neu kalibrieren */
    base-&amp;gt;DLLCR[0] |= FLEXSPI_DLLCR_DLLRESET_MASK;
    base-&amp;gt;DLLCR[0] &amp;amp;= ~FLEXSPI_DLLCR_DLLRESET_MASK;

    /* Exit stop mode. */
    base-&amp;gt;MCR0 &amp;amp;= ~FLEXSPI_MCR0_MDIS_MASK;

    /* Lock abwarten */
    while ((base-&amp;gt;STS2 &amp;amp;
           (FLEXSPI_STS2_AREFLOCK_MASK |
            FLEXSPI_STS2_ASLVLOCK_MASK)) !=
           (FLEXSPI_STS2_AREFLOCK_MASK |
            FLEXSPI_STS2_ASLVLOCK_MASK))
    {
    }

    SDK_DelayAtLeastUs(10U, CLOCK_GetCoreSysClkFreq());&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-left" image-alt="MCXN947_DLL_register.jpg" style="width: 772px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/396803i7BC2432D22991D2A/image-size/large?v=v2&amp;amp;px=999" role="button" title="MCXN947_DLL_register.jpg" alt="MCXN947_DLL_register.jpg" /&gt;&lt;/span&gt;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;&amp;nbsp;&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;&lt;P&gt;Even if I use different values for SLVDLYTARGET, the output of ASLVLOCK and AREFLOCK does not change.&lt;BR /&gt;However, if I set the delay time to a fixed value using the registers OVRDEN=0x01 and OVRDVAL=0x1b (corresponding to a delay time of approximately 3.36 ns), reading from and writing to RAM works without any problems.&lt;/P&gt;&lt;P&gt;However, since the root clock is greater than 100 MHz, NXP recommends using the DLL's auto-adjustment feature.&lt;/P&gt;&lt;P&gt;Unfortunately, it doesn't seem to be able to determine the correct delay time!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Sep 2026 09:30:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2415955#M5951</guid>
      <dc:creator>IbhDaniel</dc:creator>
      <dc:date>2026-09-24T09:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2416418#M5955</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/266810"&gt;@IbhDaniel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the post!&lt;/P&gt;
&lt;P&gt;The MCXNx4 Reference Manual indicates that the serial root clock is the FlexSPI core clock (see Table 79. Clock Usage). In your case, this clock is configured to 150 MHz.&lt;/P&gt;
&lt;P&gt;I also see that you have implemented the DLL sampling configuration, and the auto-calibration path appears to be the correct approach. The settings SLVDLYTARGET = 0x0F and DLLEN = 0x01 were configured correctly. The only issue identified was OVRDEN = 0x01 instead of 0x00, which disables the auto-calibration output path and causes ASLVSEL = 0x01 and AREFSEL = 0x00 regardless of the SLVDLYTARGET value.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carlos_o_0-1790368326908.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/396899i2EE46910ED6899DA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="carlos_o_0-1790368326908.png" alt="carlos_o_0-1790368326908.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I would just like to confirm that the above analysis applies to your implementation. Could you please verify that: MCR0[RXCLKSRC] = 3h (Flash-memory-provided read strobe and input from DQS pad) is being used in your configuration?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2026 20:32:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2416418#M5955</guid>
      <dc:creator>carlos_o</dc:creator>
      <dc:date>2026-09-25T20:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2416970#M5965</link>
      <description>&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;BR /&gt;Sorry, that was a typo on my part, I set the OVRDEN bit to 0. In the screenshot of the MCU register, you can also see that OVRDEN was set to value 0.&lt;/P&gt;&lt;P&gt;I’m using the OctalRam IS66WVO32M8DALL-200BLI, if I understand correctly, this module sends the DQS signal to the MCU.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2026 07:09:46 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2416970#M5965</guid>
      <dc:creator>IbhDaniel</dc:creator>
      <dc:date>2026-09-29T07:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2417616#M5974</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/266810"&gt;@IbhDaniel&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Could you please verify that MCR0[RXCLKSRC] = 3h (Flash-memory-provided read strobe input from the DQS pad) is being used in your configuration?&lt;/P&gt;
&lt;P&gt;This point is important because auto-adjustment/calibration is only supported when the DQS signal is sourced from the external DQS pad. If a different RXCLKSRC setting is selected, the automatic delay adjustment mechanism will not operate as expected.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2026 00:08:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2417616#M5974</guid>
      <dc:creator>carlos_o</dc:creator>
      <dc:date>2026-10-01T00:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2417819#M5976</link>
      <description>&lt;P&gt;I checked it again, and the MCR0[RXCLKSRC] bit is set to 3h in the MCU.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2026 12:32:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2417819#M5976</guid>
      <dc:creator>IbhDaniel</dc:creator>
      <dc:date>2026-10-01T12:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2418212#M5982</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/266810"&gt;@IbhDaniel&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for the confirmation, I'll review this with the internal team. This may take some time. We appreciate your patience.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In the meanwhile, please use the workaround you find doing the manual calibration.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Apologize the inconvenience this may cause.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2026 21:17:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2418212#M5982</guid>
      <dc:creator>carlos_o</dc:creator>
      <dc:date>2026-10-02T21:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2418876#M6003</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/266810"&gt;@IbhDaniel&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Could you please share your&amp;nbsp;flexspi_config_t?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This to replicate the behavior you are facing.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also,&amp;nbsp;try adding SDK_DelayAtLeastUs of 10us after UpdateDllValue and after FLEXSPI_SetFlashConfig()&lt;/P&gt;
&lt;P&gt;BR&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2026 22:59:16 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2418876#M6003</guid>
      <dc:creator>carlos_o</dc:creator>
      <dc:date>2026-10-06T22:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: MCXN947 DLL auto-adjusted function not working</title>
      <link>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2420348#M6027</link>
      <description>&lt;P&gt;Hi Carlos,&lt;/P&gt;&lt;P&gt;Here is the information on the parameters I use with the `flexspi_config_t` structure:&lt;/P&gt;&lt;LI-CODE lang="c"&gt; 

   flexspi_config_t config;

    /* Get FLEXSPI default settings and configure the flexspi. */
    FLEXSPI_GetDefaultConfig(&amp;amp;config);

    config.rxSampleClock = kFLEXSPI_ReadSampleClkExternalInputFromDqsPad;

    /*Set AHB buffer size for reading data through AHB bus. */
    config.ahbConfig.enableAHBPrefetch = true;
    config.ahbConfig.enableAHBBufferable = true;
    config.ahbConfig.enableAHBCachable = true;
    config.ahbConfig.enableReadAddressOpt = true;

    for (uint8_t i = 1; i &amp;lt; FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1; i++)
    {
        config.ahbConfig.buffer[i].bufferSize = 0;
    }

    config.ahbConfig.buffer[0].masterIndex = 4;  /* DMA0 */
    config.ahbConfig.buffer[0].bufferSize = 512; /* Allocate 512B bytes for DMA0 */
    config.ahbConfig.buffer[0].enablePrefetch = true;
    config.ahbConfig.buffer[0].priority = 0;
    /* All other masters use last buffer with 512B bytes. */
    config.ahbConfig.buffer[FSL_FEATURE_FLEXSPI_AHB_BUFFER_COUNT - 1].bufferSize = 512;
#if !(defined(FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN) &amp;amp;&amp;amp; FSL_FEATURE_FLEXSPI_HAS_NO_MCR0_COMBINATIONEN)
    config.enableCombination = true;
#endif

    FLEXSPI_Init(BUNNY_FLEXSPI, &amp;amp;config);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And here is the code for the “SDK_DelayAtLeastUs” and “FLEXSPI_SetFlashConfig” functions:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;SDK_DelayAtLeastUs(10U, CLOCK_GetCoreSysClkFreq());

/*!
 * @brief Delay at least for some time.
 *  Please note that, if not uses DWT, this API will use while loop for delay, different run-time environments have
 *  effect on the delay time. If precise delay is needed, please enable DWT delay. The two parmeters delayTime_us and
 *  coreClock_Hz have limitation. For example, in the platform with 1GHz coreClock_Hz, the delayTime_us only supports
 *  up to 4294967 in current code. If long time delay is needed, please implement a new delay function.
 *
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; delayTime_us  Delay time in unit of microsecond.
 * &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/197964"&gt;@Param&lt;/a&gt; coreClock_Hz  Core clock frequency with Hz.
 */
void SDK_DelayAtLeastUs(uint32_t delayTime_us, uint32_t coreClock_Hz)
{
    uint64_t count;

    if (delayTime_us &amp;gt; 0U)
    {
        count = USEC_TO_COUNT(delayTime_us, coreClock_Hz);

        assert(count &amp;lt;= UINT32_MAX);

#if defined(SDK_DELAY_USE_DWT) &amp;amp;&amp;amp; defined(DWT) /* Use DWT for better accuracy */

        MSDK_EnableCpuCycleCounter();
        /* Calculate the count ticks. */
        count += MSDK_GetCpuCycleCount();

        if (count &amp;gt; UINT32_MAX)
        {
            count -= UINT32_MAX;
            /* Wait for cyccnt overflow. */
            while (count &amp;lt; MSDK_GetCpuCycleCount())
            {
            }
        }

        /* Wait for cyccnt reach count value. */
        while (count &amp;gt; MSDK_GetCpuCycleCount())
        {
        }
#else
        /* Divide value may be different in various environment to ensure delay is precise.
         * Every loop count includes three instructions, due to Cortex-M7 sometimes executes
         * two instructions in one period, through test here set divide 1.5. Other M cores use
         * divide 4. By the way, divide 1.5 or 4 could let the count lose precision, but it does
         * not matter because other instructions outside while loop is enough to fill the time.
         */
#if (__CORTEX_M == 7)
        count = count / 3U * 2U;
#else
        count = count / 4U;
#endif
        DelayLoop((uint32_t)count);
#endif /* defined(SDK_DELAY_USE_DWT) &amp;amp;&amp;amp; defined(DWT) */
    }
}

/*!
 * brief Configures the connected device parameter.
 *
 * This function configures the connected device relevant parameters, such as the size, command, and so on.
 * The flash configuration value cannot have a default value. The user needs to configure it according to the
 * connected device.
 *
 * param base FLEXSPI peripheral base address.
 * param config Flash configuration parameters.
 * param port FLEXSPI Operation port.
 */
void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port)
{
    uint32_t configValue = 0;
    uint8_t index        = (uint8_t)port &amp;gt;&amp;gt; 1U; /* PortA with index 0, PortB with index 1. */

    /* Wait for bus to be idle before changing flash configuration. */
    while (!FLEXSPI_GetBusIdleStatus(base))
    {
    }

    /* Configure flash size and address shift. */
#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT) &amp;amp;&amp;amp; (FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT)
    base-&amp;gt;FLSHCR0[port] = config-&amp;gt;flashSize | FLEXSPI_FLSHCR0_ADDRSHIFT(config-&amp;gt;addressShift);
#else
    base-&amp;gt;FLSHCR0[port] = config-&amp;gt;flashSize;
#endif /* FSL_FEATURE_FLEXSPI_SUPPORT_ADDRESS_SHIFT */

    /* Configure flash parameters. */
    base-&amp;gt;FLSHCR1[port] = FLEXSPI_FLSHCR1_CSINTERVAL(config-&amp;gt;CSInterval) |
                          FLEXSPI_FLSHCR1_CSINTERVALUNIT(config-&amp;gt;CSIntervalUnit) |
                          FLEXSPI_FLSHCR1_TCSH(config-&amp;gt;CSHoldTime) | FLEXSPI_FLSHCR1_TCSS(config-&amp;gt;CSSetupTime) |
                          FLEXSPI_FLSHCR1_CAS(config-&amp;gt;columnspace) | FLEXSPI_FLSHCR1_WA(config-&amp;gt;enableWordAddress);

    /* Configure AHB operation items. */
    configValue = base-&amp;gt;FLSHCR2[port];

    configValue &amp;amp;= ~(FLEXSPI_FLSHCR2_AWRWAITUNIT_MASK | FLEXSPI_FLSHCR2_AWRWAIT_MASK | FLEXSPI_FLSHCR2_AWRSEQNUM_MASK |
                     FLEXSPI_FLSHCR2_AWRSEQID_MASK | FLEXSPI_FLSHCR2_ARDSEQNUM_MASK | FLEXSPI_FLSHCR2_ARDSEQID_MASK);

    configValue |=
        FLEXSPI_FLSHCR2_AWRWAITUNIT(config-&amp;gt;AHBWriteWaitUnit) | FLEXSPI_FLSHCR2_AWRWAIT(config-&amp;gt;AHBWriteWaitInterval);

    if (config-&amp;gt;AWRSeqNumber &amp;gt; 0U)
    {
        configValue |= FLEXSPI_FLSHCR2_AWRSEQID((uint32_t)config-&amp;gt;AWRSeqIndex) |
                       FLEXSPI_FLSHCR2_AWRSEQNUM((uint32_t)config-&amp;gt;AWRSeqNumber - 1U);
    }

    if (config-&amp;gt;ARDSeqNumber &amp;gt; 0U)
    {
        configValue |= FLEXSPI_FLSHCR2_ARDSEQID((uint32_t)config-&amp;gt;ARDSeqIndex) |
                       FLEXSPI_FLSHCR2_ARDSEQNUM((uint32_t)config-&amp;gt;ARDSeqNumber - 1U);
    }

    base-&amp;gt;FLSHCR2[port] = configValue;

    /* Configure DLL. */
    FLEXSPI_UpdateDllValue(base, config, port);

    /* Step into stop mode. */
    base-&amp;gt;MCR0 |= FLEXSPI_MCR0_MDIS_MASK;

    /* Configure write mask. */
    if (config-&amp;gt;enableWriteMask)
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMOPT1_MASK;
    }
    else
    {
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMOPT1_MASK;
    }

    if (index == 0U) /*PortA*/
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMENA_MASK;
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMENA(config-&amp;gt;enableWriteMask);
    }
#if !((defined(FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB)) &amp;amp;&amp;amp; (FSL_FEATURE_FLEXSPI_HAS_NO_FLSHCR4_WMENB))
    else
    {
        base-&amp;gt;FLSHCR4 &amp;amp;= ~FLEXSPI_FLSHCR4_WMENB_MASK;
        base-&amp;gt;FLSHCR4 |= FLEXSPI_FLSHCR4_WMENB(config-&amp;gt;enableWriteMask);
    }
#endif

    /* Exit stop mode. */
    base-&amp;gt;MCR0 &amp;amp;= ~FLEXSPI_MCR0_MDIS_MASK;

    /* Wait for bus to be idle before use it access to external flash. */
    while (!FLEXSPI_GetBusIdleStatus(base))
    {
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much for your great support!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Mon, 12 Oct 2026 08:57:39 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MCX-Microcontrollers/MCXN947-DLL-auto-adjusted-function-not-working/m-p/2420348#M6027</guid>
      <dc:creator>IbhDaniel</dc:creator>
      <dc:date>2026-10-12T08:57:39Z</dc:date>
    </item>
  </channel>
</rss>

