Not applicable
Oct 13, 2014
01:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 13, 2014
01:53 AM
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
After that I'm out of clues. Any ideas?
Best regards,
George
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
After that I'm out of clues. Any ideas?
Best regards,
George
3 Replies
Not applicable
Oct 13, 2014
02:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 13, 2014
02:41 AM
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
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
Not applicable
Oct 13, 2014
04:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 13, 2014
04:02 AM
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
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
Not applicable
Oct 13, 2014
05:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 13, 2014
05:57 AM
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
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