Why doesn't the tlc function LibMdlStartCustomCode work in 2014b and later?

I have made my own blockset for generating c-code for STM32 microcontrollers. In one of the tlc files I use LibMdlStartCustomCode for adding a declaration in the model_initialize() in the model c-file. This function works fine in all Matlab versions from 2009b until 2014a. In 2014b and 2015b I noticed that this function no longer seems to work, although it is still present in the documentation.
When I build the same model in 2014a, 2014b and 2015b, I get no errors in 2014a and the declaration is added correctly but in 2014b and 2015b I get an error during the build procedure because the declaration is not added. This is an example of the code in the tlc file:
%%Declare a variable for storing the CAN filter configuration.
%<LibMdlStartCustomCode("tCanFilter canFilter1;", "declaration")>
/* store the CAN controller's filter configuration */
canFilter1.mask = %<block.RTWdata.rxMask1>;
Additional information:
- Windows 7, 32-bit
-Toolboxes installed in the different Matlab versions: MATLAB, Simulink, Embedded Coder, Fixed-Point Designer, MATLAB Coder, MATLAB Compiler(not in 2014a), Simulink Coder, Stateflow, Vehicle Network Toolbox
-Matlab is always started as administrator
-No write protection(read only) on the files

Answers (0)

Asked:

on 24 Sep 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!