Hi,
I am testing the memory overlay functionality for the S32K396. I have established the relationship between Mirrored Flash and RAM by using OMU.
- Modify the value of RAM and the value of mirror flash is also changed.
- When I read the original flash value, it still remains unchanged(The value of the mirror flash changes and should be read through the original flash.)
#define EXAMPLE_SECTOR_4_ADDR (0x00400000U)
const uint32_t *Array4 = (uint32_t *)0x400000;
const uint32_t *Array4mirror = (uint32_t *)0x8400000;
uint32_t Value4 = 0;
uint32_t Value4mirror = 0;
......
for(i = 0; i<OMU_NUM_BYTES; i++)
{
omu_flash_program_5data[i] = 5;
}
Flash_WriteFun(Example_MemInstanceId, EXAMPLE_SECTOR_4_ADDR,omu_flash_program_5data, OMU_NUM_BYTES);
......
Value4 = Array4[10];
Value4mirror = Array4mirror[10];
......
OMU INIT and OMU Enable
......
Value4 = Array4[10];
Value4mirror = Array4mirror[10];

- How to correctly read the changed value of Mirrored Flash through the Origin Flash address?
- How to implement the request to read the original flash, S32K396 automatically reads the variable value on the ram address through OMU mapping?
Regards!