Hello NXP MBDT Team,
I am using "NXP's Model-Based Design Toolbox for S32K1xx Toolbox" version 4.1.0 with MATLAB R2019a.
In my project, I am using model references (model within a model) to manage complexity. While generating code, using one of the example file (flexcan_s32k11x) without any modification, code generation works fine. When I add model reference (Convert flexcan_s32k11x/Rx_Complete/Switch Case Action Subsystem ID 0x3FE/Chart in Model Reference), code generation gives following error:
Error: Index exceeds the number of array elements (0).
After adding "MBD_S32K11x_Config_Information" block to model reference, error goes away. That makes me believe that it is much to add "MBD_S32K11x_Config_Information" block to each model reference at top level. However, in documentation, it suggests otherwise (it seems that adding this block to model is optional)
If set System Target File Manually, above error comes back.
In documentation:
Any suggestion or workaround on how to avoid adding "Target Configuration Block" to each model reference? Is it possible?
-Chirag
解決済! 解決策の投稿を見る。
Hello cpatel@mathworks.com,
Thank you for reporting this behaviour. This might be caused by one of our callbacks. I have attached a file that must be replaced under {src\mbdtbx_s32k\mscripts\model}.
Please replace it and test the "Propagate Configuration" button.
Hope this helps,
Marius
Hello cpatel@mathworks.com,
The Config block must be added in all the referenced models. Besides the .tlc file, there are other changes that the Config block performs on the model.
If you need to change something in the Config Block, just change in the main model and just press the "Propagate configuration" button. It will automatically apply the changes to all Config Blocks from the referenced models.
Hope this helps,
Marius
Thank you for your reply.
When I double click on "Propagate Configuration" as you mentioned above, it also changes some of the model configuration parameters. For example, it changes support for non-finite numbers and complex numbers, among other things. This is reproducible everytime.
Is there a way to avoid this?
Also, with Model References, it is recommended to use Configuration References. "Propagate Configuration" doesn't work in that case.
Hello cpatel@mathworks.com,
Thank you for reporting this behaviour. This might be caused by one of our callbacks. I have attached a file that must be replaced under {src\mbdtbx_s32k\mscripts\model}.
Please replace it and test the "Propagate Configuration" button.
Hope this helps,
Marius