Skip to content

OSPI support for STM32H7 targets #15409

@wdx04

Description

@wdx04

Currently OSPI is only supported by a few STM32L4+, STM32L5 and STM32U5 targets.
Support for STM32H7 targets, such as STM32H7Ax/Bx/2x/3x are missing.

Only a few changes are needed to add OSPI support to STM32H7 targets.

1.In mbed-os/targets/TARGET_STM/ospi_api.c and mbed-os/targets/TARGET_STM/qspi_api.c
find the following line:
__HAL_RCC_OSPIM_CLK_ENABLE();
and change it to:
#if defined(TARGET_STM32H7)
__HAL_RCC_OCTOSPIM_CLK_ENABLE();
#else
__HAL_RCC_OSPIM_CLK_ENABLE();
#endif

2.in mbed-os/targets/TARGET_STM/TARGET_STM32H7/objects.h
modify the definition of struct qspi_s and add the struct ospi_s:
#if DEVICE_QSPI
struct qspi_s {
#if defined(OCTOSPI1)
OSPI_HandleTypeDef handle;
#else
QSPI_HandleTypeDef handle;
#endif
QSPIName qspi;
PinName io0;
PinName io1;
PinName io2;
PinName io3;
PinName sclk;
PinName ssel;
};
#endif

#if DEVICE_OSPI
struct ospi_s {
OSPI_HandleTypeDef handle;
OSPIName ospi;
PinName io0;
PinName io1;
PinName io2;
PinName io3;
PinName io4;
PinName io5;
PinName io6;
PinName io7;
PinName sclk;
PinName ssel;
PinName dqs;
};
#endif

I have tested the code with a custom STM32H7B0VB board which has a W25Q64 QSPI flash.
Please consider applying the changes to the next release.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions