imx rt 1024: how to set flexspi clock to 60 MHz

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

imx rt 1024: how to set flexspi clock to 60 MHz

ソリューションへジャンプ
776件の閲覧回数
bp1979
Senior Contributor I

In nor polling SDK example the flexspi clock is set to 133 MHz.

We want to use flash at 60 MHz, but it is very hard to understand what exactly needs to happen.

In app.h this code is generated:

#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

In the clock tool I can configure the clock to 133 MHz

bp1979_0-1704454076067.png

I want to use it at 60 MHz

bp1979_1-1704454120061.png

Can you please tell me how to adapt the code in app.h to use the flexspi clock at 60 MHz?

    CLOCK_InitSysPfd(kCLOCK_Pfd3 ???, ???); // No clue what I fill in here
    CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); // Should this be 0x3???
    CLOCK_SetDiv(kCLOCK_FlexspiDiv, 8);

 

 

0 件の賞賛
返信
1 解決策
751件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

  Your understand is correct.

Just this one, div should be 7, not 8:

CLOCK_SetDiv(kCLOCK_FlexspiDiv, 7);

kerryzhou_0-1704702679151.png

kerryzhou_1-1704702688943.png

BTW, I don't think you need to use the 60Mhz in the code, if you still can use the DQS pin.

Just when you can't use the DQS pin, then you need to use the 60MHz.

Best Regards,

Kerry

 

元の投稿で解決策を見る

6 返答(返信)
763件の閲覧回数
bp1979
Senior Contributor I

I think I figured it out

 

can you confirm that this is correct?

#if defined(flash_60MHz)
    CLOCK_InitSysPfd(kCLOCK_Pfd3, 24);    /* Set PLL3 PFD2 clock 480MHz (I guess??) . */
    CLOCK_SetMux(kCLOCK_FlexspiMux, 0x1); /* Choose PLL3 PFD2 clock as flexspi source clock. */
    CLOCK_SetDiv(kCLOCK_FlexspiDiv, 8);   /* Divide 480 by 8 to get flexspi clock 60MHz. */
#else
    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. */
#endif
0 件の賞賛
返信
752件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

  Your understand is correct.

Just this one, div should be 7, not 8:

CLOCK_SetDiv(kCLOCK_FlexspiDiv, 7);

kerryzhou_0-1704702679151.png

kerryzhou_1-1704702688943.png

BTW, I don't think you need to use the 60Mhz in the code, if you still can use the DQS pin.

Just when you can't use the DQS pin, then you need to use the 60MHz.

Best Regards,

Kerry

 

748件の閲覧回数
bp1979
Senior Contributor I

Oh.... my.... god... really?

I will test this this evening. But the traditional off-by-one is kind of painful in this case ;-).

Thx, this makes perfect sense anyway

0 件の賞賛
返信
745件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

In face, our flexSPI is very flex, don't worry, no matter 60M or more, eg. 133Mhz, it is supported.

Just use the related configuration code.

Best Regards,

Kerry

0 件の賞賛
返信
743件の閲覧回数
bp1979
Senior Contributor I

Right, I noticed that it indeed super flexible, which makes it pretty complicated. But I am hopeful again that things might finally come together now.

Just to be clear: we can't use DQS (we assigned that pin to something else in our hardware design, unfortunately), so I need to get flash running at max 60MHz. And I just learned from you that I THOUGHT I was running the flexspi clock at 60MHz, but I wasn't. 

I hope that this solves some other weird behavior I am experiencing with my second flash. I will let you know

0 件の賞賛
返信
738件の閲覧回数
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @bp1979 ,

  This is also easy to handle.

  Set the flexSPI freq to 60Mhz+

config.rxSampleClock = EXAMPLE_FLEXSPI_RX_SAMPLE_CLOCK;

#define EXAMPLE_FLEXSPI_RX_SAMPLE_CLOCK kFLEXSPI_ReadSampleClkLoopbackInternally

Best Regards,

Kerry

0 件の賞賛
返信