ESP8266 SPIFFS

I am trying to incorporate using SPIFFS with "SPIFFS.begin();"
When I start the compiler a large bunch of errors are displayed of which many relate to "spiffs_api.h"in the UECIDE directory.
Would you have a look at at?

Comments

SPIFFS is something I haven't

SPIFFS is something I haven't really tackled yet. Theoretically it should "just work" if it's been set up sanely by the upstream creators. But who knows. I'd like to add an SPIFFS manager to UECIDE at some point so you can easily create and manage SPIFFS files. Maybe have an entry in the left-hand tree would be good. Not sure how I'd do that in a "generic" way since it's only applicable to the ESP families at the moment - although it's quite a cool system and I may port something similar to chipKIT (we already have a flash-based DFATFS volume).

I will have a look at the compilation. It may just be a bunch of warnings, which could be ignored. Or there may be something lacking from the installation.

Oooh, nasty...

Oooh, nasty...

Compiling...
• Preprocessing...
• Converting binary files
• Compiling sketch...
• Compiling core...
‣ esp8266
• Compiling libraries...
• Linking sketch...
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `std::_Sp_counted_deleter<SPIFFSFileImpl*, std::__shared_ptr<SPIFFSFileImpl, (__gnu_cxx::_Lock_policy)0>::_Deleter<std::allocator<SPIFFSFileImpl> >, std::allocator<SPIFFSFileImpl>, (__gnu_cxx::_Lock_policy)0>::_M_destroy()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_info'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::info(fs::FSInfo&)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_info'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN10SPIFFSImpl3endEv[SPIFFSImpl::end()]+0x0): undefined reference to `SPIFFS_mounted'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN10SPIFFSImpl3endEv[SPIFFSImpl::end()]+0x4): undefined reference to `SPIFFS_unmount'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::end()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_mounted'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_unmount'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN13SPIFFSDirImplD2Ev[SPIFFSDirImpl::~SPIFFSDirImpl()]+0x4): undefined reference to `SPIFFS_closedir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSDirImpl::~SPIFFSDirImpl()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_closedir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSDirImpl::~SPIFFSDirImpl()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_readdir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSDirImpl::next()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_readdir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN14SPIFFSFileImpl5writeEPKhj[SPIFFSFileImpl::write(unsigned char const*, unsigned int)]+0x4): undefined reference to `SPIFFS_write'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::write(unsigned char const*, unsigned int)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_write'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_read'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::read(unsigned char*, unsigned int)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_read'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_fflush'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::flush()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_fflush'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_lseek'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::seek(unsigned int, fs::SeekMode)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_lseek'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::position() const':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_lseek'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_close'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::close()':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_close'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZNK14SPIFFSFileImpl8_getStatEv[SPIFFSFileImpl::_getStat() const]+0x4): undefined reference to `SPIFFS_fstat'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSFileImpl::_getStat() const':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_fstat'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `isSpiffsFilenameValid(char const*)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_rename'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::rename(char const*, char const*)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_rename'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_remove'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::remove(char const*)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_remove'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_stat'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::exists(char const*)':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_stat'
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:547: undefined reference to `SPIFFS_open_by_dirent'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `__shared_count':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:443: undefined reference to `SPIFFS_open_by_dirent'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `__shared_ptr<SPIFFSFileImpl, void>':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:799: undefined reference to `SPIFFS_open'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::open(char const*, fs::OpenMode, fs::AccessMode)':
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.cpp:29: undefined reference to `SPIFFS_open'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.cpp:34: undefined reference to `SPIFFS_remove'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.cpp:36: undefined reference to `SPIFFS_open'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `_Sp_counted_base':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:110: undefined reference to `SPIFFS_opendir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `_Sp_counted_deleter':
/home/matt/.uecide/compilers/xtensa-lx106-elf/xtensa-lx106-elf/include/c++/4.8.2/bits/shared_ptr_base.h:341: undefined reference to `SPIFFS_opendir'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN10SPIFFSImpl9_tryMountEv[SPIFFSImpl::_tryMount()]+0x1c): undefined reference to `SPIFFS_buffer_bytes_for_filedescs'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN10SPIFFSImpl9_tryMountEv[SPIFFSImpl::_tryMount()]+0x20): undefined reference to `SPIFFS_buffer_bytes_for_cache'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o):(.text._ZN10SPIFFSImpl9_tryMountEv[SPIFFSImpl::_tryMount()]+0x24): undefined reference to `SPIFFS_mount'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::_tryMount()':
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:197: undefined reference to `SPIFFS_buffer_bytes_for_filedescs'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:202: undefined reference to `SPIFFS_buffer_bytes_for_cache'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:227: undefined reference to `SPIFFS_mount'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:228: undefined reference to `SPIFFS_format'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::begin()':
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:236: undefined reference to `SPIFFS_mounted'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:241: undefined reference to `SPIFFS_format'
/home/matt/.uecide/cache/esp8266/esp8266-d1-mini/libCore_esp8266.a(spiffs_api.cpp.o): In function `SPIFFSImpl::format()':
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:143: undefined reference to `SPIFFS_mounted'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:150: undefined reference to `SPIFFS_unmount'
/home/matt/.uecide/cores/esp8266/esp8266/spiffs_api.h:150: undefined reference to `SPIFFS_format'
collect2: error: ld returned 1 exit status
Compiling Failed

Ok, something must be not included in the linking that needs to be.

Ok, that looked nasty. but

Ok, that looked nasty. but was actually a very simple fix. I basically wasn't compiling the esp8266/spiffs subdirectory of the core. That's been rectified now. A new version of the ESP8266 core has been uploaded.

It should be in the plugin

It should be in the plugin manager. The ESP8266 core should be updatable after you hit refresh.

Pages