Issue for TI c2000 package in Matlab2017a?

4 views (last 30 days)
清刘
清刘 on 2 Jul 2019
Commented: 清刘on 2 Jul 2019
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.
在加剧代码中,我找到了原因:在模型步骤函数(在LED001_ERROR.C中,如下),没有执行任何执行。
/* Model stepfucntion */
voidled001_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 stepfucntion */
voidled001_error_step(void)
{
/* (no output/update code required) */
GpioDataRegs.GPCTOGGLE.bit.GPIO68 = (1.0 != 0);
}
据我所知,“默认参数行为”参数仅更改模型中某些变量的属性,并且不应以这种方式影响代码生成和程序的执行。因此,这是TI支持软件包的错误,还是我错过万博1manbetx了一些东西?
Environments:
MATLAB2017A CCSV6

Accepted Answer

马纳尔Chilapur
马纳尔Chilapur on 2 Jul 2019
Hi 清刘 ,
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
清刘
清刘 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)

Tags

Community Treasure Hunt

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

开始狩猎!