cancel
Showing results for 
Search instead for 
Did you mean: 

How to use Hyperflash/Hyperbus with STM32H562

J_Kirsch
Associate

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:

J_Kirsch_1-1732704012873.png

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

3 REPLIES 3
SofLit
ST Employee

Hello @J_Kirsch and welcome to the comunity,

Please use </> button to paste your code instead of posting screenshots of it.

SofLit_0-1732706286710.png

You can review our tips on posting a thread in this community.

Thank you

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello,

I have changed my original post accordingly.

KDJEM.1
ST Employee

Hello @J_Kirsch

 

Which OCTOSPI frequency are you used?

Try to decrease the OCTOSPI clock frequency and to enable the delay block.

Make sure that the output speed is set to "very high" for all the GPIOs.

 

Thank you.

Kaouthar

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.