Hello,
I am trying to use the flash of S32k344 as a NVM using MBDT1.5, I have tried the example project provided with case structure and Read, write, Blankcheck, erase blocks. But still i have question,
1) Does their is any specific order for using the Mem blocks(Mem_mainFunction, Mem_getJobresult)if yes then what is it?
also if you have any model which can used as NVM, please share with me.
While during testing the example project , i observed that sometimes for write data to flash it required 2 trigger and for read flash memory it take 3 trigger, what is the reason for this.
Thank you!
Hello @RushikeshK_DC,
Thank you for your interest in Model-Based Design Toolbox for S32K3!
To answer the first question, when performing any kind of memory operation the correct order of function calls is the following:
The GetJobResult function is used to fetch the current status of the memory driver in order to see if it finished the requested operation. This status is used to build a loop to re-trigger the MainFunction if the driver is still busy after previous MainFunction call.
To summarize, the memory operation function call should come first, followed by several consecutive MainFunction calls until the driver becomes Idle.
For the second question, the answer is that currently the only NvM example model available is the one using Internal Flash.
As for the third question, that should not be the case. My guess is that 2 identical commands are given one after the other and the second one is ignored, or, although less likely, a command is given while the driver is busy executing another one, thus ignoring the latter. Also, if a Write command is received after the memory block was already written it may result in errors. If you desire to re-write the memory block, please perform an Erase operation in-between to ensure correct functionality.
In order to prevent this, please try giving a "None" command between any 2 different operations to ensure the model sees the transition to a new operation. Also, please try to feed commands to the model only when the driver is idle.
I hope this helps you overcome the issues you currently have. If not, or if any other issues are encountered later on, please don't hesitate to contact us again.
Thank you!
Best regards,
Florin.