S32k1xx MBD Toolbox for Simulink does not working!!!!!

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

S32k1xx MBD Toolbox for Simulink does not working!!!!!

1,442 Views
PierpaoloDini
Contributor I

Hello everyone,

I am Pierpaolo Dini, an assistant professor at the University of Pisa. We made an investment, buying 10 s32k144 q100 evaluation boards, for a laboratory course on model-based design in the field of control and monitoring algorithms, but we facing difficulites in using the toolbox.

I have no longer been able to use the PIL mode with the MBD toolbox for s32k1xx evaluation boards, for models that are more complex than the example of switching on the LED via blocxco GPIO, with simulation input managed with the toggle button. It's really the only example where it allows me to do that.

In particular I noticed that anything I add to that example starts giving me the following error:

"Cannot perform a processor-in-the-loop (PIL) simulation for "xxx".

The configuration parameters for this model do not support the following connectivity configurations: IBIS_AMI, Texas Instruments Code Composer Studio (IDE), Texas Instruments Code Composer Studio (TCP/IP), Texas Instruments Code Composer Studio (Serial), s32k_pil PIL, s32k_as_pil PIL

To fix this error, update the configuration parameters or create a supported connectivity configuration. See Configure a SIL or PIL Simulation, Create a Connectivity Configuration for a Target, and Processor-in-the-Loop (PIL) Simulation in your product help. "

I really tried them all: uninstall and reinstall the toolbox, both version 4.3 (latest available) and 4.2 and 4.1. I tried with older versions of matlab, now I'm using 2020b, but I get the exact same error with versions 2022b and 2023b.

The error is quite frustrating since I have never had problems with the s32k144, and through the PIL approach we were able to test even complex algorithms such as MPC and KF. Now even the simple PI for a first order system causes error.

It makes me think there is a problem with the toolbox and not with the procedure I use which has always been the same and I have never had any problems.
I report some screens below:

1) in the configuration block the card is recognized without problems

PierpaoloDini_0-1721422182862.png

2) in the solver configuration I used fixed step and a numerical integration time which for this type of control scheme should not cause problems when it comes to computational complexity.

PierpaoloDini_1-1721422392814.pngPierpaoloDini_2-1721422438679.pngPierpaoloDini_3-1721422466808.png

 

3) via Simulink Test APP, the model for test harness is created, without any errors, and the control loop with the discretized first order system is set "outside". I point out that the dynamics of the system are quite "relaxed" so I doubt it is something related to computational complexity. 

PierpaoloDini_4-1721422713503.png

PierpaoloDini_5-1721422994546.png

 (l'ho chiamato pidPIL_Harness2 invece che 1 per mia convenienza, non è un errore...)

 

4) with SIL/PIL APP I set processor-in-the-loop in the settings, and the preliminary simulations are completed without errors (because in fact the model contains no errors...)

PierpaoloDini_6-1721423432286.png

PierpaoloDini_7-1721423489184.png

I hope tech support is able to resolve such a problem.

0 Kudos
Reply
5 Replies

1,367 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @PierpaoloDini,

Thank you for posting on our MBDT Community!

From your message I understand that you are no longer able to run complex models in PIL mode on any of the MATLAB versions newer that R2022b. Was the toolbox and PIL mode working for you in a previous version than R2022b? Is this starting to happen when installing another toolbox/mechanism for code generation other than/from NXP?

First of all, the settings from your screenshot of the MBDT_S32K1xx_Config_Information look good. I hope that the same block and settings are also placed in the referenced model.

 

 

Placing the configuration code in the model is the way of setting the hardware target for the referenced model as well. I know that only the application is supposed to be there but this is how the MBDT for S32K1 works.

What I have noticed from your model is that the pidPIL, does not have black corners, and there is no PIL written between parenthesis and as you say, the Test Harness sets the model to be executed in PIL mode. This is why I would try first that the System under test is Model blocks in SIL/PIL mode and select the system which is to be executed in PIL mode, just like in the screenshot attached below:

