FreeMaster visual issue when using Simulink Data Dictionary

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

FreeMaster visual issue when using Simulink Data Dictionary

537 Views
RaduR
Contributor II

Hi, 

 

I am playing with the S32K146 evaluation board and with the freeMaster tool. I would like to know which would be the best practices when it comes to using Model-Based Desing in Simulink and saving variables as calibratable or signals via the Simulink Data Dictionary. (Using data store memory blocks is not an option for me)

Issue: One of my signals b_led is jumping from 0 to I guess an overflow...

Screenshot 2023-03-18 231403.png

My Simulink model is quite simple for this test, I am using a chart for turning on and off an led.

RaduR_0-1679181969081.png

I have saved model data to an external data dictionary linked to my model.

RaduR_1-1679183405186.png

My questions would be:

1) Why is the value erratic?

2) What would be the best practice to save my Simulink Objects (Parameters/Signals/Lookup tables) in DDs.

3) Is there any way to tell which variable is calibratable and which would be fixed so that when I import it into FreeMaster it will allow me to change those set as calibrations without me manually setting it? Looking for functionality similar to CANApe?

 

Regards,

 

Radu

 

 

 

0 Kudos
1 Reply

493 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @RaduR ,

I am sorry for the delayed response!

I had a look over the screenshots you have attached to the post and my assumption is that there might be a mismatch between the data type of the b_led variable inside the FreeMASTER project and the actual variable data type from the generated code. I have made this assumption based on the fact that the DataType is set as "auto" and not a boolean or an unsigned integer type, and in most cases, the default data type associated would be "double". Please check this, or if possible, please share your little test model with me so that I could have a look directly at your model.

mariuslucianand_0-1679609258955.png

Regarding your other two questions, I will try to provide answers below:

2) What would be the best practice to save my Simulink Objects (Parameters/Signals/Lookup tables) in DDs.

I can comment from the point of view of the generated code. Assuming that you want to use some variables stored inside an SLDD file, and you would want to avoid the Data Store Memories, you should consider using the StorageClass either Volatile (for sensible variables) or Generated Global. For both of the options, the variables will end up as global, and their name from the SLDD will also be visible as is in the generated code so that you could find them easily in the FreeMASTER. But Volatile will also tell the compiler that the content is sensitive and no optimization shall be applied.

3) Is there any way to tell which variable is calibratable and which would be fixed so that when I import it into FreeMaster it will allow me to change those set as calibrations without me manually setting it? Looking for functionality similar to CANApe?

I am not completely sure about the fact that FreeMASTER could identify from the ELF file, in an automatic way, which variables you would want to change their values via FreeMASTER at runtime. Unfortunately, the Model-Based Design Toolbox only supports the FreeMASTER variable identification via the ELF file and does not provide support for the Target Side Address translation. So I will ask @iulian_stan to provide more details here if you are interested to use FreeMASTER's "Variable Stimulus" functionality.

Hope this helps,

Marius