Open xulan007 opened 1 year ago
when cpu(dsp_log) reads share memory written by DSP, the result is partially wrong!
step1, memcpy data to share memory in DSP, and set fft_share_memory->dsp_input_end=0xff:
for(int j=0;j<(fft_n/2+1);j++){ i_real[j]=j; i_imag[j]=j; } memcpy(fft_share_memory->dsp_input_data, i_real, (fft_n/2+1)*sizeof(float)); memcpy(fft_share_memory->dsp_input_data + (fft_n/2+1)*sizeof(float), i_imag, (fft_n/2+1)*sizeof(float)); fft_share_memory->dsp_input_end = 0xff;
step2,When dsp log detected fft_share_memory->dsp_input_end==0xff, read the data from the fft_share_memory->dsp_input_data and print:
float * ret = (float*)fft_share_memory->dsp_input_data; for(int j=0;j<n_fft+2;j++){ printf("%14.8f ", ret[j]); if(j%8==0){ printf("\r\n"); } }
step3: the ret print goes "0. 0. 0. ...0.", but the dsp input is "0. 1. 2. 3. ... "
k510 crb kit
No response
everytime
volatile struct share_memory *fft_share_memory; Please check if fft_share_memory define have volatile .
What happened
when cpu(dsp_log) reads share memory written by DSP, the result is partially wrong!
Reproduction steps
step1, memcpy data to share memory in DSP, and set fft_share_memory->dsp_input_end=0xff:
step2,When dsp log detected fft_share_memory->dsp_input_end==0xff, read the data from the fft_share_memory->dsp_input_data and print:
step3: the ret print goes "0. 0. 0. ...0.", but the dsp input is "0. 1. 2. 3. ... "
Hardware board
k510 crb kit
Software version
No response
Bug frequency
everytime
Anything else
No response