-
Notifications
You must be signed in to change notification settings - Fork 27
Description
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.
mbed-os/targets/TARGET_STM/ospi_api.c
Lines 331 to 335 in 9048a88
| #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.