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 ?