Issue for TI c2000 package in Matlab2017a?

2 ビュー (過去 30 日間)
Qing Liu
Qing Liu 2019 年 7 月 2 日
コメント済み: Qing Liu 2019 年 7 月 2 日
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?
Environments:
Matlab2017a CCSv6

採用された回答

Venkatesh Chilapur
Venkatesh Chilapur 2019 年 7 月 2 日
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
  1 件のコメント
Qing Liu
Qing Liu 2019 年 7 月 2 日
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?

サインインしてコメントする。

その他の回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by