AnsweredAssumed Answered

FLEXSPI quad spi flash issue for two devices on bus A (iMX.RT1050)

Question asked by Ed Waldner on Aug 21, 2018

Has anyone tried to control multiple quad spi flash devices on a single Flexspi bus? I took the flexspi_nor_polling_transfer SDK demo project and extended it to access two devices on flexspi bus A, however I'm running into device selection issues. I am using these two flash devices

   IS25WP064 device ID 0x16 configured on port A2 and

   IS25LP256D device ID 0x18 configured on port A1

 

The original demo sets up flash config for the device connecting to Port A1, reads the vendor ID, sets the device to operate in quad mode, erases a sample sector with erase verify and programs a sample page with program verify. 

 

My first goal was to read vendor ID from both devices successively before any erase/program activity. The problem I believe comes with the FLEXSPI_SetFlashConfig() call where the flash ctrl regs for the selected port are configured. I called this routine for port A1 and for port A2, followed by vendor ID readings for device on A1 and device on A2. This sequence returned the vendor ID for the device on A2 twice. 

 

I tried the setup for port A1 and device read for port A1 followed by setup for port A2 and device read for port A2. This returned the correct vendor IDs for each device, however this leaves my demo addressing port A2 since a third vendor device ID readback for A1 gives the device ID for A2. 

 

I looked at the FLEXSPI_SetFlashConfig() routine and noticed that the size setting in FLSHxCR0 is a bit strange:

 

void FLEXSPI_SetFlashConfig(FLEXSPI_Type *base, flexspi_device_config_t *config, flexspi_port_t port){    uint32_t configValue = 0;    uint8_t index = port >> 1; /* PortA with index 0, PortB with index 1. */     /* Wait for bus idle before change flash configuration. */    while (!FLEXSPI_GetBusIdleStatus(base))     {    }     /* Configure flash size. */// ew2018-0820 -- possible boo boo??? -- how would this allow for multiple sizes on one bus?    base->FLSHCR0[index] = 0;//    base->FLSHCR0[port] = 0;    base->FLSHCR0[port] = config->flashSize;

however changes to this routine have not resolved the issue. I did not get a clear description from the resource manual regarding the config for this register.

 

Has anyone run into these types of issues, and if so, are there any better workarounds instead of calling SetFlashConfig() before accessing each device, for every access?

Outcomes