I am using Simulink to generate C code that is part a framework. The Simulink section includes a Stateflow Chart, and it sends and recieves variables to and from the framework via buses (that end up as structures in C).
I am running into trouble because the Stateflow section of code initializes all the variables defined in the buses. It does this even when I check the optimization options: 'remove root I/O level zero initialization' and 'remove internal data zero intialization'.
Because of this, variables stored to nonvolatile memory on the microchip via the framework are overwriten by the initialized Simulink variables, as if they were updated.
Is there a way I can stop the generation of C code that initializes variables created by the Simulink code?
Best Answer