Issue for TI c2000 package in Matlab2017a?
1 view (last 30 days)
Show older comments
A simplest demo (led001_error.slx) is as follow:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/227135/image.png)
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?
Environments:
Matlab2017a CCSv6
0 Comments
Accepted Answer
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.
Regards,
Venkatesh C
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!