I'm attempting to test a FlexSPI2 memory device on my custom 1064 MCU based board using NXP's 'evkmimxrt1064_flexspi_nor_polling_transfer' example...
the example code works and I can access an external NOR flash device okay modifying the example code's clock, pin-mux configuration and LUT, etc. to match my FlexSpiA flash device's pin and LUT.
But when I try to modify the example code to use FlexSpi B instead of FlexSpi A to access another memory device on the FlexSpi B bus, the code crashes when the FlexSpi2 Clock Mux and/or Clock Div are configured. I suspect the problem I am having has to do with the clock setup/configuration (clock_config.c) because the code crashes when the FlexSpi2 (B) clock is configured, even before the FlexSpi driver API is initialized (crash happens in red colored code, below).

/* Disable Flexspi clock gate. */
CLOCK_DisableClock(kCLOCK_FlexSpi);
/* Set FLEXSPI_PODF. */
CLOCK_SetDiv(kCLOCK_FlexspiDiv, 2);
/* Set Flexspi clock source. */
CLOCK_SetMux(kCLOCK_FlexspiMux, 2);
/* In SDK projects, external flash (configured by FLEXSPI2) will be initialized by dcd.
* With this macro XIP_EXTERNAL_FLASH, usb1 pll (selected to be FLEXSPI2 clock source in SDK projects) will be left unchanged.
* Note: If another clock source is selected for FLEXSPI2, user may want to avoid changing that clock as well.*/
#if 1 //////// !(defined(XIP_EXTERNAL_FLASH) && (XIP_EXTERNAL_FLASH == 1))
/* Disable Flexspi2 clock gate. */
CLOCK_DisableClock(kCLOCK_FlexSpi2);
/* Set FLEXSPI2_PODF. */
CLOCK_SetDiv(kCLOCK_Flexspi2Div, 3);
/* Set Flexspi2 clock source. */
CLOCK_SetMux(kCLOCK_Flexspi2Mux, 3);
#endif
I've configured the FlexSpi2 clock to be sourced identically as FlexSpi1 clock, but still crash.
What's unusual is that if leave my FlexSpi configuration alone except for changing the FlexSpi port in the FlexSpi configuration to PortB1, I am able to operate to my (FRAM) device in single SPI mode okay.
In the modified example code, I am only attempting to access one or the other device only, not both at the same time.
What step(s) might I be missing to successfully setup both FlexSPIA and FlexSPIB to operate one independent memory device each ? What clock-mux or other settings for the FlexSpi2 clock are missing, and in general what steps are needed to setup both FlexSPI A and FlexSpi B ? (I have started with the polling example but will migrate to the eDMA method).