This is Ozan. Currently I am using MBDT V4.2.0, FreeMaster 3.0 and Matlab/Simulink 2018a. I try to write a certain variable to non-volatile memory of S32 by using an example from toolbox. I changed a Memory_RW example a little bit and add Flash_EEERead, Flash_EEEWrite and Flash_Config boxes instead of data-write memory blocks. In the example each time SW2 button is pressed write_val incremented and read_val reads the new value. I want to use same logic and each time SW2 button is pressed write_val should be incremented but should be written to non-volatile memory via Flash_EEEWrite. I built the message with "Successful completion of build procedure for model" and no error pops up.
But when I try to observe the variables via Freemaster tool I received an error and after that the LED just above the openSDA port is constantly turned on to red LED and it is still on. After that I try to built different examples but I received same error each time and the red LED is on after the boards is powered. I guess that Freemaster can not find to board because it is in some kind of error mode.
I attach model, error, and board screenshots. What is the root cause of this problem and how can I solve it. Please let me know if further details are needed.
Thanks in advance and best regards.
You are probably using the S32K144EVB. The issue you are facing is already known and paulvlase can provide you much more details. The problem is caused by the OpenSDA and until a newer firmware for OpenSDA only for S32K144 you have to program the models that use the flash blocks via S32DS.
So please flash the generated .mot/elf using the method described here https://community.nxp.com/thread/537910
Hope this helps,
Thanks for quick reply.
Yes I am using S32K144EVB and I want to built models by using Simulink not S32DS. I am a little confused because until this morning I was able to upload the models and observe the variables via Freemaster without any problem. But when I try to upload the non-volatile memory example I saw this error and it is permanent from that moment. Is it related with model (or something I did) or is it some kind of common error mode for this S32K144EVB?
I understand that the cause of problem is related with OpenSDA and I should use S32DS. I visited the page you provided but did not understand the steps that I should follow. I am not familiar with S32DS at all, so could you please provide more detailed and basic steps? If possible any other method will be appreciated, since I do not have any experience design studio compiler.
Also, from now on do I have to follow the procedure that you mentioned each time I upload a new Simulink model or it is just one time fix and I do not have to repeat it ever time?
Thanks in advance.
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:
2. Flash from file:
Hope this helps,
Thanks a lot, I followed the steps and the problem is solved, now I can upload the models directly from Simulink. I could not understand the problem completely but I understand that the problem is related with EEPROM.
The problem started when I try to write some data to permanent (non volatile) memory and this is a critical point for my project. If it is not possible with the following blocks, how can I write any data permanently (i.e S32K144 should store the data even the power is off and I should read the data after power turned on)? Are there any way to write data to non volatile memory and which blocks should I used in order to perform this task?
Thanks in advance.
These are the blocks that I previously used and caused problem: