Can't build Filesystem Image sh: 1: mkspiffs_espressif32_arduino: not found Error 127

Hi!
I can’t build a Filesystem Image for my ESP32, but I’m able to build and deploy the project with out any problems . The platformio.ini looks like this:

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200

I’ve tried the following command through the terminal (Linux, Ubuntu 18.04, ARM64) in the project directory:

pio run --target buildfs --environment esp32dev -v

But get the following:

Processing esp32dev (platform: espressif32; board: esp32dev; framework: arduino; monitor_speed: 115200)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif32/esp32dev.html
PLATFORM: Espressif 32 (3.0.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.10004.210126 (1.0.4) 
 - tool-esptoolpy 1.30000.201119 (3.0.0) 
 - tool-mkspiffs 2.230.0 (2.30) 
 - toolchain-xtensa32 2.50200.80 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 26 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
"mkspiffs_espressif32_arduino" -c data -p 256 -b 4096 -s 1507328 .pio/build/esp32dev/spiffs.bin
sh: 1: mkspiffs_espressif32_arduino: not found
*** [.pio/build/esp32dev/spiffs.bin] Error 127

I can see that something named mkspiffs_espressif32_arduino is in the ~/.platformio/packages/tool-mkspiffs/ directory.

I’v tried to reinstall PlatformIO, removing directories .pio and .platformio etc, but no success.
Any ideas?

Regards
Christian

I suspect there may be a binary incompatibility. In the directory where you ran pio run --target buildfs --environment esp32dev -v, please run the commands

~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino -c data -p 256 -b 4096 -s 1507328 .pio/build/esp32dev/spiffs.bin
file ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino
ldd ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino

OK, does this mean I can’t use the “File Image Upload”-function in PlaformIO on my Jetson Nano (I belive there’s no 32-bit support)? When I run the commands you suggest I get:

christian@jetson1:~/repo/platformio/projects/platformio-blink$ ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino -c data -p 256 -b 4096 -s 1507328 .pio/build/esp32dev/spiffs.bin
bash: /home/christian/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino: No such file or directory
christian@jetson1:~/repo/platformio/projects/platformio-blink$ file ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino
/home/christian/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino: ELF 32-bit LSB executable, ARM, EABI5 version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.32, BuildID[sha1]=21c8f20aa96be75fb077fe641b503887e60c59b2, stripped
christian@jetson1:~/repo/platformio/projects/platformio-blink$ ldd ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino
        not a dynamic executable

Seems like the ARM64 packages are the ARM32 packages and it’s expected that they are runnable on ARM32 as well. Not sure if there’s a missing system package that would allow you to do that.

CC @valeros for unexecutable ARM32 binary in package for ARM64, for boards without ARM32 support.

Sadly Releases · igrr/mkspiffs · GitHub only provides releases for ARM32.

But, you should still be able to fix this in a workaround by compiling the needed binary yourself.

Execute on the Jetson Nano

git clone --recursive https://github.com/igrr/mkspiffs.git
cd mkspiffs
make clean
make dist BUILD_CONFIG_NAME="-arduino-esp32" \
    CPPFLAGS="-DSPIFFS_OBJ_META_LEN=4"
cp mkspiffs ~/.platformio/packages/tool-mkspiffs/mkspiffs_espressif32_arduino

(assumes you have git and basic compiler tools like g++ and make installed)

That should compile the right version and then overwrite the existing binary. You can then retry building normally.

Edit: There seems to be some info on adding ARM32 support to the Jetson Nano but it seems very hacky and not recommended. 32 Bit ARM support on newer dev boards (like Nano, Xavier) - Jetson AGX Xavier - NVIDIA Developer Forums and Build/Run 32bit application on Tx2 - #2 by linuxdev - Jetson TX2 - NVIDIA Developer Forums.

1 Like

Worked like a charm! Thanks for your help, Max!
Regards Christian