Compilation with all the newest versions of PlatformIO (5.2.0a5) and the espressif32 platform (3.1.0) gives
C:\Users\Max\temp\tensorflow-lite-esp32\firmware>pio run
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
------------------------------------------------------------------------------------------------------------------------Tool Manager: Installing platformio/framework-arduinoespressif32 @ ~3.10005.0
Downloading [####################################] 100%
Unpacking [####################################] 100%
Tool Manager: framework-arduinoespressif32 @ 3.10005.210308 has been installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 3.10005.210308 (1.0.5)
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 30 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <tfmicro>
Building in release mode
[...]
Compiling .pio\build\esp32dev\lib296\tfmicro\tensorflow\lite\micro\kernels\softmax.cc.o
Compiling .pio\build\esp32dev\lib296\tfmicro\tensorflow\lite\micro\kernels\split.cc.o
In file included from lib\tfmicro/tensorflow/lite/kernels/internal/reference/reduce.h:21:0,
from lib\tfmicro\tensorflow\lite\micro\kernels\reduce.cc:16:
lib\tfmicro/tensorflow/lite/kernels/internal/max.h: In function 'T tflite::TfLiteMax(const T&, const T&)':
lib\tfmicro/tensorflow/lite/kernels/internal/max.h:29:10: error: 'fmax' is not a member of 'std'
return std::fmax(x, y);
^
lib\tfmicro/tensorflow/lite/kernels/internal/max.h:29:10: note: suggested alternative:
In file included from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\cmath:44:0,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\random:38,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:66,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62,
from lib\tfmicro\third_party\gemmlowp/fixedpoint/fixedpoint.h:21,
from lib\tfmicro/tensorflow/lite/kernels/internal/common.h:26,
from lib\tfmicro/tensorflow/lite/kernels/internal/reference/reduce.h:19,
from lib\tfmicro\tensorflow\lite\micro\kernels\reduce.cc:16:
C:\Users\Max\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/math.h:284:15: note: 'fmax'
extern double fmax _PARAMS((double, double));
^
In file included from lib\tfmicro/tensorflow/lite/kernels/internal/reference/reduce.h:22:0,
from lib\tfmicro\tensorflow\lite\micro\kernels\reduce.cc:16:
lib\tfmicro/tensorflow/lite/kernels/internal/min.h: In function 'T tflite::TfLiteMin(const T&, const T&)':
lib\tfmicro/tensorflow/lite/kernels/internal/min.h:29:10: error: 'fmin' is not a member of 'std'
return std::fmin(x, y);
^
lib\tfmicro/tensorflow/lite/kernels/internal/min.h:29:10: note: suggested alternative:
In file included from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\cmath:44:0,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\random:38,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\bits\stl_algo.h:66,
from c:\users\max\.platformio\packages\[email protected]\xtensa-esp32-elf\include\c++\5.2.0\algorithm:62,
from lib\tfmicro\third_party\gemmlowp/fixedpoint/fixedpoint.h:21,
from lib\tfmicro/tensorflow/lite/kernels/internal/common.h:26,
from lib\tfmicro/tensorflow/lite/kernels/internal/reference/reduce.h:19,
from lib\tfmicro\tensorflow\lite\micro\kernels\reduce.cc:16:
C:\Users\Max\.platformio\packages\framework-arduinoespressif32\tools\sdk\include\newlib/math.h:285:15: note: 'fmin'
extern double fmin _PARAMS((double, double));
^
*** [.pio\build\esp32dev\lib296\tfmicro\tensorflow\lite\micro\kernels\reduce.cc.o] Error 1
============================================= [FAILED] Took 42.69 seconds =============================================
Making PlatformIO use the master branch of Arduino-ESP32 and an 8.4.0 GCC makes the firmware build. Done so by adding
platform_packages =
toolchain-xtensa32@~2.80400.0
framework-arduinoespressif32@https://github.com/espressif/arduino-esp32.git
Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.1.0) > Espressif ESP32 Dev Module
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minimodule, olimex-arm-usb-ocd, olimex-arm-usb-ocd-h, olimex-arm-usb-tiny-h, olimex-jtag-tiny, tumpa)
PACKAGES:
- framework-arduinoespressif32 0.0.0+sha.371f382
- tool-esptoolpy 1.30000.201119 (3.0.0)
- toolchain-xtensa32 2.80400.210114 (8.4.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 32 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <tfmicro>
Building in release mode
[..]
Indexing .pio\build\esp32dev\lib296\libtfmicro.a
Linking .pio\build\esp32dev\firmware.elf
Retrieving maximum program size .pio\build\esp32dev\firmware.elf
Building .pio\build\esp32dev\firmware.bin
Checking size .pio\build\esp32dev\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [= ] 5.1% (used 16608 bytes from 327680 bytes)
Flash: [== ] 22.2% (used 291520 bytes from 1310720 bytes)
esptool.py v3.0
========== [SUCCESS] Took 27.70 seconds ==========
But without these changes the firmware cannot compile.