Hello oeren5@ford.com.tr,
Well, the problem is caused by the OpenSDA because the firmware it has, can not erase the flash section that is used as Eeprom, paulvlase, can you please comment on this?
For now, the only workaround we have to still use the board and test your code that uses Eeprom in flash is to use the S323DS only for flashing the board. So, basically Simulink is going to generate the code, compile but instead of using the mounted disk to copy the .mot generated file, we are going to use the S32DS only to flash the board.
Now, S32 Design Studio IDE for Arm® based MCUs | NXP is an IDE based on Eclipse and is the tool that we are going to use in order to flash the S32K.
So once installed, we have to import a default project to use its settings for our flashing method.
1. Import project:
- Go to File -> New -> S32DS project from Example.
- Look after a project for your board, like S32K144_Project_Hello
2. Flash from file:
- In the icons menu just under Run press the Flash from file button

- Select the new imported project, Browse for the generated .elf/.mot from the Simulink folder, Make sure that in the Build the Debug_FLASH is selected and check the DIsable autobuild option.

- In the next tab, Debugger select the OpenSDA as Interface and check to see in the Port that the tool recognizes the Open SDA on the board. If you need a full Erase, please select the Emergency Kinetis Device Recovery by Full Chip Erase.

- Next tab, Startup should look like this, so now you can press the Flash button.

- The board will be flashed and you will get a similar output:

Hope this helps,
Marius