尊敬的 TI 您好,
我正在使用 CLA 来使用一个具有许多参数的函数来计算调节循环。
我的函数接受结构输入。 我正在尝试初始化(引用并启用) main.c 中断服务例程中结构的一部分。
我的函数是内联函数:
static inline void RST_Regulor(float R_Input, float S_Input, float T_Input,
uint16_t Enable, float oldActu, float *Output)
{
uint16_t i;
/*******************************************
* Compute T polynome *
*******************************************/
/* Shift the delay line to the right by 1 */
for(i = SIZE_OF_T-1; i > 0; i--)
{
/*shift*/
Poly_T[i] = Poly_T[i-1];
/*Multiplication and Addition*/
T += coef_t[i] * Poly_T[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
if (Enable == 1)
{
Poly_T[0] = T_Input; //reference
}
else
{
Poly_T[0] = R_Input; //measured
}
/*Add the first param */
T += coef_t[0] * Poly_T[0];
/*******************************************
* Compute R polynome *
*******************************************/
/* Shift the delay line to the right by 1 */
for(i = SIZE_OF_R-1; i > 0; i--)
{
/*shift*/
Poly_R[i] = Poly_R[i-1];
/*Multiplication and Addition*/
R += coef_r[i] * Poly_R[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
Poly_R[0] = R_Input;
R += coef_r[0] * Poly_R[0];
/*******************************************
* Compute S polynome *
*******************************************/
//Shift the delay line to the right by 1
for(i = SIZE_OF_S-1; i > 0; i--)
{
/*shift*/
Poly_S[i] = Poly_S[i-1];
/*Multiplication and Addition*/
S += coef_s[i] * Poly_S[i];
}
/* Get adc physical input into start of the delay line */
/* note the adc input is simulated in software */
Poly_S[0] = oldActu;
S += coef_s[0] * Poly_S[0];
/**** Result*****/
if(Enable == 1)
{
/* Regulation output if enable*/
*Output = (T - R - S) * INVERS_S0;
}
else
{
/* Old value if RST regulation is not enabled */
*Output = oldActu;
}
}
我正在使用以下映射:
#pragma DATA_SECTION(coef_r,"RAMLS4")
const float coef_r[SIZE_OF_R] = {0.2483687f, 0.03341229f, -0.2149564f};
#pragma DATA_SECTION(Poly_R,"RAMLS4")
float Poly_R[SIZE_OF_R];
#pragma DATA_SECTION(coef_s,"RAMLS4")
const float coef_s[SIZE_OF_S] = {0.1058185f, -0.06386142f, -0.01921073f, -0.02274637f};
#pragma DATA_SECTION(Poly_S,"RAMLS4")
float Poly_S[SIZE_OF_S];
#pragma DATA_SECTION(coef_t,"RAMLS4")
const float coef_t[SIZE_OF_T] = {0.06682458f};
#pragma DATA_SECTION(Poly_T,"RAMLS4")
float Poly_T[SIZE_OF_T];
#pragma DATA_SECTION(R,"RAMLS4")
float R;
#pragma DATA_SECTION(S,"RAMLS4")
float S;
#pragma DATA_SECTION(T,"RAMLS4")
float T;
问题是,当我使用___mdebugstop()调试 CLA 时,我的多项同步保利_R, 保利_S 和保利_T 为空。
顺便提一下,这个代码已经在 C28 CPU 中执行了,它也能正常工作。我的多项功能 为空。
2.我无法理解的另一件事是,结构部分草签了。
例如,引用变量会受到影响,但使能变量不会受到影响。
sDCDCConfig.CurrentRef = Ref; sDCDCConfig.EnableControl = Enable;

我正在使用21.6 C2000编译器。
CLA 代码如下:
#pragma DATA_SECTION(sDCDCConfig,"CpuToCla1MsgRAM"); #pragma DATA_SECTION(DutyCycleMan,"Cla1ToCpuMsgRAM"); ST_DcDcConfiguration sDCDCConfig; float DutyCycleMan;
//__mdebugstop();
/* RST regulation */
RST_Regulor(IDC_CLA, //R
CLA_StaActu, //S
sDCDCConfig.CurrentRef, //T
sDCDCConfig.EnableControl, //enable
CLA_StaActu, //old actuation
&DutyCycleMan); //RST output regulation
提前感谢您,
S.Tarik
//由 tarik le 2022年21月01日 编辑