Skip to content

OSPI API code should not contain conditional compilation for the MX25LM51245G #498

@wdx04

Description

@wdx04

In the current implementation of the ST OSPI API, There is a conditional compilation used to determine the type of the OCTOSPI memory. The model MX25LM51245G is set as MACRONIX type, while all other models are treated as MICRON type. This is obviously wrong. MACRONIX also produces other OCTOSPI memory chips, and in addition to MACRONIX and MICRON, there are other OCTOSPI memory manufacturers and memory types, including HyperFlash and HyperRAM. We may need to treat the memory type as an initialization parameter.

#if defined(TARGET_MX25LM51245G)
obj->handle.Init.MemoryType = HAL_OSPI_MEMTYPE_MACRONIX; // Read sequence in DTR mode: D1-D0-D3-D2
#else
obj->handle.Init.MemoryType = HAL_OSPI_MEMTYPE_MICRON; // Read sequence in DTR mode: D0-D1-D2-D3
#endif

Also, in the COMPONENT_OSPIF/include/OSPIF folder, there are configuration headers for MX25LM51245G and MX25LW51245G models. These files may also need to be removed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions