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.

AWR1843BOOST: DSP_fft32x32() Causing Program Crash and Memory Anomalies

Part Number: AWR1843BOOST
Other Parts Discussed in Thread: AWR1642

Tool/software:

Hello, I am currently developing a customized project and have called the DSP_fft32x32() function within interFrameProcessing(). However, after running the function multiple times (a random number of times), the program crashes.

During debugging, I noticed a strange phenomenon: one of the input parameters of DSP_fft32x32(), obj->pVitalSignsBuffer_Cplx, has its .imag member value unexpectedly modified. However, based on my understanding, DSP_fft32x32() should not alter obj->pVitalSignsBuffer_Cplx. When I comment out the DSP_fft32x32() function, the .imag parameter of obj->pVitalSignsBuffer_Cplx remains zero.

I have already checked for memory conflicts or overwrites. From the Expressions window, the memory allocation appears normal for the following data structures:

  • obj->pVitalSignsSpectrumTwiddle32x32
  • obj->pVitalSignsBuffer_Cplx
  • obj->pVitalSigns_SpectrumCplx

Each of these has a data length of 1024, and obj->breathingWfm_Spectrum_FftSize is also set to 1024.

Additionally, when I comment out DSP_fft32x32(), the data within obj->pVitalSignsSpectrumTwiddle32x32 and obj->pVitalSignsBuffer_Cplx remains stable, and the program does not crash. This leads me to suspect that the issue might be related to the execution of DSP_fft32x32().

I would like to ask:

  1. What could be the possible causes of this issue?
  2. Are there any additional methods to further investigate the problem?
  3. How can the error codes shown in the Console be interpreted more accurately?

Below, I have provided relevant error messages and code snippets. Any insights would be greatly appreciated. Thank you!

DSP_fft32x32() function call:

    // Input to the FFT needs to be complex
    memset((uint8_t *)obj->pVitalSignsBuffer_Cplx, 0, obj->breathingWfm_Spectrum_FftSize * sizeof(cmplx32ReIm_t));
    for (loopIndexBuffer = 0; loopIndexBuffer < obj->circularBufferSizeBreath; loopIndexBuffer++)
    {

        obj->pVitalSignsBuffer_Cplx[loopIndexBuffer].real = (int32_t) obj->scale_breathingWfm*obj->pVitalSigns_Breath_CircularBuffer[loopIndexBuffer];
        obj->pVitalSignsBuffer_Cplx[loopIndexBuffer].imag=0;
    }

//     Input is overwritten by the DSP_fft32x32 function
    DSP_fft32x32((int32_t*) obj->pVitalSignsSpectrumTwiddle32x32,
                 obj->breathingWfm_Spectrum_FftSize,
                 (int32_t*) obj->pVitalSignsBuffer_Cplx,
                 (int32_t*) obj->pVitalSigns_SpectrumCplx);

Console error code:

A0=0xfffffd48 A1=0x0
A2=0x814a08 A3=0x0
A4=0x818f80 A5=0x0
A6=0x200c0e90 A7=0x814b00
A8=0x2 A9=0x7ec8f4
A10=0x1 A11=0x7f2ca0
A12=0x7f7e36 A13=0x818040
A14=0x0 A15=0x7eb410
A16=0x0 A17=0x7f6b94
A18=0x80 A19=0x0
A20=0x0 A21=0x80
A22=0x818f80 A23=0x0
A24=0x7ed560 A25=0x0
A26=0x2 A27=0x817a08
A28=0x1 A29=0x0
A30=0x4783 A31=0x818438
B0=0x0 B1=0x3
B2=0x0 B3=0x7eb644
B4=0xfffffffa B5=0x4c
B6=0x1 B7=0x0
B8=0x0 B9=0x817c28
B10=0x80 B11=0x0
B12=0x0 B13=0x0
B14=0x7ed560 B15=0x4783
B16=0x0 B17=0x7
B18=0x14010103 B19=0x0
B20=0x300 B21=0x0
B22=0x0 B23=0x0
B24=0x0 B25=0x0
B26=0x0 B27=0x0
B28=0x0 B29=0x0
B30=0x80 B31=0x0
NTSR=0xffffffff
ITSR=0x0
IRP=0x0
SSR=0x1
AMR=0x812cb1
RILC=0x818da8
ILC=0x8187e4
Exception at 0xe00214
EFR=0x2 NRP=0xe00214
Internal exception: IERR=0x180
Loop buffer exception
Missed stall exception
{module#23}: line 256: error {id:0xb0000, args:[0x8184d4, 0x4783]}
xdc.runtime.Error.raise: terminating execution

Memory allocation code:

    /************************/
    /* Static L3 allocation */
    /************************/

    /* Only for VSD subFrame */
    obj = &objIn[1];

    volatile uint32_t prevL3_end = 0U;

    for(subFrameIndex = 0; subFrameIndex < NUM_SUBFRAMES; subFrameIndex++)
    {
        if(prevL3_end < l3HeapEndLocationForSubframe[subFrameIndex])
        {
            prevL3_end = l3HeapEndLocationForSubframe[subFrameIndex];
        }
    }

    MMW_ALLOC_BUF(pRangeProfileCplx, cmplx16ReIm_t,
                  prevL3_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->numRangeBins);

    MMW_ALLOC_BUF(pVitalSigns_Breath_CircularBuffer, float,
                  pRangeProfileCplx_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->circularBufferSizeBreath);

    MMW_ALLOC_BUF(pVitalSigns_Heart_CircularBuffer, float,
                  pVitalSigns_Breath_CircularBuffer_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->circularBufferSizeHeart);

    MMW_ALLOC_BUF(pMotionCircularBuffer, float,
                  pVitalSigns_Heart_CircularBuffer_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->motionDetection_BlockSize);

    MMW_ALLOC_BUF(pDopplerWindow, float,
                  pMotionCircularBuffer_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  DOPPLER_WINDOW_SIZE);

    MMW_ALLOC_BUF(pVitalSignsSpectrumTwiddle32x32, cmplx32ReIm_t,
                  pDopplerWindow_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->breathingWfm_Spectrum_FftSize);

    MMW_ALLOC_BUF(pVitalSignsBuffer_Cplx, cmplx32ReIm_t,
                  pVitalSignsSpectrumTwiddle32x32_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->breathingWfm_Spectrum_FftSize);

    MMW_ALLOC_BUF(pVitalSigns_SpectrumCplx, cmplx32ReIm_t,
                  pVitalSignsBuffer_Cplx_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->breathingWfm_Spectrum_FftSize);

    MMW_ALLOC_BUF(pVitalSigns_Breath_AbsSpectrum, float,
                  pVitalSigns_SpectrumCplx_end, SYS_MEMORY_ALLOC_DOUBLE_WORD_ALIGN_DSP,
                  obj->breathingWfm_Spectrum_FftSize);

Checked obj->pVitalSignsBuffer_Cplx in the Memory Browser and found that the .imag field was unexpectedly modified by DSP_fft32x32():

Examined the memory allocation locations of the three buffers (obj->pVitalSignsSpectrumTwiddle32x32, obj->pVitalSignsBuffer_Cplx, and obj->pVitalSigns_SpectrumCplx) in the Expressions window:

  • Hi,

    dspft32x32() was used in one of our SDK Demos in the past (AWR1642 demo). In that specific demo, there were no issues and the demo was not crashing for many hours.

    One thing that you need to make sure is that in your demo the buffers used are not overlapping with some other active buffers.

    For testing, I would re-allocate the buffers used by the fft to some other memory such as L3. Even if the execution is slower, at least you could check if the code is still crashing

    thank you

    Cesar