Post Go back to editing

Assistance Needed to access IS25LX256 on SC595SOM , with OSPI Driver Issue in DTR Mode.

Category: Software
Product Number: ADSP-SC594

Dear ADI Engineering Zone Team,

I hope this message finds you well. We are currently working with the SC594 SOM and facing an issue while trying to access the IS25LX256 flash on a FreeRTOS environment using the OSPI driver. By default the flash is in STR mode and we are able to successfully configure it to DTR mode . Specifically, we are encountering difficulties when attempting to read the flash ID information in DTR mode.

Below is stig structure  we are using to access the flash in DTR mode:

STIG_Command.CmdOpcode         = CMD_JEDEC_READ;
STIG_Command.CmdOpcode2        = 0x00;
STIG_Command.eBusMode          = ADI_OSPI_STIG_OPI;
STIG_Command.eTransferMode     = ADI_OSPI_TRANSFERMODE_DTR;
STIG_Command.NumOfDummyCycles  = 8;
STIG_Command.ModeDataEnable    = 0;
STIG_Command.ModeData          = 0;
STIG_Command.eDataMode         = ADI_OSPI_STIG_READDATA_EN;
STIG_Command.DataSize          = 6;
STIG_Command.AddressEnable     = 1;
STIG_Command.AddrSize          = ADI_OSPI_CMD_ADDR_SIZE_4;
STIG_Command.Address           = 0;
STIG_Command.pBuffer           = deviceIDData;
status = adi_ospi_StigCommand(*phDevice, &STIG_Command);

We are experiencing a runtime error when attempting to read the flash IDs in DTR mode. Attached is a screenshot of the error message for your reference.

Could you please provide guidance on how to properly perform read and write operations on the flash when it is configured in DTR mode? If there is any additional information you require from our end to assist with troubleshooting, please let us know.

Thank you for your attention to this matter, and we look forward to your guidance.



Focusing on the DTR issue.
[edited by: sohm at 12:58 PM (GMT -4) on 6 May 2024]

