Skip to content

Arduino build fail with : multiple definition of `reverse' #5045

Closed
@kylongmu

Description

@kylongmu

The fft code is referenced from https://github.com/espressif/esp-dsp/blob/master/examples/fft_window/main/dsps_window_main.c

#include "esp_dsp.h"
//------------DSP FFT
#define N_SAMPLES 1024
int N = N_SAMPLES;
// Input test array
float x1[N_SAMPLES];
// Window coefficients
float wind[N_SAMPLES];
// working complex array
float y_cf[N_SAMPLES*2];
// Pointers to result arrays
float* y1_cf = &y_cf[0];

void process_and_show(float* data, int length)
{
    dsps_fft2r_fc32(data, length);
    // Bit reverse 
    dsps_bit_rev_fc32(data, length);
    // Convert one complex vector to two complex vectors
    dsps_cplx2reC_fc32(data, length);
  
    // Show power spectrum in 64x10 window from -100 to 0 dB from 0..N/4 samples
    dsps_view(data, length/2, 64, 10,  -120, 40, '|');

}

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Build error:

xtensa-esp32-elf/bin/ld.exe: C:\Users\THINKPAD\Documents\Arduino\hardware\espressif\esp32/tools/sdk/esp32/lib\libesp-dsp.a(dsps_fft2r_fc32_ansi.c.obj): in function `reverse':
/Users/ficeto/Desktop/ESP32/ESP32S2/esp32-arduino-lib-builder/components/esp-dsp/modules/fft/float/dsps_fft2r_fc32_ansi.c:142: multiple definition of `reverse'; C:\Users\THINKPAD\AppData\Local\Temp\arduino_cache_892156\core\core_710e3b13e306b2f8b2a3f2af49610748.a(stdlib_noniso.c.o):C:\Users\THINKPAD\Documents\Arduino\hardware\espressif\esp32\cores\esp32/stdlib_noniso.c:32: first defined here

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions