Compilation error when compiling Edge Impulse firmware for Raspberry Pi RP2040

Hi

I get a compilation error "error: ‘time_t’ declared as function returning a function "is given when compiling Edge Impulse firmware for Raspberry Pi RP2040.

Followed the instruction from the git repository below.

Compiler version
arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009
Ubuntu 24.10

Make output :

[ 0%] Built target bs2_default
[ 0%] Built target bs2_default_library
[ 1%] Built target ei_rp2040_firmware_pdm_pio_h
[ 1%] Building CXX object CMakeFiles/ei_rp2040_firmware.dir/src/main.cpp.o
In file included from /home/doodle/firmware-pi-rp2040/firmware-sdk/ei_fusion.h:41,
from /home/doodle/firmware-pi-rp2040/firmware-sdk/ei_device_info_lib.h:25,
from /home/doodle/firmware-pi-rp2040/edge-impulse/ingestion-sdk-platform/raspberry-rp2040/ei_device_raspberry_rp2040.h:28,
from /home/doodle/firmware-pi-rp2040/src/main.cpp:30:
/home/doodle/firmware-pi-rp2040/firmware-sdk/sensor_aq.h:140:13: error: expected identifier before ‘*’ token
140 | time_t (time())(time_t);
| ^
/home/doodle/firmware-pi-rp2040/firmware-sdk/sensor_aq.h:140:22: error: ‘time_t’ has not been declared
140 | time_t (time())(time_t);
| ^~~~~~
/home/doodle/firmware-pi-rp2040/firmware-sdk/sensor_aq.h:140:5: error: ISO C++ forbids declaration of ‘time_t’ with no type [-fpermissive]
140 | time_t (time())(time_t);
| ^~~~~~
/home/doodle/firmware-pi-rp2040/firmware-sdk/sensor_aq.h:140:29: error: ‘time_t’ declared as function returning a function
140 | time_t (time())(time_t);
| ^
make[2]: *** [CMakeFiles/ei_rp2040_firmware.dir/build.make:76: CMakeFiles/ei_rp2040_firmware.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1801: CMakeFiles/ei_rp2040_firmware.dir/all] Error 2
make: *** [Makefile:91: all] Error 2

Hi @Carel

Did you install the required tooling? Looks like something is missing

Best

Eoin

Hi @Eoin,

Yes. I installed the compiler and Pico-SDK using the commands in the repository. See apt-get output below.

doodle@doodle:~$ sudo apt install gcc-arm-none-eabi libnewlib-arm-none-eabi
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
gcc-arm-none-eabi is already the newest version (15:13.2.rel1-2).
libnewlib-arm-none-eabi is already the newest version (4.4.0.20231231-2).
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
doodle@doodle:~$

Ok thanks @Carel

I believe you may still be using an incorrect compiler for this based on thetime_t conflict. Can you try GCC 10.x ?

Make sure you have installed the pico-sdk requirements

See also here that you have a compatible GCC

@mateusz cc

Best

Eoin