MCXN947 DLL auto-adjusted function not working

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

MCXN947 DLL auto-adjusted function not working

95 Views
IbhDaniel
Contributor I

Hello,

I'm using the MCXN947 via FlexSPI with an OctalRAM (IS66WVO32M8DALL-200BLI).
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.
The `flexspi_device_config_t` has the following parameters:

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,
};

 

To initialize FlexSpi, I use the SDK FLEXSPI_DRIVER, version 2.6.0.
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:
• SLVDLYTARGET=0x0F (divider 16/32 * root_clock = 3.33 ns)
• REFPHASEGAP=0x02
• DLLEN=0x01
• OVRDEN=0x01

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!

    /* Configure DLL. */
    configValue        = FLEXSPI_CalculateDll(base, config);
    base->DLLCR[index] = configValue;

    /* DLL neu kalibrieren */
    base->DLLCR[0] |= FLEXSPI_DLLCR_DLLRESET_MASK;
    base->DLLCR[0] &= ~FLEXSPI_DLLCR_DLLRESET_MASK;

    /* Exit stop mode. */
    base->MCR0 &= ~FLEXSPI_MCR0_MDIS_MASK;

    /* Lock abwarten */
    while ((base->STS2 &
           (FLEXSPI_STS2_AREFLOCK_MASK |
            FLEXSPI_STS2_ASLVLOCK_MASK)) !=
           (FLEXSPI_STS2_AREFLOCK_MASK |
            FLEXSPI_STS2_ASLVLOCK_MASK))
    {
    }

    SDK_DelayAtLeastUs(10U, CLOCK_GetCoreSysClkFreq());

 

MCXN947_DLL_register.jpg

 

 

 

 

 

 

 

 

 

 

 

Even if I use different values for SLVDLYTARGET, the output of ASLVLOCK and AREFLOCK does not change.
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.

However, since the root clock is greater than 100 MHz, NXP recommends using the DLL's auto-adjustment feature.

Unfortunately, it doesn't seem to be able to determine the correct delay time!

 

0 Kudos
Reply
1 Reply

3 Views
carlos_o
NXP TechSupport
NXP TechSupport

Hi @IbhDaniel 

Thank you for the post!

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.

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.

