Do I have to initialize FlexSPI in DCD for correct function or is qspiflash_config enough?

cancel
Showing results for 
Search instead for 
Did you mean: 

Do I have to initialize FlexSPI in DCD for correct function or is qspiflash_config enough?

Jump to solution
467 Views
mitterha
Senior Contributor I

Hello,

the clock_config file generated by MCUXpresso Config Tools includes the following code

/* In SDK projects, external flash (configured by FLEXSPI) will be initialized by dcd.
     * With this macro XIP_EXTERNAL_FLASH, usb1 pll (selected to be FLEXSPI clock source in SDK projects) will be left unchanged.
     * Note: If another clock source is selected for FLEXSPI, user may want to avoid changing that clock as well.*/
#if !(defined(XIP_EXTERNAL_FLASH) && (XIP_EXTERNAL_FLASH == 1))
    /* Disable Flexspi clock gate. */
    CLOCK_DisableClock(kCLOCK_FlexSpi);
    /* Set FLEXSPI_PODF. */
    CLOCK_SetDiv(kCLOCK_FlexspiDiv, 3);
    /* Set Flexspi clock source. */
    CLOCK_SetMux(kCLOCK_FlexspiMux, 2);
#endif

The note mentions that for SDK projects the external flash will be initialized by dcd. Is that correct? I thought the Boot ROM initializes the FlexSPI based on the XIP data flexspi_nor_config_t qspiflash_config stored in Flash.

Do I have to initialize FlexSPI in DCD for correct function or is qspiflash_config enough?

Kind regards,

Stefan

Tags (1)
0 Kudos
1 Solution
408 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Stefan,

This structure are part of DCD. Please look into the Image Vector Table and Boot Data section in reference manual.

ROM Boot code read this structure in DCD and configure the NOR flash. So, if the application configure FlexSPI clock again, the mcu core can get code from NOR flash.

To compile the DCD section into image's head, please refer to AN12107 and AN12108.

https://www.nxp.com/docs/en/application-note/AN12107.pdf 

https://www.nxp.com/docs/en/application-note/AN12108.pdf 

Regards,

Jing

View solution in original post

2 Replies
409 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Stefan,

This structure are part of DCD. Please look into the Image Vector Table and Boot Data section in reference manual.

ROM Boot code read this structure in DCD and configure the NOR flash. So, if the application configure FlexSPI clock again, the mcu core can get code from NOR flash.

To compile the DCD section into image's head, please refer to AN12107 and AN12108.

https://www.nxp.com/docs/en/application-note/AN12107.pdf 

https://www.nxp.com/docs/en/application-note/AN12108.pdf 

Regards,

Jing

408 Views
mitterha
Senior Contributor I

Hello Jing Pan,

thank you for your answer. Until now I always thought that DCD only refers to the table "Device Configuration" in MCUXpresso Config Tools.

Kind regards,

Stefan