Attached the final code with all modifications
2.9.4 Corruption of data read from the FMC Description
When the FMC is used as stack, heap or variable data, an interrupt occurring during a CPU read access to the FMC may results in read data corruption or hard fault exception. This problem does not occur when read accesses are performed by another master or when FMC accesses are done when the interrupts are disabled.
WorkaroundTwo workarounds can be applied:
Do not use the FMC as stack or heap, and make sure CPU read accesses to the FMC are performed while interrupts are disabled
Use only DMAs to perform read accesses to the FMC. This limitation is present only in revision “A” devices. It is fixed in revision “Y”, “1” and “3”.
Retrieving data ...