cancel
Showing results for 
Search instead for 
Did you mean: 

Two instances of OCTOSPI not working simultaneously on STM32H7A3ZGT

ABricout
Associate III

Hello,

I am developing on the STM32H7A3ZGT and I am trying to use both OCTOSPI instances that are on the microcontroller

I am able to use both of them separately (only initialising one instance) but when I do both the initialization only the last initialised instance is working fine.

I get no errors codes from any function on the first octospi instance that is initialised, but the data that I receive are all "0".

If I switch the init order it switches the instance that is working.

I am working on cube MX V6.6.1 but I tried generating a new project on the latest version and I get the same result

Tank you for your help,

Best regards

Augustin

1 ACCEPTED SOLUTION

Accepted Solutions
KDJEM.1
ST Employee

Hi @ABric.1​ ,

To solve your problem try to change these code lines generated by CubeMx

sOspiManagerCfg.ClkPort = 1;
  sOspiManagerCfg.NCSPort = 1;
  sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
  if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    Error_Handler();
  }

 By these code lines

sOspiManagerCfg.ClkPort = 1;
sOspiManagerCfg.NCSPort = 1;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
sOspiManagerCfg.IOHighPort = HAL_OSPIM_IOPORT_1_HIGH;//////////////////////////////////////////////////////////////////
sOspiManagerCfg.DQSPort = 1; //////////////////////////////////////////////////////////////////
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    Error_Handler();
  }

This update should be applied for OCTOSPI1 and OCTOSPI2

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

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.

View solution in original post

3 REPLIES 3
KDJEM.1
ST Employee

Hello @ABric.1​ ,

I confirm the issue, when a project is generated with STM32CubeMX 6.8.0, the HAL_OSPIM_Config function is called within the initialization of the OCTOSPI instance and executing the OCTOSPIM config function in the second interface initialization overwrites all configuration for the first OSPI which causes the problem.

This issue is reported internally.

Internal ticket number: 133136 (This is an internal tracking number and is not accessible or usable by customers).

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

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.

KDJEM.1
ST Employee

Hi @ABric.1​ ,

To solve your problem try to change these code lines generated by CubeMx

sOspiManagerCfg.ClkPort = 1;
  sOspiManagerCfg.NCSPort = 1;
  sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
  if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    Error_Handler();
  }

 By these code lines

sOspiManagerCfg.ClkPort = 1;
sOspiManagerCfg.NCSPort = 1;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
sOspiManagerCfg.IOHighPort = HAL_OSPIM_IOPORT_1_HIGH;//////////////////////////////////////////////////////////////////
sOspiManagerCfg.DQSPort = 1; //////////////////////////////////////////////////////////////////
if (HAL_OSPIM_Config(&hospi1, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
  {
    Error_Handler();
  }

This update should be applied for OCTOSPI1 and OCTOSPI2

When your question is answered, please close this topic by choosing Select as Best. This will help other users find that answer faster.

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.

ABricout
Associate III

Thank you, it seems to be working

Have a nice day,

Augustin