mariuslucianand_0-1721770801855.png

For this purpose, I have used the MathWorks example Battery State of Charge Estimation in Simulink Using Deep Learning Network and added the coder target to its settings, in order to be executed on the S32K144 EVB, similar with what you have, and this model ran for me successfully on the R2023b.  Please find attached this model below.

To run this example on your end, please run first the BatterySOCSimulinkEstimation_ini.m script. Open the BatterySOCSimulinkEstimation_NXP.slx file. Open the main config model, set the proper COM port in the settings, and then, under the MCU tab press the "Propagate configuration" button. Back in SIL/PIL press the Run SIL/PIL button.

mariuslucianand_1-1721771831251.png

In your MATLAB, I would try also to run the mbd_s32k_path script. This will add some required files into path and maybe this is also related to your issue.

If the problem persist for your model, could you please share with us one of your model on which you encounter issues? If it is something confidential, you could also send it in private.

I have sent the archive with the example to you via a private e-mail.

Hope this helps,

Marius

 

 

 

 

0 Kudos
Reply

1,268 Views
PierpaoloDini
Contributor I

No one from the Tech support can solve such issue??

0 Kudos
Reply

1,326 Views
PierpaoloDini
Contributor I

Now i Have MATALB 2024a and versione 4.3 of MBDT, so no issure must be linked with the version i use.

Thinking on what you sayd about bolded black corners, as a proof of that is not related on how you define the test harness at the first step, now i explicit the PIL mode, and the block have the form you think is correct.

PierpaoloDini_0-1721927216518.png

Exactly the same error appear again (again!!.).

I noticed also i cannot run anymore neither the simple example of taggle led switching...

I also try to run the example you send me by e-mail and...same error!

I have no words...

0 Kudos
Reply

1,258 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @PierpaoloDini,

Could you please share your model with me, I am trying to understand if there is a problem with the toolbox, or is a problem with your setup, by trying your model on my side, since the example I have shared with you is not running successfully on your side.

Please share it via the private message if the content is sensitive content.

Regards,

Marius

0 Kudos
Reply

1,356 Views
PierpaoloDini
Contributor I

In reality, I can't use the processor in the loop, with the procedure done in the steps that I showed you in the various figures (which I had been using for 3 years now...). I'm now using 2020b and version 4.3 of MBDT. Unfortunately, having installed/uninstalled the other versions of matlab and tried combinations of the MBDT versions (4.1, 4.2 which I had saved and 4.3 which I had recently downloaded), this is the configuration I have available...

In the figure I see, you have not gone through the creation of the Harness test via Simulink Test App. But you use SIL/PIL directly, and this is in fact the reason why you have to make explicit the "Model blocks in SIL/PIL mode" item from the user interface of Simulink as "System Under Test".

As regards the "marked black corners and the writing (PIL)", this is because you have simply recalled the model you are interested in via a "Model" block (from Ports & Subsystem), you have selected the processor in the loop item as "Simulation fashions".

When you use the test harness it is automatically defined which part of the slx model will be processed on the MCU, in fact in the photo I sent you "System Under Test = pidPIL" which is precisely the model from which the Harness is generated.

In this way everything that is "external" is processed on the host PC instead. The black corners and the writing PIL would appear if the procedure was able to generate .elf and .mot files, which is no longer possible given the error on the "PIL conncetivity" which cannot be resolved.

The mbd_s32k_path command is the first thing I do immediately after instantiating a new user variable on Windows, which I usually call GCC_S32K_TOOL and which is located at the path to the ...\gcc-6.3-arm32-eabi folder. In fact it didn't solve my problem.

Instead of sending me packaged examples, could you send me some screenshots to show me how to start from scratch and get to a functioning GDP? For example, replicating the banal example of the pidPIL model that I shared: a PID block inside a PIL block + ua discrete transfer function "outside".

Thanks for the attention and time dedicated.

 

Cordially,

Pierpaolo.

0 Kudos
Reply