RT1020 flash operation SDK example Question

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

RT1020 flash operation SDK example Question

跳至解决方案
1,494 次查看
Seongyon_Jeong
Contributor III

Hi

from flash SDK example, 

My question is About flexspi_clock_init.  

static inline void flexspi_clock_init()
{
#if defined(XIP_EXTERNAL_FLASH) && (XIP_EXTERNAL_FLASH == 1)
/* Switch to PLL2 for XIP to avoid hardfault during re-initialize clock. */
CLOCK_InitSysPfd(kCLOCK_Pfd2, 24); /* Set PLL2 PFD2 clock 396MHZ. */
CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); /* Choose PLL2 PFD2 clock as flexspi source clock. */
CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2); /* flexspi clock 133M. */
#else
~~~~
#endif
}

In this function  ,   flexspi clock is 132Mz , isn`t it ?   why  133,000,000 ?,   

Does not it make wrong action ?

/*******************************************************************************
* Code
******************************************************************************/
flexspi_device_config_t deviceconfig = {
.flexspiRootClk = 133000000,
.flashSize = FLASH_SIZE,
.CSIntervalUnit = kFLEXSPI_CsIntervalUnit1SckCycle,
.CSInterval = 2,

 

0 项奖励
回复
1 解答
1,467 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Seongyon_Jeong,

You are correct. From the software description it does seem to be 132MHz, but after replicating the setup on ConfigTools' Clocks tool, I also got the same 132MHz. I believe 133MHz is one of the standard values supported from flash devices. However, most likely for simplicity the flexspi_clock_init() routine initially sets it to a near acceptable value of 132MHz. That said, I will comment about this internally to chance the comment to the appropriate frequency.

Thanks for reporting this.

BR,
Edwin.

 

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,480 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Seongyon_Jeong,

The output from the flexspi_clock_init() should be 133MHz. Are you seeing a 131MHz output from your board? Or how are you determining that your output is different from the intended frequency?

BR,
Edwin.

0 项奖励
回复
1,477 次查看
Seongyon_Jeong
Contributor III

I didn`t  check the frequency [directly - physically] using scope.  

Just only,  with Software description.,

CLOCK_InitSysPfd(kCLOCK_Pfd2, 24); => PLL2 PFD2 clock 396 Mhz
CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); /* Choose PLL2 PFD2 clock as flexspi source clock. */
CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2);
=> Exactly [ PLL2 PFD2 clock 396 Mhz ] / 3 = 132Mhz , why Say 396 / 3 = 133Mhz ???

0 项奖励
回复
1,468 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @Seongyon_Jeong,

You are correct. From the software description it does seem to be 132MHz, but after replicating the setup on ConfigTools' Clocks tool, I also got the same 132MHz. I believe 133MHz is one of the standard values supported from flash devices. However, most likely for simplicity the flexspi_clock_init() routine initially sets it to a near acceptable value of 132MHz. That said, I will comment about this internally to chance the comment to the appropriate frequency.

Thanks for reporting this.

BR,
Edwin.

 

0 项奖励
回复
1,454 次查看
Seongyon_Jeong
Contributor III
thanks for your explanation.
0 项奖励
回复