Esp8266 upload problem: tool-mkspiffs

PackageManager: Installing tool-mkspiffs @ ~1.200.0
Error: Could not find a version that satisfies the requirement ‘~1.200.0’ for your system ‘linux_x86_64’

Please let me know why this is not working?

Fixed. Please try again.

Hi,

I have the same issue with “freebsd_amd64”. The files are not in bitbucket for ~1.200.0. How is the build triggered?

Please download https://github.com/igrr/mkspiffs/archive/0.2.0.zip and compile it. Pack the binary and share somewhere. Please provide a link here to the final binary. We will make a package and deploy it to our storage.

I have a similar problem on my Pinebook Pro where tool-mkspiffs is installed, but for some reason it’s a 32-bit binary, so it doesn’t work. Unfortunately, if I build mkspiffs myself (either from the ZIP-file you linked or from the upstream master branch) I only get broken SPIFFS images which appear empty to the ESP8266.

I really need the possibility to upload SPIFFS images (I know it’s deprecated but there are no real solutions yet, right?), so how could I do that?

PS: Thank you very much for PlatformIO, it’s awesome!

1 Like

Shouldn even ARM64 processors have backwards compatibility with 32-bit ARM binaries? Can you share the error message and exact platform you’re on (e.g. the ~/.platformio/packages/tool-mkspiffs/package.json should contain the architecture)

My ~/.platformio/packages/tool-mkspiffs/package.json:

{
    "description": "Tool to build and unpack SPIFFS images",
    "name": "tool-mkspiffs",
    "system": [
        "linux_armv6l",
        "linux_armv7l",
        "linux_armv8l",
        "linux_aarch64"
    ],
    "url": "https://github.com/igrr/mkspiffs",
    "version": "1.200.0"
}

Some information:

➤  uname -a
Linux yann-pinebook 5.7.0-2-MANJARO-ARM #1 SMP Sat Jun 13 15:24:39 +03 2020 aarch64 GNU/Linux
➤  md5sum mkspiffs 
dee594936bc6d803f95aa71f9c744c9e  mkspiffs
➤  ./mkspiffs 
zsh: no such file or directory: ./mkspiffs
➤  file mkspiffs                                                        
mkspiffs: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 2.6.26, BuildID[sha1]=269afd7bde13f332f303f7607f8bc70520f20d83, stripped
➤  ls /lib/ld-linux*                                                    
/lib/ld-linux-aarch64.so.1

So mkspiffs is compiled for armhf, not aarch64.

Hm there’s some indication that AArch64 is able to run ARMHF binaries, see linux - Running 32-bit ARM binary on aarch64 not working despite CONFIG_COMPAT - Stack Overflow and https://forum.odroid.com/viewtopic.php?t=18806.

Can you try running

sudo dpkg --add-architecture armhf
sudo apt-get update
sudo apt-get install libc6:armhf

to add the 32-bit binaries compatibility layer as a workaround?

Nope, can’t. It’s Manjaro, thus Arch-based, so no apt-get and obviously no simple 32-bit layer: running 32 bit arm

But the question is rather, what’s going on here?

The package.json mentions a version of 1.200.0, but the upstream repository’s latest release is just 0.2.3? Is the 1.200.0 some kind of internal PlatformIO versioning?

And why does the compiled-from-source mkspiffs binary produce broken SPIFFS images?

Really strange…

Ah, too bad… the above linkes really indicated that you could theoretically run it. Running /lib/ld-linux-aarch64.so.1 <path to mkspiffs> also doesn’t cut it I guess.

1.200.0 is PIO-internal versioning, meaning 2.0.0 is the underlying tool version of mkspiffs. Maybe a that source version works?

You can also do some self-testing, I think mkspiffs has switches to not only create but list the contents of a SPIFFS image.

1 Like

I’ve compiled both v0.2.0 and v0.2.3 on my PBP and they at least run and as far as the tool is concerned appear to be making valid images, but I don’t have a ready project at hand that I can test it on to see if SPIFFS is valid on the ESP8266. Would you mind trying out the two binaries and seeing if you have any luck with either version?

https://dl.bintray.com/pfeerick/aarch64/mkspiffs-0.2.0/mkspiffs

https://dl.bintray.com/pfeerick/aarch64/mkspiffs-0.2.3/mkspiffs

Edit: There may be no point… I had enough time to shove the Graph example into PlatformIO and run it in SPIFFs mode, and the PBP/aarch64 built SPIFFS fs wouldn’t load, but the x86_64 built one did. A comparison of the SPIFFS files generated by the two does show some variance, so it looks like something isn’t being done right when either mkspiffs is compiled or run on aarch64! :cry:

Yes, that’s also the conclusion I came to. What a pity…

So we can now either:

  • try to use QEMU in user mode to run the x86_64 binary under aarch64 (Does anyone know how to do that?)
  • wait for a proper SPIFFS replacement that is built into PlatformIO (i.e. LittleFS that can be uploaded with -t uploadfs), AFAIK that doesn’t exist yet?

LittleFS support is in the development branch, but hasn’t made a release version yet. So you’d need to use the staging version of platform-espressif8266 if you wanted the LittleFS option.

Actually, I had a closer look at the build settings, and I think not settings these flags may have been the issue.

BUILD_CONFIG_NAME="-arduino-esp8266" CPPFLAGS="-DSPIFFS_USE_MAGIC_LENGTH=0 -DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=1"

Try this binary, which is working for me on the PBP now with that Graph example…

https://dl.bintray.com/pfeerick/aarch64/mkspiffs-0.2.3-arduino/mkspiffs

If that works, I’ll ask Ivan to add that for that aarch64 support…

It works! Now I see these build instructions in the repo. Thanks for the hint. Now I can work again, thanks!

1 Like

Fantastic. Thanks for the feedback! :slight_smile:

@ivankravets Here are aarch64/arm64 binaries for versions 0.2.0 and 0.2.3 of tool-mkspiffs, natively compiled with the following build flags (needed to work with the arduino-esp8266 core) and tested on a Pinebook Pro (Manjaro, 5.7.0.1, aarch64, platform-espressif8266@2.5.3)

BUILD_CONFIG_NAME="-arduino-esp8266" CPPFLAGS="-DSPIFFS_USE_MAGIC_LENGTH=0 -DSPIFFS_ALIGNED_OBJECT_INDEX_TABLES=1"
1 Like

Thanks! Could you prepare TAR.GZ for each version? See how package is organized Service End for Bintray, JCenter, GoCenter, and ChartCenter | JFrog

I don’t know what to do with your 1 binary. I checked packages for macOS and they contains 3 binaries. I don’t remember what was the reason and what is a reason between these binaries. I remember Arduino IDE used different binaries for Arduino, ESP-IDF, etc.

1 Like

Sure, can do that. Might be a couple of days though, so I’ll ping you again when it’s done. I’ll build the other versions as well, then, as it looks like the Arduino ESP8266, Arduino ESP32 and ESPIDF ESP32 all use different settings which are set at compile time, because, you know, why not add more confusion to the mix! :laughing:

So with the Espressif 8266 dev-platform update to 2.6.0 today, LittleFS is now supported and everything works, also on my Pinebook :partying_face:

Could’ve saved me some hours of troubleshooting if I knew that this update came that fast :wink:

1 Like

lol… indeed… it’s been there in the development branch since the 27th of May, but was held back, and in my view the re-tweaked implementation they went with is much better (making it default to SPIFFS for now, in line with the ESP8266Arduino core only depreciating, not discontinuing SPIFFS, but also being able to now use LittleFS natively).