MBDT with Referenced Models

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

MBDT with Referenced Models

1,813 Views
ranulf
Contributor IV

I have done some experimentation with MBDT in Simulink models with Referenced Models. I have learned that each referenced model must include a MBDT configuration block or errors will be raised during Build. The configuration block must be included in the referenced model even if the referenced model does not contain any (other) MBDT functionality. 

Are referenced models intentionally supported by MBDT? What are the limitations? Are there any other things I should know about using MBDT and referenced models? 

5 Replies

752 Views
LRPT
Contributor I

I have the same issue. I have a model I need to retarget to several MCUs and I am trying to move everything I can to the Shared Dictionaries.  Adding the NXP config block complicates my development. If a config block is required, is there any alternative way (e.g. variants) I can use to control this, at least programmatically?

 

Thanks

 

Luis

0 Kudos

1,776 Views
nofake_drstrang
Contributor III

Hi @mariuslucianand ,

It confuses me...

We have Matlab 2020b.

From the example model for S12Z, I changed only the PI-controller for Id-current into a referenced model (with referenced configuration set from top level) .

Both with and without the block "MCD_MC9S12ZVMx_Config_Information" in the referenced model, It could successfully build and load the model to EVB.

RefModel.PNG

BR

Alex

0 Kudos

1,757 Views
paulvlase
NXP Employee
NXP Employee

Hi @nofake_drstrang ,

On some of our toolboxes, we placed the required settings (target mcu, toolchain flags, etc.) for building the model inside the main config block. As a result, you had to add the main config block inside the referenced models otherwise, the build would fail because it can't retrieve these settings.


On S12Z, these settings are placed in the model configuration set. But another functionality of the main config block is to help you set up your model.
To build the model you need to select the system target file that corresponds to your mcu family, from the Model Configuration dialog (Ctrl+E) -> Code Generation panel. You can add the main config block, and it will do that automatically. Or you can skip adding this block and select the desired system target file by hand.


In your case it works with and without because the correct system target file is already selected in the model configuration set.
You can add the main config block only to set up the model and remove it, and your model will still build successfully.

The referenced models are intentionally supported by our toolbox, but we didn't test referenced models with referenced config set.

Regards,
Paul

1,785 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @ranulf ,

The only limitation we know is that you have to include the Configuration block in the reference models as well. Adding Configuration block is not intentional. Adding our block in the reference models, should not affect the simulation. 

@paulvlase, can you please comment on this?

Regards,

Marius

0 Kudos

1,324 Views
rathi_tg
Contributor III

Hello @paulvlase  @mariuslucianand 

       I am using MBDT Toolbox of S32k144 and trying to use the reference model. I am Trying to develop two separate code fro UART TX and RX and Combining both using Reference model. I am attaching the file for your reference. I have a list of queries 

1) Do we require to use S32k144 Configuration and UART configuration blocks in both the model. If yes will this create configuration block twice in the generated code?

2) I always get a build Error. Can i Flash Reference code model in Target Hardware?

3) If i Can Flash the code then which of the code has to be set for Building?

4) Lastly, How can we control the flow of Reference Model based C Code?

 

Regards 

Gopal Rathi

0 Kudos