Issue for TI c2000 package in Matlab2017a?

4 views (last 30 days)
A simplest demo (led001_error.slx) is as follow:
The GPIO68 corresponds to a LED in my board, so, under the ideal situation, the LED should blink at frequency of 1Hz as the time step is 0.5s, .
However, the LED actually keeps off after the model is downloaded.
In the genearted codes, I found the reason: in model step function (in led001_error.c as follow), nothing is executed.
/* Model step fucntion */
void led001_error_step(void)
/* (no output/update code required) */
But, if I alter the parameter of `Default parameter behavior` in `Code Generation/Optimization` from "Inlined" to "tunable".
As a result, the model works fine (the LED blinks and the step function is as follow).
/* Model step fucntion */
void led001_error_step(void)
/* (no output/update code required) */
GpioDataRegs.GPCTOGGLE.bit.GPIO68 = (1.0 != 0);
As far as I know, the `Default parameter behavior` parameter only alter properties of some varibles in the model, and should not affect the code generation and the program's execution in this way. So it is a bug of Ti support package or I missed something?
Matlab2017a CCSv6

Accepted Answer

Venkatesh Chilapur
Venkatesh Chilapur on 2 Jul 2019
Please can you specify sample time for constant block to -1 and try.
In that case the block inherits the model step time and the code will be generated in step function.
Venkatesh C
  1 Comment
Qing Liu
Qing Liu on 2 Jul 2019
Thanks for your replay, Venkatesh C.
Your method works. The default sample time of the constant is `inf` and the model is back to normal after changing it to '-1'.
An additional question: This model also works fine in Matlab2019a, with the sample time being `inf` and default parameter behavior being `inlined`, is it the reason that there something inside Simulink changes?

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!

Translated by