Pil Mode on KV3x

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

Pil Mode on KV3x

Jump to solution
5,231 Views
pbgemann001
Contributor III

Hi,

I am currently working with the KV31F120M. I was able to generate, compile and execute small examples, watch them with FreeMaster and verify in SIL-Mode. However I can't get the PIL-Mode working.  The Model ist successfully updated but when I try to run the simulation I get this error: "Unable to find message key 'BuildArgMissing' in catalog 'Connectivity:target'".

I tried to run the Simulation in "Processor-in-the-loop (PIL)" mode instead of "Normal" as well and get this error: "Detected recursive call to slbuild, which might indicate invalid simultaneous model builds. If only one model build was in progress, and if you previously used dbquit while in the MATLAB debugger or pressed Ctrl-C during the build process, please restart the model build."

The PIL-config looks like this: config.PNG

Where COM7 is the OpenSDA-Port.

Any suggestions are highly appreciated.

Best regards

Paul

Tags (2)
1 Solution
4,596 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

That's correct. The COM port is the one corresponding to the OpenSDA in the  Windows Device Manager, under Ports (COM & LPT) category. On my PC it is COM11.

device_manager.jpg

 

The COM port is used for communication between Matlab and board during the PIL simulation. The OpenSDA Drive Name is used for the application download to the board.

You have to set the COM port and OpenSDA Drive Name in both models, PIL_Model.slx and PIL_verification.slx

configuration_parameters.jpg

View solution in original post

17 Replies
4,596 Views
pbgemann001
Contributor III
0 Kudos
Reply
4,596 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌ ,

Which MATLAB version are you using?

0 Kudos
Reply
4,596 Views
pbgemann001
Contributor III

Hi paulvlase‌,

I am using the R2019a Version of MATLAB.

0 Kudos
Reply
4,595 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

Can you install HotFix_2 from Kinetis Hotfixes page and try again?

0 Kudos
Reply
4,595 Views
pbgemann001
Contributor III

Hi paulvlase‌,

Thank you, I installed the HotFix and the error is indeed gone. But instead I now get this one:

"undefined reference to 'main'" in function 'Reset Handler'.Unbenannt.PNG

0 Kudos
Reply
4,595 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

Can you attach the generated folder slprj?

0 Kudos
Reply
4,595 Views
pbgemann001
Contributor III

Hi paulvlase‌,

yes sure.

0 Kudos
Reply
4,595 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

I somehow forgot to include a file into the patch. Can you download MBDT_Kinetis_cumulative_patch_1.exe , apply it, and try again?

0 Kudos
Reply
4,595 Views
pbgemann001
Contributor III

Hi paulvlase‌,

tried again, got a different error again: "multiple target patterns":

error.PNG

I have attached the slprj-Folder again.

0 Kudos
Reply
4,595 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

I fixed an error with multiple definitions of some rtiostream functions, and updated the cumulative patch 1.

I am able to run your model and the pil example model from toolbox using the IAR compiler. I had to change the compiler from GCC to IAR and the simulation mode from PIL simulation to Normal simulation. When you are running a Model block PIL simulation (using a PIL simulation referenced model) you need to use the Normal simulation mode. You can read more here [1], [2], [3].

simulation_mode.jpg

I fixed the GCC build error too, but the application crashes on the board. I am looking into that.

Can you run the attach models using the new version of MBDT_Kinetis_cumulative_patch_1.exe and IAR compiler , and attach a text file with the complete output from the Diagnostics View if it fails?

0 Kudos
Reply
4,594 Views
pbgemann001
Contributor III

Hi paulvlase‌,

thanks for the update. I tried to run the attached files as you suggested but it fails. Please find attached the output of the Diagnostics Viewer.

0 Kudos
Reply
4,594 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

Can you attach the slprj folder?

0 Kudos
Reply
4,595 Views
pbgemann001
Contributor III

Hi paulvlase‌,

I am sorry I forgot.

0 Kudos
Reply
4,596 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

I can reproduce your problem on my side.

On my PC Matlab is installed in C:\MATLAB\R2019a and it works fine. But when I move it to C:\Program Files\MATLAB\R2019a I get the same error.

The error is caused by how Matlab generates the makefile to build the application. I am still investigating why it generates some strange rules to build Matlab's C source files.

For now, as a workaround you can move Matlab to C:\MATLAB\R2019a.

4,596 Views
pbgemann001
Contributor III

Hi paulvlase‌,

thank you, the errors are gone. I still cannot connect to the target though, but I think it is due to my settings.

Just to clarify: The COM-Port I choose should be the Port that is the OpenSDA on my PC right?

I have attached the Models, the slprj and the Output of the Diagnostics Viewer.

0 Kudos
Reply
4,597 Views
paulvlase
NXP Employee
NXP Employee

Hi pbgemann001@ikasle.ehu.eus‌,

That's correct. The COM port is the one corresponding to the OpenSDA in the  Windows Device Manager, under Ports (COM & LPT) category. On my PC it is COM11.

device_manager.jpg

 

The COM port is used for communication between Matlab and board during the PIL simulation. The OpenSDA Drive Name is used for the application download to the board.

You have to set the COM port and OpenSDA Drive Name in both models, PIL_Model.slx and PIL_verification.slx

configuration_parameters.jpg

4,596 Views
pbgemann001
Contributor III

paulvlase‌ it is finally working now I forgot to update the "Child"-Model.

Thank you very much for your great support!