I'm developing on a TMS320C5535 using the XDS110 debugger, the C5000 chip support library, and Code Composer version: 9.1.0.00010. I'm having a hard time getting mul32() to work in version 03.00.00.03 of DSPlib. To demonstrate where I'm at here is an example of me using add() of DSPlib:
int main(void) { /////////////* Initializations *///////////// CSL_Status SYS_status; SYS_status = SYS_PLL_LDO_init(); SYS_status = SYS_EBSR_init(); SYS_status = SYS_GPIO_init(); #define NX 10 Uint32 i; // LDATA x[NX] = {0}; // LDATA y[NX] = {0}; // LDATA z[NX] = {0}; DATA x[NX] = {0}; DATA y[NX] = {0}; DATA z[NX] = {0}; for (i = 0; i < NX; i++){ x[i] = i; y[i] = i; } add(x, y, z, NX, 0); // mul32(x, y, z, NX); /////////////* Infinite Loop *///////////// while(1){ i = 0; } }
x and y are both = [0,1,2,3, ... ,9]. As expected, z = [0, 2, 4, 6, ... ,18]. Now I try using mul32():
/////////////* Main Function *///////////// int main(void) { /////////////* Initializations *///////////// CSL_Status SYS_status; SYS_status = SYS_PLL_LDO_init(); SYS_status = SYS_EBSR_init(); SYS_status = SYS_GPIO_init(); #define NX 10 Uint32 i; LDATA x[NX] = {0}; LDATA y[NX] = {0}; LDATA z[NX] = {0}; // DATA x[NX] = {0}; // DATA y[NX] = {0}; // DATA z[NX] = {0}; for (i = 0; i < NX; i++){ x[i] = i; y[i] = i; } // add(x, y, z, NX, 0); mul32(x, y, z, NX); /////////////* Infinite Loop *///////////// while(1){ i = 0; } }
x and y are still both = [0,1,2,3, ... ,9]. However, z is incorrectly = [0,0, .... 0].
SPRU422J mentions that "Input and Output vectors must be 32−bit aligned", but I do now know how to do this or if it's the reason this unexpected behavior is occurring. Any guidance would be greatly appreciated