MATLAB: In MATLAB 8.2 (R2013b), how to force the Simulink Coder/MATLAB coder to use the custom TMF instead of using the newer ‘Toolchain’ Approach

Embedded Codermatlab codersimulink coder

In MATLAB 8.2 (R2013b), the concept of Template Make Files is replaced with a 'Toolchain approach'. I have some legacy TMFs that I want to use with my Simulink model, but I cannot find any documentation to force simulink to use TMFs to build ERT and GRT targets. How do I do this?

Best Answer

This can be done using the following function:
coder.make.revertToTMFBuild
This function reverts Simulink models or MATLAB Coder projects to template makefile-based builds. For example CODER.MAKE.REVERTTOTMFBUILD(MODEL) reverts the specified Simulink model to use a template makefile-based build.
For more info, type:
>> help coder.make.revertToTMFBuild
Please note, this function is undocumented in MATLAB 8.2 (R2013b). This means that this behavior may change or be removed in future releases of MATLAB. We are recommending customers to move away from the TMF approach, so you could use the following documentation to create a custom toolchain that has the same behavior as the TMF in question:
Another way of forcing a simulink model with GRT and ERT targets to use template make files is by using the following command:
>> set_param(getActiveConfigSet(gcs),'MakeCommand', 'make_rtw "USE_TMF=1"')