Hi,
I have recently updated my MBDT S32k1x toolbox to v4.3.0. to include newer matlab version support.
I see that this is working fine for existing models and the example models included.
However, when a new model is created and set to use the system target file (in code generation options in simulink) mbd_s32k.tlc. Then instead of using the template makefile, the build process changes to a toolchain. In my case this is the MinGW64 | gmake toolchain.
When building a model using the toolchain method, I get a long list of errors of certain blocks not being found. When I copy that same blocks into an existing MBDT model from the library examples using the template file, then everything works fine.
If I select the MBD s32k14.tlc target then the makefile is still selected, but other errors occur. If I then switch back to the mbd_s32k.tlc the errors occur again.
If I reselect the mbd_s32k.tlc target file for an example model (e.g. ftm_independent_pwm_s32k14x) then I get the error:
Environment Variable GHS_S32K_TOOL not set. Set the location of GHS_S32K_TOOL target compiler and restart MATLAB, please. Example: GHS_S32K_TOOL=c:\ghs\comp_201516
Is it possible that something went when I upgraded the toolbox (I tried a fresh install of the toolboxes). Or is it possible that I have to now manually force it to use the template makefile?
I use matlab 2021b on windows 10
Model-Based Design Toolbox for S32K1xx Series Version 4.3.0 (R2016a-R2022a)
MEX configured to use 'MinGW64 Compiler (C)' for C language compilation.
Best regards,
Dennie Craane
已解决! 转到解答。
Hi, @craanede
Normally, you don`t have to choose manually the system target file for a new model. It should be set automatically when you drag and drop the MBD_S32K1xx_Config_Information block.
After this block is put in a model, an initialization script is called to do all the settings regarding the building information, including the system target file and the template makefile.
Regards,
Stefan.
Hi Stefan,
Thank you for the quick reply.
My intention is not to set the tlc file manually, but this is resetting itself automatically after a few build procedures.
I am not able to fully reproduce the occuring when the settings reset to using a toolchain instead of a makefile.
I am also getting this error when opening the model when it has a makefile selected in the codegen options:
Unable to start the target application, "myModel", because its file extension cannot be determined. Build your target application by using a toolchain or a template makefile that specifies a toolchain via the TOOLCHAIN_NAME macro. The file extension will then be determined automatically from the linker's executable file extension property.
However, I can build my model despite of this error occurring when opening the model.
The settings can be reset with your steps but I need to do some extra things as well:
By removing the config block, saving and re-opening the model and then compiling it to trigger the init function, I can successfully reset the codegen options. However, if I do not re-open the model the init fucntion mbd_s32k_consistency_checks(bdroot(gcs)); does not solve the issue.
I am probably doing something wrong here.
Best regards,
Dennie Craane
Hi, @craanede
Normally, you don`t have to choose manually the system target file for a new model. It should be set automatically when you drag and drop the MBD_S32K1xx_Config_Information block.
After this block is put in a model, an initialization script is called to do all the settings regarding the building information, including the system target file and the template makefile.
Regards,
Stefan.