Flexspi1 and Flexspi2 is not working simultaneously in imxrt1176

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

Flexspi1 and Flexspi2 is not working simultaneously in imxrt1176

1,263 Views
VineeshM
Contributor II

In our configuration utilizing the IMXRT1176 controller,
we utilize both FlexSPI1 and FlexSPI2 simultaneously. 
FlexSPI1, linked to flash1 port A1, serves as the repository for code 
execution without XIP, while FlexSPI2, associated with flash2 port A1, 
stores user data, with the Segger file system enabled.

 

The issue arises when attempting to access FlexSPI1 using ROMAPI
or custom APIs after initializing the file system in FlexSPI2. 
Strikingly, without initialization of FlexSPI2, ROMAPI functions as expected. 
However, upon initializing the file system in FlexSPI2, access to FlexSPI1 becomes disrupted, 
hindering subsequent operations. This unexpected behavior complicates the intended 
functionality of our system and necessitates further investigation to 
ensure seamless operation of both FlexSPI interfaces.

Tags (2)
0 Kudos
Reply
2 Replies

1,160 Views
VineeshM
Contributor II

Following an in-depth analysis, it has been clarified that the challenge does not stem from the simultaneous operation of FlexSPI1 and FlexSPI2. The system utilizes non-XIP mode for the bootloader, with FlexSPI1 allocated for storing code to the flash memory. According to documentation, in non-XIP mode, all code is copied to the ITCM RAM before program execution, indicating that FlexSPI1 is no longer in use after this code transfer process. Hence, there should be no conflict in utilizing FlexSPI1 for flash storage purposes.

However, upon integration with an operating system (OS), specifically when executing ROM API/M-Flash/FlexSPI NOR flash operations from the thread context, an issue arises. The program consistently halts at flexspi_nor_wait_bus_busy(base);, indicating a perpetual bus busy state.

Further investigation is required to understand why the operation fails specifically under OS context, whereas it performs as expected without an OS. Identifying and resolving this discrepancy is pivotal for ensuring seamless functionality within the intended operating environment.

Additionally, referencing document "AN12238.pdf," it is noted that the code is expected to copy all the application code to the ITCM RAM. This behavior aligns with the system's configuration and provides crucial insight into the issue at hand.

0 Kudos
Reply

1,261 Views
VineeshM
Contributor II

After configuring flexspi2 using the following SEGGER APIs:

/* Initialize file system */
FS_Init();
FS_FAT_SupportLFN();

I am trying to call:

ROM_API_Init();

/* Clean up FLEXSPI NOR flash driver Structure */
memset(&norConfig, 0U, sizeof(flexspi_nor_config_t));

#if (__CORTEX_M == 7U)
/* Disable I cache */
SCB_DisableICache();
#endif

/* Setup FLEXSPI NOR Configuration Block */
status = ROM_FLEXSPI_NorFlash_GetConfig(FlexSpiInstance, &norConfig, &option);
if (status == kStatus_Success)
{
TRACE_INFO("\r\n Successfully get FLEXSPI NOR configuration block\r\n ");
}
else
{
TRACE_INFO("\r\n Get FLEXSPI NOR configuration block failure!\r\n");
error_trap();
}

but somehow execution is hanging in ROM_FLEXSPI_NorFlash_GetConfig.

0 Kudos
Reply