2024-11-04 07:20 AM
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:
Here’s a screenshot of my OSPI configuration settings in STM32CubeMX (attach screenshot).
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.
2024-11-04 08:09 AM
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 ?
2024-11-05 01:58 AM - edited 2024-11-05 02:03 AM
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!
2024-11-05 06:13 AM
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