Part Number:TMS320C6657
Tool/software: Code Composer Studio
I applied Kalman filter on the C6657. But I do not know how to initialize it, I can not find the routine. I refer to a blog following the definition and initialization, but it always prompts me L1 / L2 cache memory fault. I use sysbios. I guess it may be out of memory. But I do not know how to solve this problem. My input picture size is 704 * 576. I do not know if this is related to the size of the picture I typed in. I hope someone can help me.
Below is the error content
=0x0
B30=0x0 B31=0x108dc690
NTSR=0x1820f
ITSR=0x20d
IRP=0x108d3ba8
SSR=0x0
AMR=0x0
RILC=0x5
ILC=0x0
Exception at 0x108c8f98
EFR=0x40000002 NRP=0x108c8f98
Internal exception: IERR=0x11
Instruction fetch exception
Resource conflict exception
DMC Exception MPFAR=0x10038 MPFSR=0x120
Security violation, Local L1/L2 cache memory Fault
Supervisor Read violation, Fault ID=0x0
ti.sysbios.family.c64p.Exception: line 256: E_exceptionMax: pc = 0x108c8f98, sp = 0x80003f08.
xdc.runtime.Error.raise: terminating execution
I use Kalman filter like this:
void kalman2x4_initialize(VLIB_kalmanFilter_2x4 *KFtest)
{
memset(KFtest->transition, 0, sD_2x4*sD_2x4*sizeof(short));
memset(KFtest->errorCov, 0, sD_2x4*sD_2x4*sizeof(short));
memset(KFtest->predictedErrorCov, 0, sD_2x4*sD_2x4*sizeof(short));
memset(KFtest->processNoiseCov, 0, sD_2x4*sD_2x4*sizeof(short));
memset(KFtest->measurementNoiseCov, 0, mD_2x4*mD_2x4*sizeof(short));
memset(KFtest->measurement, 0, sD_2x4*mD_2x4*sizeof(short));
memset(KFtest->state, 0, sD_2x4*sizeof(short));
memset(KFtest->predictedState, 0, sD_2x4*sizeof(short));
memset(KFtest->kalmanGain, 0, sD_2x4*mD_2x4*sizeof(short));
memset(KFtest->temp1, 0, sD_2x4*sD_2x4*sizeof(short));
memset(KFtest->temp2, 0, sD_1x2*sD_2x4*sizeof(short));
memset(KFtest->temp3, 0, sD_1x2*sD_2x4*sizeof(short));
memcpy(KFtest->transition,transition,sD_2x4*sD_2x4*sizeof(short));
memcpy(KFtest->errorCov,errorCov,sD_2x4*sD_2x4*sizeof(short));
memcpy(KFtest->processNoiseCov,processNoiseCov,sD_2x4*sD_2x4*sizeof(short));
memcpy(KFtest->measurement,measurement,mD_2x4*sD_2x4*sizeof(short));
memcpy(KFtest->measurementNoiseCov,measurementNoiseCov,mD_2x4*mD_2x4*sizeof(short));
}
void image_detect(VLIB_kalmanFilter_2x4 *kf ,uint16_t x ,uint16_t y)
{
uint16_t* measure = (uint16_t*) malloc(2);
measure[0] = x;
measure[1] = y;
uint16_t*Residual=(uint16_t*) malloc(4);
VLIB_kalmanFilter_2x4_Predict (kf);
VLIB_kalmanFilter_2x4_Correct (kf,measure,Residual);
free(measure);
free(Residual);
}
//initialization
if(result->falg ==0)
{
kalman2x4_initialize(kf);
kf->state[0]=measure_x;
kf->state[2]=measure_y;
}
//application
image_detect(kf ,measure_x ,measure_y);