Thread Notes

  • Hi Soumya,

    Thank you for your query. Can you please share your sample code which simulates this issue to us.

    Did you check whether you are able to read the flash ID in DTR mode configuration with non-RTOS environment.

    Waiting for your reply.

    Best Regards,
    Santhakumari.K

  • Hi  ,

    Thanks for your reply. As you asked, I have attached the sample code where we are trying to configure the IO Mode register in octal DDR mode and we are trying to read back the same register. For your information after configuring IO mode register to octal DDR mode we are not able to read the device information in STR mode , which means writing to the IO register is getting successfully updated. As soon as we are trying to read back either IO mode register or device information in octal Mode (STIG_Command.eBusMode   = ADI_OSPI_STIG_OPI; ) we are facing this runtime issue.

    We are checking form our end to read the flash ID in DTR mode configuration with non-RTOS environment. Mean while if you can go through the sample code and give us some suggestions will be helpful. Please let us know if you need any other information.

    Thank You.

    .

    flash_configDTRMode
    {
    	BaseType_t xReturn;
    
    	uint8_t StatusBuffer[2] = {0};
    	uint8_t data			= 0xE7;
    
    	ADI_OSPI_STIGCMD STIG_Command;
    
    	/* Performing write enable operation */
    
    	STIG_Command.CmdOpcode       		= FLASH_WR_EN;
    	STIG_Command.CmdOpcode2      		= 0;
    	STIG_Command.eBusMode        		= ADI_OSPI_STIG_SINGLE;
    	STIG_Command.eTransferMode   		= ADI_OSPI_TRANSFERMODE_STR;
    	STIG_Command.NumOfDummyCycles		= 0;
    	STIG_Command.ModeDataEnable  		= 0;
    	STIG_Command.ModeData		   	= 0;
    	STIG_Command.eDataMode	   		= ADI_OSPI_STIG_NODATA;
    	STIG_Command.DataSize		   	= 1;
    	STIG_Command.AddressEnable   		= 0;
    	STIG_Command.AddrSize		   	= ADI_OSPI_CMD_ADDR_SIZE_1;
    	STIG_Command.Address         		= 0;
    	STIG_Command.pBuffer         		= 0;
    
    	xReturn = adi_ospi_StigCommand(*phDevice, &STIG_Command);
    	if(xReturn != ADI_OSPI_SUCCESS)
    	{
    		DebugP_log("Failed to send the WREN command to flash. Error: %d \n", xReturn);
    		return xReturn;
    	}
    
    	/* Reading the Status register and checking for the WIP bit wherther the flash is in ready state of in busy state */
    
    	FlashBusyWait(*phDevice);
    
    	STIG_Command.CmdOpcode       		= 0x81;		//Writing Non volatile Register		
    	STIG_Command.CmdOpcode2      		= 0x00;
    	STIG_Command.eBusMode        		= ADI_OSPI_STIG_SINGLE;
    	STIG_Command.eTransferMode   		= ADI_OSPI_TRANSFERMODE_STR;
    	STIG_Command.NumOfDummyCycles		= 0;
    	STIG_Command.ModeDataEnable  		= 0;
    	STIG_Command.ModeData		   	= 0;
    	STIG_Command.eDataMode	   		= ADI_OSPI_STIG_WRITEDATA_EN;
    	STIG_Command.DataSize		   	= 1;
    	STIG_Command.AddressEnable   		= 1;
    	STIG_Command.AddrSize		   	= ADI_OSPI_CMD_ADDR_SIZE_4;
    	STIG_Command.Address         		= 0x00;		//IO mode configguration Register
    	STIG_Command.pBuffer         		= &data;	//Writing Value 0xE7 to configure for DDR mode
    
    	xReturn = adi_ospi_StigCommand(*phDevice, &STIG_Command);
    	if (xReturn != ADI_OSPI_SUCCESS)
    	{
    		printf ("Failed Stig command write REG. Error: %d\r\n",xReturn);
    	}
    
    
    	printf ("Writing is Done\r\n");
    
    	
    	printf ("Reading Register in DTR Mode\r\n");
    
    	STIG_Command.CmdOpcode       		= READ_VOLATILE_CONFIG_REG;	//0xB5;	//Reading volatile Reg
    	STIG_Command.CmdOpcode2      		= 0x00;
    	STIG_Command.eBusMode        		= ADI_OSPI_STIG_OPI;		// Octal Mode
    	STIG_Command.eTransferMode   		= ADI_OSPI_TRANSFERMODE_DTR_P;	
    	STIG_Command.NumOfDummyCycles		= 8;
    	STIG_Command.ModeDataEnable  		= 0;
    	STIG_Command.ModeData		   	= 0;
    	STIG_Command.eDataMode	   		= ADI_OSPI_STIG_READDATA_EN;	
    	STIG_Command.DataSize		   	= 1;
    	STIG_Command.AddressEnable   		= 1;
    	STIG_Command.AddrSize		   	= ADI_OSPI_CMD_ADDR_SIZE_4;
    	STIG_Command.Address         		= 0x00;				//IO mode configguration Register
    	STIG_Command.pBuffer         		= StatusBuffer;
    
    	xReturn = adi_ospi_StigCommand(*phDevice, &STIG_Command);
    
    	if (xReturn != ADI_OSPI_SUCCESS)
    	{
    		printf ("Failed Stig command read REG\r\n");
    	}
    
    	printf ("The register: 0x%x\r\n", StatusBuffer[0]);
    	printf ("The register: 0x%x\r\n", StatusBuffer[1]);
    
    
    
    
    	return xReturn;
    }

  • Hi  ,

    As suggested we checked reading  the flash ID in DTR mode configuration with non-RTOS environment but here also we are facing the same run time issue as mentioned above .

    We are waiting for your reply . Thank You. 

  • As mentioned in the IS25LX256 datasheet cmdopcode2 must be repeated of cmdopcode (For Octal DDR Mode), datasheet screenshot below.

    Modify the code like below,

    STIG_Command.CmdOpcode         = CMD_JEDEC_READ;
    STIG_Command.CmdOpcode2        = CMD_JEDEC_READ;
    STIG_Command.eBusMode          = ADI_OSPI_STIG_OPI;
    STIG_Command.eTransferMode     = ADI_OSPI_TRANSFERMODE_DTR;
    STIG_Command.NumOfDummyCycles  = 8;
    STIG_Command.ModeDataEnable    = 0;
    STIG_Command.ModeData          = 0;
    STIG_Command.eDataMode         = ADI_OSPI_STIG_READDATA_EN;
    STIG_Command.DataSize          = 6;
    STIG_Command.AddressEnable     = 1;
    STIG_Command.AddrSize          = ADI_OSPI_CMD_ADDR_SIZE_4;
    STIG_Command.Address           = 0;
    STIG_Command.pBuffer           = deviceIDData;
    status = adi_ospi_StigCommand(*phDevice, &STIG_Command);
    Thanks,
    Vignesh N
  • Hi  ,

    Thank you for your reply. As you mentioned, we tried reading the device information with the above configuration but still We are seeing the same run time error. 

  • When I look at your code, it seems like you are writing into the Flash Volatile register to configure the Flash in Octal DTR Mode. If remember there is a problem with IS25LX256 Volatile register. Use one of your board and configure the Flash in Octal Mode using Non-Volatile Config register, power cycle the board and read JEDEC ID in Octal DDR Mode.

    By this if you can confirm either the problem is on Flash or OSPI Controller, this would help us to proceed the debug further.

    Thanks,

    Vignesh N