2025-02-26 1:06 PM
Hi,
I am running my Zephyr application from an OSPI external flash and would like to write to the same flash. The MCU is an STM32H723, and the flash is an IS25LP128.
However, the flash_stm32_ospi_write method in zephyr/drivers/flash/flash_stm32_ospi.c causes my application to hang. The issue seems to be that the relevant semaphores are not initialized in the flash_stm32_ospi_init function.
To address this, I added the following two lines to flash_stm32_ospi_init:
k_sem_init(&dev_data->sem, 1, 1);
k_sem_init(&dev_data->sync, 0, 1);
After this modification, I am having problems in aborting the ongoing memory-mapped operation.
Could anyone provide guidance on properly handling flash write in XIP mode. Any pointers or suggestions would be greatly appreciated!
Thanks.
2025-02-27 2:26 AM
Hello @karsparskambala,
The STM32H723 supports both read and write operations in memory-mapped mode, but not simultaneously. This means you cannot perform write operations while the flash is being accessed for execution in memory-mapped mode
I suggest you to program the external memory from the internal flash. So you will XIP from external memory, then jump to internal flash in order to program the external memory then jump back to XIP
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.