S32K144EVB Communication Problem with Freemaster

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144EVB Communication Problem with Freemaster

3,239 Views
oeren5
Contributor III

Hi,

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.

6 Replies

3,112 Views
mariuslucianand
NXP Employee
NXP Employee

Hello oeren5@ford.com.tr‌,

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,

Marius

0 Kudos

3,114 Views
oeren5
Contributor III

Hi mariuslucianandrei

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.

0 Kudos

3,115 Views
mariuslucianand
NXP Employee
NXP Employee

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

pastedImage_2.png 

2. Flash from file:

  • In the icons menu just under Run press the Flash from file buttonpastedImage_3.png
  • 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.

pastedImage_6.png

  • 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.pastedImage_7.png
  • Next tab, Startup should look like this, so now you can press the Flash button.pastedImage_8.png
  • The board will be flashed and you will get a similar output:pastedImage_9.png

Hope this helps,

Marius

3,115 Views
oeren5
Contributor III

Hi mariuslucianandrei

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:

0 Kudos

2,244 Views
rathi_tg
Contributor III

Hello @mariuslucianand  @oeren5 

    I am Trying the same to do same to save data on EEPROM and check the once it is powered off. In order to do this I have created to different Program one which Writes the data and the other which reads the data from the address. I have flashed both the codes using Design Studio.

1) For Data Write I have Enabled Emergency Kinetics Device Recovery by Full Chip Erase

2)  For Data Read I have Disabled Emergency Kinetics Device Recovery by Full Chip Erase

I am writing 10 to the Address But i see Data as 255 (Default) on Free Master.

 

I am attaching the Files Guide me if I am missing out any step .

rathi_tg_0-1633494164788.png

Thanks and Regards 

Gopal Rathi 

0 Kudos

2,221 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @rathi_tg ,

Can you please try to not perform the full erase for the read program test?  I mean you perform the flash erase before writing the write model, but for the second one, the read to not full erase as well. As far as I know, there is no dedicated EEPROM memory space and the blocks are actually using the flash memory to emulate the EEPROM behaviour.

Hope this helps,

Marius

0 Kudos