*******************************************************************************
The purpose of this demo application is to present a usage of the
MEM_InFls MCAL Driver for the S32K3x1 MCU.
The example uses MEM_InFls driver to write 128 bytes to FLASH memory address 0x47_A000 starting of FLS_CODE_ARRAY_0_BLOCK_0_S61.
------------------------------------------------------------------------------
* MCU: S32K310
* Compiler: S32DS3.5
* SDK release: RTD 3.0.0
* Debugger: PE micro
* Target: internal_FLASH
********************************************************************************
Flash end address = 0x480000
Size of each block = 8192 = 0x2000
Start Address of 63 block = 0x480000 - 0x2000 = 0x47E000 = 4710400
Start Address of 62 block = 0x480000 - 0x4000 = 0x47C000 = 4702208
Start Address of 61 block = 0x480000 - 0x6000 = 0x47A000 = 4694016
Ram location where FLASH writing erase code is placed :--
I placed the code at 0x256 byte below the MAX address of the RAM size
16*1024 = 16384 = 0x4000
End of RAM = 0x20400000 + 0x4000 = 0x20404000
0x20404000 - 0x256 = 0x20403DAA
0x20403DAA = 541081002
Size of RAM need to save the flashing routine, as per the MAP & linker file :--
0x00407b80 - 0x00407b54 = 0x2C = 44 byte
S32K3 FLASH Memory Terminology :--