How to set flexspi1 clock source

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

How to set flexspi1 clock source

1,311 Views
vasudhevan
Contributor V

Hi,

    Board = IMXRT 1064 evk

    my main project integrated  to evkmimxrt1064_flash_component_nor example code.

My previous question(https://community.nxp.com/thread/524961 ) as i mentioned clock source giving error.

    CLOCK_InitUsb1Pll(&g_ccmConfigUsbPll);
    CLOCK_InitUsb1Pfd(kCLOCK_Pfd0, 24);   /* Set PLL3 PFD0 clock 360MHZ. */
    CLOCK_SetMux(kCLOCK_FlexspiMux, 0x3); /* Choose PLL3 PFD0 clock as flexspi source clock. */
    CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2);   /* flexspi clock 120M. */

 If i use below code hard fault error avoided.

    CLOCK_SetMux(kCLOCK_FlexspiMux, 0x2); /* Choose PLL2 PFD2 clock as flexspi source clock. 396M */
    CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2);   /* flexspi clock 133M. */

  But issue is writing and reading data is not proper.

  Some time working properly but some time its not working.

  1) This issue because of clock source ?

  2) How to set proper clock to avoid hard fault error ?

Thanks & Regards

     Vasu

Labels (1)
Tags (1)
0 Kudos
4 Replies

1,200 Views
mjbcswitzerland
Specialist V

Hi

If your code is running in XiP it is dangerous to adjust the FlexSPI1 clock since it may disturb its normal operation (reading the code from QSPI using the clock that is being changed).

It is best to only change this clock setting when the code to do it is executing from a different memory (eg. internal RAM).

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

1,200 Views
vasudhevan
Contributor V

Hi Mark,

 Thank you for your reply.

     I am checking on mcu debug mode.

     One difference is our application running on OCRAM (or) SDRAM but example code running on DTC.

     We thought to use FLRXSPI1 external memory read write operation available to store ip and configuration data.

     It is best to only change this clock setting when the code to do it is executing from a different memory (eg. internal RAM)

    How to achieve this ?

    FLEXSPI1 not working properly means can we use any LPSPI interface we can avoid the issue ?

    How example code working fine but integrated code not working ?

    

Thanks & Regards,

         Vasu

0 Kudos

1,200 Views
mjbcswitzerland
Specialist V

Hi

All SDK code examples showing operation in the QSPI is run from RAM so you will need to do the same thing.

The uTasker project for i.MX RT 1064 also has a complete solution which allows TCP/IP with parameters and file system in the internal QSPI flash: https://www.utasker.com/iMX/RT1064.html

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

1,200 Views
vasudhevan
Contributor V

Hi Mark,

     Thank you for your reply.

     Project-> C/C++ Build -> Settings -> Link application to RAM.

     But still same issue.

     

Thanks & Regards,

       Vasu

0 Kudos