ARM_MATH_TEST_FAILURE
.
。有人可以帮我解决这个问题吗?该函数在主函数的while-loop中反复使CALELD在ADCISR中设置
FFF_calculation_progress
#define TEST_LENGTH_SAMPLES 512
/* -------------------------------------------------------------------
* External Input and Output buffer Declarations for FFT Bin Example
* ------------------------------------------------------------------- */
//float32_t testInput_f32_10khz[TEST_LENGTH_SAMPLES];
static float32_t testOutput[TEST_LENGTH_SAMPLES/2];
extern volatile uint8_t FFF_calculation_progress;
extern float32_t value_adc[TEST_LENGTH_SAMPLES];
/* ------------------------------------------------------------------
* Global variables for FFT Bin Example
* ------------------------------------------------------------------- */
uint32_t fftSize = 512; //TEST_LENGTH_SAMPLES/2;
uint32_t ifftFlag = 0;
uint32_t doBitReverse = 1;
/* Reference index at which max energy of bin ocuurs */
uint32_t refIndex = 213, testIndex = 0;
uint8_t calculate_FFT()
{
arm_status status;
float32_t maxValue;
status = ARM_MATH_SUCCESS;
// printf("X");
if(FFF_calculation_progress == 1)
{
/* Process the data through the CFFT/CIFFT module */
arm_cfft_f32(&arm_cfft_sR_f32_len256, value_adc, ifftFlag, doBitReverse);
// XMC_Delay(1000);
/* Process the data through the Complex Magnitude Module for
calculating the magnitude at each bin */
arm_cmplx_mag_f32(value_adc, testOutput, fftSize);
// XMC_Delay(1000);
/* Calculates maxValue and returns corresponding BIN value */
arm_max_f32(testOutput, fftSize, &maxValue, &testIndex);
// XMC_Delay(1000);
if(testIndex != refIndex)
{
status = ARM_MATH_TEST_FAILURE;
// FFF_calculation_progress = 0;
return status;
}
printf("Output\n\r");
for(uint16_t i =0; i < (TEST_LENGTH_SAMPLES/2);i++)
{
printf("%f\n\r",testOutput[i]);
}
// FFF_calculation_progress = 0;
}
return status;
}
您想要的是不可能的XCM1100中的手臂没有浮点单元。 此外,CPU的运行速度为32MHz,比笔记本电脑慢一百倍。 它是一个非常基本的微控制器,不是为重型计算而设计的。 我很惊讶有FFT代码的空间。 只有64kb的程序内存。