Tool/software: Code Composer Studio
Customer has a problem with msp_mpy_q15 command of DSPLib_1_20_03_01.
They used several LEA functions (FFT, IFFT, MAX etc) but face problems with the multiplication commend (msp_mpy_q15). They are not receiving correct results (vector filled with 0 and sometimes +-1).
Could you please comment where the error is?
Code (add command is working)
#include "dsplib/include/DSPLib.h"
#define VECTOR_LENGTH 8
// Load data into shared Ram to work with LEA
DSPLIB_DATA(src1,4)
DSPLIB_DATA(src2,4)
DSPLIB_DATA(dst,4)
_q15 src1[VECTOR_LENGTH]={1,2,3,4,5,6,7,8};
_q15 src2[VECTOR_LENGTH]={1,5,3,4,5,6,7,8};
_q15 dst[VECTOR_LENGTH];
int main(void) {
msp_status status; // Status of command
//--------------------------------------------------------------------------------------------------------------
msp_mpy_q15_params mpyParams; // data struct
mpyParams.length = 8; //length of Vector
// Run LEA mpy calculation
status = msp_mpy_q15(&mpyParams, src1, src2, dst);
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
msp_add_q15_params addParams; // data struct
addParams.length = 8; //length of Vector
// Run LEA add calculation
status = msp_add_q15(&addParams, src1, src2, dst);
//--------------------------------------------------------------------------------------------------------------
}