STM32U5 NOR Flash: Data Not Found After Reset
I am currently developing on a custom board based on the STM32U5 microcontroller with the MX25UM512 NOR flash memory. I am following the example provided by the STM32CubeU5 SDK. The example works correctly when I first run it (so data is written correctly), but after I reset the board, the code does not pass through the "if" condition as explained by the comments.
nor_ospi_status = fx_file_create(&nor_ospi_flash_disk, "STM32.TXT");
/* Check the create nor_xspi_status. */
if (nor_xspi_status != FX_SUCCESS)
{
/* Check for an already created nor_xspi_status. This is expected on the
second pass of this loop! */
if (nor_xspi_status != FX_ALREADY_CREATED)
{
/* Create error, call error handler. */
Error_Handler();
}
}
I have already ensured that the memory is not formatted at every time: I have disabled the defines LX_STM32_OSPI_INIT and LX_STM32_OSPI_ERASE. Additionally, if I skip the fx_file_create operation during the second run, the fx_file_open function returns FX_NOT_FOUND.
I am not sure why this is happening. I would appreciate any help you can provide.
