Compilation error with Arduino IDE and Adafruit STM32F405 feather board


I am facing an issue which seams to be new online, as I can’t find anything close to it.

When I first compiled my Edge Impulse project on an SAMD21 board, using Arduino IDE 1.8.13, I had the usual arm-none-eabi-g++.exe: The filename or extension is too long. which I fixed downloading and placing the proposed platform.local.txt file suggested at the bottom of this page : On your Arduino (

When I tried to compile the same code on the Adafruit STM32F405 feather board, I faced the same error, so I copied the respective platforme.local.txt file (the one for STM32) from the same source. However, the compilation keeps failing with the following error :
arm-none-eabi-gcc: error: core\variant.cpp.o: No such file or directory

P.S : I can successfully compile and upload the “Blink” example from the Arduino IDE to the board.

Can you please guide me ?


Hi @Raztou3D, did you copy over the platform.local.txt? I think that’s the problem in that case, I’ve just compiled an application for the Adafruit M4 Feature Express and that works fine on macOS (which does not have this issue). Maybe a better idea would be:

  1. Restore the Arduino core.
  2. Build with the new IDE - which has fixed the filename too long issue on Windows.

Hope this helps.

Hello janjongboom,

I did as you proposes, completely reinstalled Arduino 1.8.13 with all libraries, installed Arduino IDE (2-beta-5), wrote the code again, did NOT add the platform.local.txt file … and I get the exacte same issue in Arduino 1.8.13.

fork/exec C:\Users\rezas\AppData\Local\Arduino15\packages\STMicroelectronics\tools\xpack-arm-none-eabi-gcc\9.3.1-1.3/bin/arm-none-eabi-gcc.exe: The filename or extension is too long.
Error compiling for board Generic STM32F4 series.

When I compile the same code (with same boards selected) with Arduino IDE 2-beta-5 and choose to verbose output, I get the following errors.

c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\rezas\AppData\Local\Temp\arduino-sketch-44F74F7490F33DA733890221E3E08257/Feather-EMG-Master.ino.elf section `.rodata' will not fit in region `FLASH'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: region `FLASH' overflowed by 329592 bytes
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\rezas\AppData\Local\Temp\arduino-sketch-44F74F7490F33DA733890221E3E08257\sketch\objs.a(Feather-EMG-Master.ino.cpp.o): in function `ei::numpy::scale(ei::ei_matrix*, float) [clone .part.0]':
Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy5scaleEPNS_9ei_matrixEf.part.0+0x30): undefined reference to `arm_mat_scale_f32'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\rezas\AppData\Local\Temp\arduino-sketch-44F74F7490F33DA733890221E3E08257\sketch\objs.a(Feather-EMG-Master.ino.cpp.o): in function `ei::numpy::normalize(ei::ei_matrix*)':
Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy9normalizeEPNS_9ei_matrixE[_ZN2ei5numpy9normalizeEPNS_9ei_matrixE]+0x50): undefined reference to `arm_min_f32'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy9normalizeEPNS_9ei_matrixE[_ZN2ei5numpy9normalizeEPNS_9ei_matrixE]+0x9a): undefined reference to `arm_max_f32'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: C:\Users\rezas\AppData\Local\Temp\arduino-sketch-44F74F7490F33DA733890221E3E08257\sketch\objs.a(Feather-EMG-Master.ino.cpp.o): in function `ei::numpy::rfft(float const*, unsigned int, float*, unsigned int, unsigned int)':
Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy4rfftEPKfjPfjj[_ZN2ei5numpy4rfftEPKfjPfjj]+0x94): undefined reference to `arm_rfft_fast_init_f32'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy4rfftEPKfjPfjj[_ZN2ei5numpy4rfftEPKfjPfjj]+0xc0): undefined reference to `arm_rfft_fast_f32'
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/../lib/gcc/arm-none-eabi/9.3.1/../../../../arm-none-eabi/bin/ld.exe: Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy4rfftEPKfjPfjj[_ZN2ei5numpy4rfftEPKfjPfjj]+0xec): undefined reference to `arm_rms_f32'
collect2.exe: error: ld returned 1 exit status
Using library EMGFilters-master in folder: C:\Users\rezas\Documents\Arduino\libraries\EMGFilters-master (legacy)
Using library ei-semg-band-arduino-1.0.4 at version 1.0.4 in folder: C:\Users\rezas\Documents\Arduino\libraries\ei-semg-band-arduino-1.0.4 
Using library Wire at version 1.0 in folder: C:\Users\rezas\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.0.0\libraries\Wire 
Using library Adafruit_NeoPixel at version 1.8.0 in folder: C:\Users\rezas\Documents\Arduino\libraries\Adafruit_NeoPixel 
Using library SPI at version 1.0 in folder: C:\Users\rezas\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.0.0\libraries\SPI 
Using library Adafruit_GFX_Library at version 1.10.7 in folder: C:\Users\rezas\Documents\Arduino\libraries\Adafruit_GFX_Library 
Using library Adafruit_SH110X at version 1.2.1 in folder: C:\Users\rezas\Documents\Arduino\libraries\Adafruit_SH110X 
Using library Adafruit_BusIO at version 1.7.3 in folder: C:\Users\rezas\Documents\Arduino\libraries\Adafruit_BusIO 
Using library SrcWrapper at version 1.0.1 in folder: C:\Users\rezas\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.0.0\libraries\SrcWrapper 
Compilation error: Error: 2 UNKNOWN: exit status 1

Guess the issue with filenames beeing too long is fixed but a very different one appeared. Also, does the region FLASH' overflowed by 329592 bytes means that my code is too big for the onboard memory ?

Thanks in advance !

@Raztou3D Yep. What type of model are you trying to put here?

@janjongboom Ok, I tried a previous version of my project’s library and encountered a different error. I have to say, for some reason the compilation is VERA long (this is the complete verbose compilation output ! There seams to be a lot of repeating commands… Can you please check here below? I am starting to wonder if the compiler for my board is actually working properly…)

So the memory error is gone, I guess I will be very limited in terms of my Impulse design decisions. The current error is :
c:/users/rezas/appdata/local/arduino15/packages/stmicroelectronics/tools/xpack-arm-none-eabi-gcc/9.3.1-1.3/bin/…/lib/gcc/arm-none-eabi/9.3.1/…/…/…/…/arm-none-eabi/bin/ld.exe: C:\Users\rezas\AppData\Local\Temp\arduino-sketch-44F74F7490F33DA733890221E3E08257\sketch\objs.a(Feather-EMG-Master.ino.cpp.o): in function ei::numpy::scale(ei::ei_matrix*, float) [clone .part.0]': Feather-EMG-Master.ino.cpp:(.text._ZN2ei5numpy5scaleEPNS_9ei_matrixEf.part.0+0x30): undefined reference to arm_mat_scale_f32’
collect2.exe: error: ld returned 1 exit status

Seams like some functions EI needs are either incompatible with my board or needs some library that are not implicitly included.

Any thoughts? I am stuck since more than a week now :frowning:

Compilation output (sorry too long for post limit) :

@janjongboom I found the solution ! It was actually in an another post. I had to follow these instructions :

If this still does not work you need to edit the src/edge-impulse-sdk/dsp/config.hpp file in the library and add, before #ifndef EIDSP_USE_CMSIS_DSP:

#define EIDSP_USE_CMSIS_DSP             1

I’ll see if the model works now, but at least it compiles ! :partying_face: :partying_face: :partying_face:

1 Like

@janjongboom … how do I mark the topic as Solved ?

1 Like

@Raztou3D Thanks for reporting back! I don’t think there’s a solved button, but I’ll mark it as solved in my head :wink: