CMSIS DSP RFFT UsageFault_Handler

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hello,

I have included the CMSIS DSP libraries in an ADC project (Relax Kit) in DAVE, to calculate the dominant frequency via RFFT.
I am using 2048 samples.

I have tested this in two scenarios:
One with RTOS, thread stack 2048, RTOS settings 1 thread with user defined stack at 2048, .ld file with 8192 stack size.
The other without RTOS .ld file with 8192 stack size.

The program halts at the UsageFault_Handler after running arm_rfft_fast_f32
I have stepped into CMSIS and it seems that the problematic function is arm_bitreversal_32, as the MCU branches to the exception right after that.
I have checked the 3 input variables:
p1 points to my sample matrix, the address seems correct
S->bitRevLength holds the correct value stated in arm_common_tables.h
S->pBitRevTable seems to point to the correct array in arm_common_tables.c

904.attach

After that I'm out of clues. Any ideas?

Best regards,
George
0 Likes
3 Replies
Not applicable
Hi George,

Did you install the CMSIS patch for DAVE v3.1.10 (refer to DAVE Forum "Information about Updates" 16-May post)?
In this CMSIS patch, the CMSIS DSP library source files have been updated to the ARM version 1.4.2 to fix a couple of issues (details see change log in the CMSIS-DSP documentation).

Best regards,
Sophia
0 Likes
Not applicable
Hello Sophia,

Thanks for the tip.
The problem was in arm_bitreversal2.s, which the newer update fixed.
But now the code branches again to UsageFault_Handler, after running arm_cmplx_mag_f32, specifically on
imagIn = *pSrc++;
which is very strange.
I will try to run the CMSIS example, since it crashed on the earlier version; it shouldn't now.
I'll update with any finding.

Regards,
George
0 Likes
Not applicable
Hello again,

I have finally successfully run my code, with real values from ADC.
It seems that arm_cmplx_mag_f32() needs to be run on a vector of twice the size than the input vector.
So if one runs arm_rfft_fast_f32() with RFFT_LENGTH_SAMPLES, it must be run on a vector of RFFT_LENGTH_SAMPLES*2 size, with numSamples set at RFFT_LENGTH_SAMPLES.
Thanks for your help.

Best regards,
George
0 Likes