cancel
Showing results for 
Search instead for 
Did you mean: 

Issue Accessing ISSI Flash (IS25WX256) on STM32U5A9J-DK – Incorrect Device ID or Timeout

sohm
Associate III

Hello STM Community,

I'm working on integrating an ISSI IS25WX256 flash memory with the STM32U5A9J-DK board. I've followed the configuration steps outlined in this [link] (https://community.st.com/t5/stm32-mcus/how-to-set-up-the-ospi-peripheral-to-interface-with-the/ta-p/49474) to set up the OSPI interface for the ISSI flash. Despite this, I’m encountering two main issues:

  1. Incorrect Device ID: When reading the flash device ID, I am not getting the expected values. Instead, I get incorrect data, often 0x00 .
  2. Timeouts in HAL_OSPI_Receive: Occasionally, the application gets stuck at OSPI_WaitFlagStateUntilTimeout within HAL_OSPI_Receive.

Here’s a screenshot of my OSPI configuration settings in STM32CubeMX (attach screenshot).

OSPI_Config.png

 

 

 

void OSPI_Read_DeviceID(void)
{


	OSPI_RegularCmdTypeDef sCommand;
	uint8_t deviceID[6] = {0};  // Buffer to store the Device ID
	char uartBuffer[100];    // Buffer to store the formatted string
	// Configure the command to read the JEDEC ID (RDID)
	sCommand.OperationType      = HAL_OSPI_OPTYPE_COMMON_CFG;
	sCommand.FlashId            = HAL_OSPI_FLASH_ID_1;
	sCommand.Instruction        = 0x9F;  // JEDEC Read ID command (1-byte)
	sCommand.InstructionMode    = HAL_OSPI_INSTRUCTION_1_LINE;  // Instruction on 1 line
	sCommand.InstructionSize    = HAL_OSPI_INSTRUCTION_8_BITS;  // Instruction is 1-byte (8 bits)
	sCommand.AddressMode        = HAL_OSPI_ADDRESS_NONE;  // No address phase
	sCommand.AlternateBytesMode = HAL_OSPI_ALTERNATE_BYTES_NONE;
	sCommand.DataMode           = HAL_OSPI_DATA_1_LINE;  // Data on 1 line (single line mode)
	sCommand.NbData             = DEVICE_ID_SIZE;         // Read 6 bytes (Manufacturer + Device ID)
	sCommand.DummyCycles        = 0;                      // 0 dummy cycles (adjust as per datasheet)
	sCommand.DQSMode            = HAL_OSPI_DQS_DISABLE;
	sCommand.SIOOMode           = HAL_OSPI_SIOO_INST_EVERY_CMD;
	sCommand.AddressDtrMode 	= HAL_OSPI_ADDRESS_DTR_DISABLE;
	sCommand.DataDtrMode 	= HAL_OSPI_DATA_DTR_DISABLE;


	// Send the command and receive the Device ID
	if (HAL_OSPI_Command(&hospi1, &sCommand, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
	{
		// Command error
		Error_Handler();
	}

	if (HAL_OSPI_Receive(&hospi1, deviceID, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
	{
		// Receive error
		Error_Handler();
	}


	// Store the formatted string in uartBuffer
	sprintf(uartBuffer, "Flash Device ID: 0x%02X 0x%02X 0x%02X\n\r", deviceID[0], deviceID[1], deviceID[2]);

	// Transmit the uartBuffer via UART
	HAL_UART_Transmit(&huart1, (uint8_t *)uartBuffer, strlen(uartBuffer), HAL_MAX_DELAY);

}

 

 

Any insights on what could be causing the incorrect Device ID readings or timeouts? I’d appreciate suggestions on additional settings or changes to the read sequence that may help resolve this issue.

 

 

Thank You in advance.

 

3 REPLIES 3

Perhaps this is a hardware/electrical issue.

Have you built two or three, or just the one?

Do you have access to an X-Ray inspection system? So you can check for issues in the soldering.

Does your code work reliably with the MX25UM51245GXDI00 ?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi @Tesla DeLorean 

 

Thank you for your quick reply!

We have built only one board so far. The same code was tested with the Macronix MX25UM51245GXDI00 flash, and we were able to read the device IDs successfully. Could you please confirm if my configuration for the ISSI IS25WX256 is correct, or if there is any specific sequence required in my code for(reading the device IDs) integrating ISSI flash with the STM32U5A9J-DK board that I might have missed?

 

Perhaps this is a hardware/electrical issue.

We probed the  clock and chip select, While getting stuck inside the HAL_OSPI_Receive during OSPI_WaitFlagStateUntilTimeout   the chip select is continuously low and clocks is seen as configured. It might be some configuration issue with the OSPI or the command configuration there is no activity on the data line DQ0.

Has anyone successfully used this combination (STM32U5A9J-DK + IS25WX256)? or any other STM32 + ISSI flash  Any additional suggestions would be highly appreciated!

Around here we'd probably mount a BGA24 ZIF on a NUCLEO-144 to test things.

Build more than one thing, etc.

If you just stick in 1-bit modes the memory devices should be predictable and consistent.

The Micron vs Macronix modes mostly relate to the DDR methods.

Perhaps the delays / clock edge settings

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..