carlos_o_0-1790368326908.png

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?

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2415955%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EMCXN947%20DLL%20auto-adjusted%20function%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2415955%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHello%2C%3C%2FP%3E%3CP%3EI'm%20using%20the%20MCXN947%20via%20FlexSPI%20with%20an%20OctalRAM%20(IS66WVO32M8DALL-200BLI).%3CBR%20%2F%3EThe%20FlexSPI%20root%20clock%20is%20supplied%20at%20150%20MHz%20via%20PLL1%2C%20and%20since%20the%20RAM%20operates%20in%20DDR%20mode%2C%20I%20have%20an%20output%20clock%20rate%20of%2075%20MHz.%3CBR%20%2F%3EThe%20%60flexspi_device_config_t%60%20has%20the%20following%20parameters%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Eflexspi_device_config_t%20psram_config%20%3D%0A%7B%0A%20%20%20%20.flexspiRootClk%20%3D%20150000000U%2C%0A%20%20%20%20.isSck2Enabled%20%3D%20false%2C%0A%20%20%20%20.flashSize%20%3D%20OCTALRAM_ISSI_SIZE%2C%0A%20%20%20%20.CSIntervalUnit%20%3D%20kFLEXSPI_CsIntervalUnit1SckCycle%2C%0A%20%20%20%20.CSInterval%20%3D%202%2C%0A%20%20%20%20.CSHoldTime%20%3D%202%2C%0A%20%20%20%20.CSSetupTime%20%3D%202%2C%0A%20%20%20%20.dataValidTime%20%3D%202%2C%0A%09.columnspace%20%3D%204%2C%0A%20%20%20%20.enableWordAddress%20%3D%20false%2C%0A%20%20%20%20.AWRSeqIndex%20%3D%20HYPERRAM_CMD_LUT_SEQ_IDX_WRITEDATA%2C%0A%20%20%20%20.AWRSeqNumber%20%3D%201%2C%0A%20%20%20%20.ARDSeqIndex%20%3D%20HYPERRAM_CMD_LUT_SEQ_IDX_READDATA%2C%0A%20%20%20%20.ARDSeqNumber%20%3D%201%2C%0A%20%20%20%20.AHBWriteWaitUnit%20%3D%20kFLEXSPI_AhbWriteWaitUnit2AhbCycle%2C%0A%20%20%20%20.AHBWriteWaitInterval%20%3D%200%2C%0A%20%20%20%20.enableWriteMask%20%3D%20true%2C%0A%7D%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3ETo%20initialize%20FlexSpi%2C%20I%20use%20the%20SDK%20FLEXSPI_DRIVER%2C%20version%202.6.0.%3CBR%20%2F%3EWhen%20I%20configure%20the%20delay%20cells%20using%20the%20auto-adjusted%20function%20(as%20described%20in%20the%20manual%20under%20section%2010.3.15.6%2C%20%E2%80%9CDLL%20configuration%20for%20sampling%E2%80%9D)%20with%20the%20following%20values%3A%3CBR%20%2F%3E%E2%80%A2%20SLVDLYTARGET%3D0x0F%20(divider%2016%2F32%20*%20root_clock%20%3D%203.33%20ns)%3CBR%20%2F%3E%E2%80%A2%20REFPHASEGAP%3D0x02%3CBR%20%2F%3E%E2%80%A2%20DLLEN%3D0x01%3CBR%20%2F%3E%E2%80%A2%20OVRDEN%3D0x01%3C%2FP%3E%3CP%3EAfter%20waiting%20for%20the%20ASLVLOCK%20and%20AREFLOCK%20lock%20bits%2C%20I%20get%200x01%20for%20ASLVSEL%20and%200x00%20for%20AREFSEL.%20Consequently%2C%20the%20RAM's%20read%20and%20write%20functions%20do%20not%20work%2C%20since%20the%20set%20delay%20time%20is%20approximately%20120%20ps!%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%20%20%20%20%2F*%20Configure%20DLL.%20*%2F%0A%20%20%20%20configValue%20%20%20%20%20%20%20%20%3D%20FLEXSPI_CalculateDll(base%2C%20config)%3B%0A%20%20%20%20base-%26gt%3BDLLCR%5Bindex%5D%20%3D%20configValue%3B%0A%0A%20%20%20%20%2F*%20DLL%20neu%20kalibrieren%20*%2F%0A%20%20%20%20base-%26gt%3BDLLCR%5B0%5D%20%7C%3D%20FLEXSPI_DLLCR_DLLRESET_MASK%3B%0A%20%20%20%20base-%26gt%3BDLLCR%5B0%5D%20%26amp%3B%3D%20~FLEXSPI_DLLCR_DLLRESET_MASK%3B%0A%0A%20%20%20%20%2F*%20Exit%20stop%20mode.%20*%2F%0A%20%20%20%20base-%26gt%3BMCR0%20%26amp%3B%3D%20~FLEXSPI_MCR0_MDIS_MASK%3B%0A%0A%20%20%20%20%2F*%20Lock%20abwarten%20*%2F%0A%20%20%20%20while%20((base-%26gt%3BSTS2%20%26amp%3B%0A%20%20%20%20%20%20%20%20%20%20%20(FLEXSPI_STS2_AREFLOCK_MASK%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20FLEXSPI_STS2_ASLVLOCK_MASK))%20!%3D%0A%20%20%20%20%20%20%20%20%20%20%20(FLEXSPI_STS2_AREFLOCK_MASK%20%7C%0A%20%20%20%20%20%20%20%20%20%20%20%20FLEXSPI_STS2_ASLVLOCK_MASK))%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%0A%20%20%20%20SDK_DelayAtLeastUs(10U%2C%20CLOCK_GetCoreSysClkFreq())%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CBR%20%2F%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20image-alt%3D%22MCXN947_DLL_register.jpg%22%20style%3D%22width%3A%20772px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MCXN947_DLL_register.jpg%22%20style%3D%22width%3A%20772px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22MCXN947_DLL_register.jpg%22%20style%3D%22width%3A%20772px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F396803i7BC2432D22991D2A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22MCXN947_DLL_register.jpg%22%20alt%3D%22MCXN947_DLL_register.jpg%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CP%3EEven%20if%20I%20use%20different%20values%20for%20SLVDLYTARGET%2C%20the%20output%20of%20ASLVLOCK%20and%20AREFLOCK%20does%20not%20change.%3CBR%20%2F%3EHowever%2C%20if%20I%20set%20the%20delay%20time%20to%20a%20fixed%20value%20using%20the%20registers%20OVRDEN%3D0x01%20and%20OVRDVAL%3D0x1b%20(corresponding%20to%20a%20delay%20time%20of%20approximately%203.36%20ns)%2C%20reading%20from%20and%20writing%20to%20RAM%20works%20without%20any%20problems.%3C%2FP%3E%3CP%3EHowever%2C%20since%20the%20root%20clock%20is%20greater%20than%20100%20MHz%2C%20NXP%20recommends%20using%20the%20DLL's%20auto-adjustment%20feature.%3C%2FP%3E%3CP%3EUnfortunately%2C%20it%20doesn't%20seem%20to%20be%20able%20to%20determine%20the%20correct%20delay%20time!%3C%2FP%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2415955%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3ECommunication%20%26amp%3B%20Control(I3C%20%7C%20I2C%20%7C%20SPI%20%7C%20FlexCAN%20%7C%20Ethernet%20%7C%20FlexIO)%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ECore%20and%20Memory%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMCXN%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2416418%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20MCXN947%20DLL%20auto-adjusted%20function%20not%20working%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2416418%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F266810%22%20target%3D%22_blank%22%3E%40IbhDaniel%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThank%20you%20for%20the%20post!%3C%2FP%3E%0A%3CP%3EThe%20MCXNx4%20Reference%20Manual%20indicates%20that%20the%20serial%20root%20clock%20is%20the%20FlexSPI%20core%20clock%20(see%20Table%2079.%20Clock%20Usage).%20In%20your%20case%2C%20this%20clock%20is%20configured%20to%20150%20MHz.%3C%2FP%3E%0A%3CP%3EI%20also%20see%20that%20you%20have%20implemented%20the%20DLL%20sampling%20configuration%2C%20and%20the%20auto-calibration%20path%20appears%20to%20be%20the%20correct%20approach.%20The%20settings%20SLVDLYTARGET%20%3D%200x0F%20and%20DLLEN%20%3D%200x01%20were%20configured%20correctly.%20The%20only%20issue%20identified%20was%20OVRDEN%20%3D%200x01%20instead%20of%200x00%2C%20which%20disables%20the%20auto-calibration%20output%20path%20and%20causes%20ASLVSEL%20%3D%200x01%20and%20AREFSEL%20%3D%200x00%20regardless%20of%20the%20SLVDLYTARGET%20value.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22carlos_o_0-1790368326908.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22carlos_o_0-1790368326908.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F396899i2EE46910ED6899DA%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22carlos_o_0-1790368326908.png%22%20alt%3D%22carlos_o_0-1790368326908.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EI%20would%20just%20like%20to%20confirm%20that%20the%20above%20analysis%20applies%20to%20your%20implementation.%20Could%20you%20please%20verify%20that%3A%20MCR0%5BRXCLKSRC%5D%20%3D%203h%20(Flash-memory-provided%20read%20strobe%20and%20input%20from%20DQS%20pad)%20is%20being%20used%20in%20your%20configuration%3F%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E