We have a IMXRT1010 MCU project, where we execute from external flash directly (no ITCM, all RAM is mapped to DTCM), and due to EMI reasons we must spread the QSPI clock's spectrum.
1. The ConfigTools generated code prevents modifying the FlexSPI clock source when the XIP_EXTERNAL_FLASH is set. However we have found that as long as the FlexSPI clock isn't disabled, only the clock source is modified on the fly, we could change the clock source for it. I realize that this is a risky move, so I want to understand what's the recommended way of changing the FlexSPI clock source with XIP? I would also need to know how the bootloader configures the FlexSPI clock source (to avoid temporarily overclocking it while changing the source and dividers)?
2. The ConfigTools don't have any option to configure the spread spectrum parameters of the PLLs, even though it generates the sysPllConfig_BOARD_BootClockRUN (constant) structure that is supposed to hold these parameters. So I don't have good maintainable options to set the spread spectrum parameters using this toolchain. I can either:
none of which sounds very appealing. So I kindly ask that you introduce this configuration into the ConfigTools instead.
XIP_EXTERNAL_FLASH prevent application code modify FlexSPI clock speed. If the application works in XIP mode, bootloader has configured FlexSPI already. Core can read code from SPI FLASH and execute. If user code modify FLEXSPI clock, read operation will crash and system go into hardfault.
If you want to change FlexSPI speed, you should let bootloader do it. In evkmimxrt1010_flexspi_nor_config.c, there is a structure qspiflash_config. ROM Bootloader will read this structure at address 0x60000000 and configure FlexSPI port.
If you don't satisfy with ROM bootloader's setting, you must copy a piece of code to RAM and jump to RAM code. In RAM code, you can reconfigure the clock tree and then jump back again.
Please refer to AN12107 and AN12108 for more detail.