Hi, All -- We are trying to generate multitasking code for the S32K144 using Matlab 2020a and MBDT v 4.2. This is for the purpose of teaching an embedded control class, which enrolls over 200 students/year at the University of Michigan and ETH Zurich
We want the multitasking code in separate functions --- but when we check "Reusable Function", we get error messages. This feature works fine without the Toolbox -- it is only when the MBD Toolbox is used that we get errors. And it seems to be specific to version 4.2 -- we believe it also worked with version 4.1.
yesterday we discovered that the problems arise when we are receiving input from the FlexTimer quadrature decode blocks. When we replace these blocks with inputs from ADCs everything is OK again.
I have attached here a zip directory with the models that worked, the ones that did not work, and the error messages. Also, I have pasted below the message from the teaching assistant, Paul Young, who did this work. his email is plyoung@umich.edu.
from Paul:
I looked into this a bit more during my open lab hours today. It appears there is a problem with the quadrature decode block being used in conjunction with "reusable function" subsystems. A quick walkthrough of my methodology is below:
Took the solution code two_virtual_wheel.slx model from gitlab and changed both triggered subsystems to "reusable functions".
Attempted to build code and got an error message that I saved to a text file.
Created a duplicate model that is exactly the same, except instead of using the quadrature decode block to create the angle input, it uses an ADC block.
Successfully built code with the modified model (two_virtual_wheel_adc.slx) and saved the diagnostics viewer output to a text file.
Zipped up the entire matlab workspace including both models, the auto-generated code, and the two diagnostics logs.
Thanks!
Jim