Model referencing in i.MX RT Toolbox

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

Model referencing in i.MX RT Toolbox

Jump to solution
1,275 Views
Maciek
Contributor V

Hi,

I have a few questions:

1. We have a software component (a Simulink model) that acts as a high level driver of EEPROM based fault logger. The driver takes messages with high level commands and sends messages in response. The model implements all the required state machines and has it's own data dictionary. We want to make this model a reusable component that can be used in multiple designs. This model incorporates driver blocks from i.MX RT Toolbox (like LPI2C and LPSPI blocks). My question is: what is the proper/intended way of making such model a reusable model in a library ? For example, as peripheral blocks 'suck in' the configuration settings from .mex (Config Tools) file: should we put the library file in a folder with a .mex file that has at least the required/used peripherals appropriately configured ? Which .mex file will such referenced model respect/see: the one in the library folder or the one in the main model folder ?

2. What are the requirements on configuration of a model 'refModel' that will be incorporated as a referenced model in the 'mainModel' ? Specifically: which hardware settings must be identical ? For example: does the 'refModel' have all the peripherals in exactly the same configuration as the 'mainModel' ?

3. Are there any limitations on using MBDT driver blocks in referenced models ?

Thanks
Maciek

 

0 Kudos
1 Solution
1,245 Views
nxa11767
NXP Employee
NXP Employee

Hi @Maciek ,

The toolbox has an option to specify for your model a different .mex file than the default one (the one that follows the <model_name>Config.mex naming convention).

In hardware settings:

nxa11767_0-1643892476419.png

 

This way you can use the same mex file across multiple models that can be further referenced in a main model. And you need to make sure that the main model is using the same mex file - either by setting the option as above screenshot or by following the naming convention. We have in the toolbox a simple example with model refs: NXP_MBDToolbox_IMXRT1xxx\IMXRT_Examples\imxrt117x\model_refevkmimxrt1170_sldemo_mdlref_counter.slx will be referenced multiple times in evkmimxrt1170_sldemo_mdlref_basic.slx

The evkmimxrt1170_sldemo_mdlref_counter.slx has set in the Board Configuration File the .mex file of the main model. 

So you can have just one .mex file shared amongst multiple models and for model refs the shared mex should be also used in the main model.

I hope this answers your questions.

BR,

Alexandra

 

View solution in original post

0 Kudos
1 Reply
1,246 Views
nxa11767
NXP Employee
NXP Employee

Hi @Maciek ,

The toolbox has an option to specify for your model a different .mex file than the default one (the one that follows the <model_name>Config.mex naming convention).

In hardware settings:

nxa11767_0-1643892476419.png

 

This way you can use the same mex file across multiple models that can be further referenced in a main model. And you need to make sure that the main model is using the same mex file - either by setting the option as above screenshot or by following the naming convention. We have in the toolbox a simple example with model refs: NXP_MBDToolbox_IMXRT1xxx\IMXRT_Examples\imxrt117x\model_refevkmimxrt1170_sldemo_mdlref_counter.slx will be referenced multiple times in evkmimxrt1170_sldemo_mdlref_basic.slx

The evkmimxrt1170_sldemo_mdlref_counter.slx has set in the Board Configuration File the .mex file of the main model. 

So you can have just one .mex file shared amongst multiple models and for model refs the shared mex should be also used in the main model.

I hope this answers your questions.

BR,

Alexandra

 

0 Kudos