S32k344 Simulink program variable issue in FreeMaster

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

S32k344 Simulink program variable issue in FreeMaster

Jump to solution
268 Views
DrKarthi
Contributor I

Hi

Facing issues in FreeMaster variable reading after MBDT Elf creation... I had developed a model to read a pressure sensor and generate 2 pwm signals. In pwm side can able to generate signal but while reading ADC by using freemaster i am not able to see the variables which i had created in the model for datamemory.

Kinldy help me to understand.

Attached the project which this post, Kindly refer it

 

@Irina_Costachescu @mariuslucianand @georgevictor @Kavin_raj_mbd 

0 Kudos
1 Solution
218 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @DrKarthi 

Thank you for sharing your project with us.

For being able to inspect the Data Store variables from your model in FreeMaster using their exact names as in your Simulink model, you should declare them either Volatile or ExportedGlobal. In this way, you can avoid any code optimizations that would rename these variables. For doing this setting, you should open the Embedded Coder from the APPS tab inside your Simulink model, and under the Code Interface option, click on the Individual Element Code Mappings. Inside the table that opens in the bottom side of the model, you could select the Storage Class for each data store variable used in your model. Please refer to the attached images.

Irina_Costachescu_0-1707751166872.png

 

Irina_Costachescu_1-1707751189448.png

 

Irina_Costachescu_2-1707751209382.png

After performing these settings, please try and rebuild your model. You can see that now the conversion results can be read directly from the variable corresponding to the data store Channel1. On my setup, since I don't have anything connected to the pin corresponding to the ADC channel used inside your project, the values don't indicate anything more than the conversion is performed and data is read inside the project.

Irina_Costachescu_3-1707751236133.png

 

Please let us know if this solves the issue or/and if any additional information is required.

Regards,
Irina

View solution in original post

2 Replies
188 Views
Kavin_raj_mbd
Contributor II

Hi @DrKarthi 

 

I have seen your model, in that you had selected ADC1. In configuration tool -> pin configuration -> ADC1 you had selected PTA11, but in adc configuration (configuration tool -> mcal -> adc) for adc1 you have given the identifier name as ADC_POT_1 and selected the pin as s13, for PTA11 you need to give s10 and in pin configuration also for PTA11 give the identifier name as ADC_POT_1.

 

Thank & Regards

Kavin Raj M

219 Views
Irina_Costachescu
NXP Employee
NXP Employee

Hi @DrKarthi 

Thank you for sharing your project with us.

For being able to inspect the Data Store variables from your model in FreeMaster using their exact names as in your Simulink model, you should declare them either Volatile or ExportedGlobal. In this way, you can avoid any code optimizations that would rename these variables. For doing this setting, you should open the Embedded Coder from the APPS tab inside your Simulink model, and under the Code Interface option, click on the Individual Element Code Mappings. Inside the table that opens in the bottom side of the model, you could select the Storage Class for each data store variable used in your model. Please refer to the attached images.

Irina_Costachescu_0-1707751166872.png

 

Irina_Costachescu_1-1707751189448.png

 

Irina_Costachescu_2-1707751209382.png

After performing these settings, please try and rebuild your model. You can see that now the conversion results can be read directly from the variable corresponding to the data store Channel1. On my setup, since I don't have anything connected to the pin corresponding to the ADC channel used inside your project, the values don't indicate anything more than the conversion is performed and data is read inside the project.

Irina_Costachescu_3-1707751236133.png

 

Please let us know if this solves the issue or/and if any additional information is required.

Regards,
Irina