This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F28377D: CPU to CLA data transfer using a struct

Part Number: TMS320F28377D


In my application, I am trying to speed up the code execution in the CPU1 CLA.

Following the cla_iir2p2z_cpu01 example, I initially had all variables as floats.

However, there are some flag variables that do not need to be 32-bit wide floats.

I have changed those to "unsigned int" and the program stopped working.

It was a simple change in the shared struct.

====

typedef struct{
float cla_sin_theta;
float cpu2cla_d;
// unsigned int cpu2cla_SP;   <-- does not work
// unsigned int cpu2cla_SN;  <-- does not work
float cpu2cla_SP;  <-- works OK
float cpu2cla_SN;  <-- works OK
} CPU2CLA ; 

extern CPU2CLA cpu2cla;  // in the shared header file

====

in a CPU1 .c file:

#pragma DATA_SECTION(cpu2cla,"CpuToCla1MsgRAM")
CPU2CLA cpu2cla;

=====

The SP and SN flags are then copied into an internal structure:

==== 

in cla1.cla file:

conv_sim.d = cpu2cla.cpu2cla_d; // input
conv_sim.SN = cpu2cla.cpu2cla_SN; // input .... works when both FLOATs but not when both UNSIGNED INTs
conv_sim.SP = cpu2cla.cpu2cla_SP; // input .... works when both FLOATs but not when both UNSIGNED INTs

...

in the shared header file:

float Tsw;
float Ts_step_to_Tsw_ratio;
float theta_increment;
// unsigned int SN;  <-- does not work
// unsigned int SP;  <-- does not work
float SN;  <-- works OK
float SP;  <-- works OK
} CONV_SIM;

====

in a .c file:

#pragma DATA_SECTION(conv_sim,"CLADataLS0")
CONV_SIM conv_sim;

====

CPU1 writes the correct values to cpu2cla.cpu2cla_SN and cpu2cla.cpu2cla_SP but these values are not reflected in the CLA-only structure  CONV_SIM

Is there any limitation on mixing ints and floats in shared structures between CPU1 and CLA?