Skip to content

flash: stm32_ospi: weak callbacks cannot be used by multiple octospi drivers #84647

@721082

Description

@721082

Is your enhancement proposal related to a problem? Please describe.
On the stm32u5a9xx, if we want to use octospi1 for the zephyr/drivers/flash/flash_stm32_ospi.c and octospi2 for a display we cannot use HAL_OSPI_IRQHandler() in the octospi2 isr because some weak functions are defined in the flash driver, like HAL_OSPI_TxCpltCallback() and they would be called on octospi2 interrupts.

Describe the solution you'd like
1/ I would like to be able to call HAL_OSPI_IRQHandler() in the display driver isr because it contains a bit of logic. To do so, I think it should be possible in stm32cube hal to use callbacks instead of weak functions but it requires to enable it directly in stm32u5xx_hal_conf.h as it's not configurable using Kconfig.

Describe alternatives you've considered
2/ An alternative would be to copy paste the HAL_OSPI_IRQHandler() function into the display driver.
3/ A second alternative would be to implement a octospi driver for st,stm32-ospi and move into it the octospi related part from the flash and display drivers. Then in this driver we should be able to define the weak callbacks.

Additional context

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions