AnsweredAssumed Answered

HardFault_Handler Error for arm_rfft_fast_f32 and Execution timing for the same is required

Question asked by Gaurav More on May 8, 2018
Latest reply on Jul 15, 2018 by Kerry Zhou

Hi,

 

I am new to DSP functionality with respect to LPC CMSIS library. I hae implemented the small code in order to do real FFt on the hard coded samples. I refered the sample codes avaiable with LPC expresso library reagrding the CFFT function.

I have used following  initialization sequence.

 

#include "arm/arm_math.h"
#include "math_helper.h"

 

float32_t RealFFT_Input[128] = {

102, 97, 88, 74, 59, 43, 27, 9, -11, -35, -54, -69, -83, -92, -98, -101, -100, -95, -86, -73, -58, -41, -22, -5, 14, 31, 55,
72, 85, 95, 100, 103, 102, 96, 87, 75, 60, 42, 28, 9, -11, -35, -54, -69,
-83, -92, -98, -101, -99, -95, -86, -73, -58, -40, -22, -5, 13, 31, 56, 72, 85, 94, 101,
104, 102, 97, 88, 75, 60, 43, 28, 8, -11, -35, -54, -69, -82, -92, -98, -101, -100, -95,
-85, -73, -58, -41, -22, -5, 14, 32, 55, 72, 85, 95, 101, 103, 102, 96, 87, 75, 60, 43, 27,
8, -12, -35, -54, -70, -82, -92, -98, -101, -100, -94, -86, -73, -58, -41, -22, -4, 14, 31, 56, 73, 85, 94,
101, 104
};

 

float32_t RealFFT_Output[512];

float32_t RMSValue;

 

main(void)

{

arm_rfft_fast_instance_f32 rfft_Fast_instance;

arm_status status;

fftlen  = 32

arm_rfft_fast_instance_f32 *rfft_Fast_instance_Ptr = &rfft_Fast_instance;

status = arm_rfft_fast_init_f32(rfft_Fast_instance_Ptr, fftlen );

 

if(status == ARM_MATH_SUCCESS)
{
   arm_rms_f32(RealFFT_Input, Length, &RMSValue);


   arm_rfft_fast_f32(&rfft_Fast_instance, RealFFT_Input, RealFFT_Output, 0);
}

}

 

My code is getting compiled properly but when i put it ina debug mode i and getting the RMS value which is 71.213 some thing for 32 point RFFT.

 

but when i debug this function arm_rfft_fast_f32(&rfft_Fast_instance, RealFFT_Input, RealFFT_Output, 0);

my program counter goes to 

 

void HardFault_Handler(void)
{

while(1) { }
}

please let me know the resaon for the same. also find my code attached for reference.

I am using LPCexpreso V8.2.2.650 and the latest DSP library of CMSIS. I am running this code in LPC11u68 controller,

 

Also one more thing I want to know is the execution time of the DSP library used in CMSIS since it running in C code.

Is there anyone who has checked for the timming with respect the the aboe mentioned code  for RMS and RFFT.

 

Please provide the solution since my application is very time critical and expected time is in uS. 

Attachments

Outcomes