2022-01-21 06:15 AM
We are using STM32Cube_FW_H7 latest version and faced the similar problem happened on STM32Cube_FW_L4 which is discussed here. We use two Octo SPI with one running in Octo memory mapped mode and one running in Quad SPI direct mode.
Firstly, we configured the Octo mode IO ports with HAL_OSPIM_Config and then configured the Quad SPI. If we configure Octo only, the Octo memory mapped mode works well. However, If we configure Quad SPI as well, the first Octo configuration got corrupted.
Does someone face the same problem? I suspect that the similar bug exists in Cube_FW_H7 like the one in STM32Cube_FW_L4.
Solved! Go to Solution.
2022-02-09 01:50 AM
Hello Yoshitaka,
I am still trying to reproduce the issue you reported.
I will keep you updated.
Chahinez.
2022-02-09 02:59 AM
Hello Chahinez,
We appreciate your continuous effort to reproduce our problem. Please do not hesitate to ask us if you need further information.
Yoshitaka
2022-02-15 01:22 AM
Hello @YTagu.1;
I am getting back to you regarding the problem you faced. I have reproduced the issue and reported it internally to our team.
Thank you for highlighting the matter and helping us improve.
Chahinez.
2022-02-15 06:30 AM
Hi @ChahinezC ,
We're very glad to hear that you could reproduce our problem.
I'd like to ask a few more questions:
Yoshitaka.
2022-02-16 04:02 AM
Hello @YTagu.1,
Chahinez.
2022-02-16 05:46 PM
Hi @ChahinezC ,
Thank you for your answer. We're looking forward to hearing updates from you.
Yoshitaka
2022-05-23 10:31 PM
Hi @ChahinezC,
Is there any option to get paid support, not the community-based free support for this problem?
In our product development, this remains a serious problem. If paid support is possible, we're willing to use it.
2022-08-08 01:09 AM
Hello @ChahinezC ,
I had the same problem. Only when OctoSPI2 was init FLASH was working. Only when OctoSPI1 was init SRAM was working. When OctoSPI1 was inited after OctoSPI2, only OctoSPI1(SRAM ) worked. It broke OctoSPI2's operation. Both worked when I didn't configure(HAL_OSPIM_Config) the OctoSPI2 port. I don't understand how OctoSPI1 works without configuring NCS, Clock and IOLowPort. I think it may have worked because the pins are configured in MsbInit.
OctoSPI2 Not Working, OctoSPI1 working
--------------------------------------------------------------------
/* OCTOSPI1 init function */
void MX_OCTOSPI1_Init(void)
{
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};
hospi1.Instance = OCTOSPI1;
hospi1.Init.FifoThreshold = 1;
hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi1.Init.DeviceSize = 18;
hospi1.Init.ChipSelectHighTime = 1;
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi1.Init.ClockPrescaler = 3;
hospi1.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_HALFCYCLE;
hospi1.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi1.Init.ChipSelectBoundary = 0;
hospi1.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
if (HAL_OSPI_Init(&hospi1) != HAL_OK)
{
Error_Handler();
}
OSPIM_Cfg_Struct.ClkPort = 1;
OSPIM_Cfg_Struct.NCSPort = 1;
OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
if (HAL_OSPIM_Config(&hospi1, &OSPIM_Cfg_Struct, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
}
/* OCTOSPI2 init function */
void MX_OCTOSPI2_Init(void)
{
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};
hospi2.Instance = OCTOSPI2;
hospi2.Init.FifoThreshold = 4;
hospi2.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi2.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi2.Init.DeviceSize = 25;
hospi2.Init.ChipSelectHighTime = 2;
hospi2.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi2.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi2.Init.ClockPrescaler = 1;
hospi2.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
hospi2.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi2.Init.ChipSelectBoundary = 0;
hospi2.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
if (HAL_OSPI_Init(&hospi2) != HAL_OK)
{
Error_Handler();
}
OSPIM_Cfg_Struct.ClkPort = 2;
OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_2_LOW;
OSPIM_Cfg_Struct.NCSPort = 0;
if (HAL_OSPIM_Config(&hospi2, &OSPIM_Cfg_Struct, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
}
int main()
{
(...)
MX_OCTOSPI2_Init();
MX_OCTOSPI1_Init();
(...)
}
OctoSPI2 and OctoSPI1 are working.
-------------------------------------------------------------------------
/* OCTOSPI1 init function */
void MX_OCTOSPI1_Init(void)
{
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};
hospi1.Instance = OCTOSPI1;
hospi1.Init.FifoThreshold = 1;
hospi1.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi1.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi1.Init.DeviceSize = 18;
hospi1.Init.ChipSelectHighTime = 1;
hospi1.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi1.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi1.Init.ClockPrescaler = 3;
hospi1.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_HALFCYCLE;
hospi1.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi1.Init.ChipSelectBoundary = 0;
hospi1.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
if (HAL_OSPI_Init(&hospi1) != HAL_OK)
{
Error_Handler();
}
OSPIM_Cfg_Struct.ClkPort = 1;
OSPIM_Cfg_Struct.NCSPort = 1;
OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_1_LOW;
if (HAL_OSPIM_Config(&hospi1, &OSPIM_Cfg_Struct, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
}
/* OCTOSPI2 init function */
/* OCTOSPI2 init function */
void MX_OCTOSPI2_Init(void)
{
OSPIM_CfgTypeDef OSPIM_Cfg_Struct = {0};
hospi2.Instance = OCTOSPI2;
hospi2.Init.FifoThreshold = 4;
hospi2.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi2.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON;
hospi2.Init.DeviceSize = 25;
hospi2.Init.ChipSelectHighTime = 2;
hospi2.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi2.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi2.Init.ClockPrescaler = 1;
hospi2.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
hospi2.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_DISABLE;
hospi2.Init.ChipSelectBoundary = 0;
hospi2.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_BYPASSED;
if (HAL_OSPI_Init(&hospi2) != HAL_OK)
{
Error_Handler();
}
// OSPIM_Cfg_Struct.ClkPort = 2;
// OSPIM_Cfg_Struct.IOLowPort = HAL_OSPIM_IOPORT_2_LOW;
// if (HAL_OSPIM_Config(&hospi2, &OSPIM_Cfg_Struct, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
// {
// Error_Handler();
// }
}
int main()
{
(...)
MX_OCTOSPI2_Init();
MX_OCTOSPI1_Init();
(...)
}
I am configuring the project from CubeMx 6.0.1. OctoSPI2 CS pin is disabled. I control the cs pin with software. It seems that disabling the CS pin in the HAL_OSPIM_Config function is not taken into account. Is there a problem with the HAL_OSPIM_Config function? Or are we making a mistake somewhere?
Best regards.
2023-04-12 02:55 PM
I am using Cube FW 1.10.1 and seeing the same issue when using both OSPI1 and OSPI2.
Thanks. Any other inputs on this ?