2024-11-27 02:46 AM - edited 2024-11-27 04:09 AM
Hello,
I am trying to use infineons S26KL128SDABHI020 HYPERFLASH memory with a STM32H562VI microcontroller.
For now I am just trying to do a simple write and read manually to make sure that everything is working.
I use the OCTOSPI module with Hyperbus-mode and execute the following in the main-function.
/* USER CODE BEGIN 2 */
uint8_t data_storage[125] = {0};
uint8_t receive_storage[125] = {0};
HAL_StatusTypeDef ret;
XSPI_HyperbusCmdTypeDef command;
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
data_storage[0] = 0xAA;
data_storage[1] = 0x0;
data_storage[2] = 0xFB;
data_storage[3] = 0x0;
command.DQSMode = HAL_XSPI_DQS_ENABLE; //HAL_XSPI_DQS_DISABLE //HAL_XSPI_DQS_ENABLE
command.AddressSpace = HAL_XSPI_MEMORY_ADDRESS_SPACE; //HAL_XSPI_MEMORY_ADDRESS_SPACE; //HAL_XSPI_REGISTER_ADDRESS_SPACE
command.AddressWidth = HAL_XSPI_ADDRESS_32_BITS;
command.Address = (0x00000000); //maximum 0x001FFFFF - DataLength
command.DataLength = 4;
HAL_XSPI_HyperbusCmd(&hospi1, &command, 1000);
ret = HAL_XSPI_Transmit(&hospi1, &data_storage[0], 1000);
// HAL_Delay(1);
HAL_XSPI_HyperbusCmd(&hospi1, &command, 1000);
ret = HAL_XSPI_Receive(&hospi1, &receive_storage[0], 1000);
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
But all that happens is the following:
In the first phase you see the transmit happening. But then after the receive command the controller just endlessly runs the clock because there is no response from the Hyperflash.
What am I doing wrong?
I also attached my main.c file with the MX_GPIO_Init()-function in line 1119 if needed...
Thanks and best regards,
Johann
2024-11-27 03:18 AM
Hello @J_Kirsch and welcome to the comunity,
Please use </> button to paste your code instead of posting screenshots of it.
You can review our tips on posting a thread in this community.
Thank you