zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.67k stars 6.52k forks source link

stm32 octospi flash driver #48175

Closed aradenac closed 2 years ago

aradenac commented 2 years ago

Describe the bug Hello, in Zephyr v3.1.0 the sample zephyr/samples/drivers/spi_flash was working fine on b_u585i_iot02a board (MX25LM51245 octospi flash), providing the following output: image

But in the current main Zephyr version (commit 5432cac806b4e479a2da55afa30ead927eef3e2b) the sample program seems to be broken. This is the sample new output: image

While debugging I found out that the flash driver flash_stm32_ospi.c was failing in the function stm32_ospi_config_mem at driver initialization: image

Is there a known reason for this regression (a work in progress maybe) ?

Note: In b_u585i_iot02a-common.dtsi changing OSPI_OSPI_MODE to OSPI_SPI_MODE for the "mx25lm51245" node allows the sample to work.

galak commented 2 years ago

This could be because of device init ordering. Worth checking the priorities of the flash device, ospi driver, etc to make sure the init ordering is happening correctly.

fabiobaltieri commented 2 years ago

cc @erwango

erwango commented 2 years ago

Duplicate of https://github.com/zephyrproject-rtos/zephyr/issues/46740 Should be fixed by https://github.com/zephyrproject-rtos/zephyr/pull/46794.