diff --git a/pkg/spiffs/Makefile b/pkg/spiffs/Makefile
index d40ea98d327bccad525fde4cdb1c7f0a06519d51..ee77abd5eb05ab0c598879ea7901ec01394c8136 100644
--- a/pkg/spiffs/Makefile
+++ b/pkg/spiffs/Makefile
@@ -1,6 +1,6 @@
 PKG_NAME=spiffs
 PKG_URL=https://github.com/pellepl/spiffs.git
-PKG_VERSION=39937743fbbec4b82308ee08332bf9180408d23b
+PKG_VERSION=287148c46587089c4543a21eef2d6e9e14b88364
 PKG_BUILDDIR ?= $(PKGDIRBASE)/$(PKG_NAME)
 
 CFLAGS += -std=c11
diff --git a/pkg/spiffs/include/spiffs_config.h b/pkg/spiffs/include/spiffs_config.h
index 892b271df2dcd8eb28d0f52720d3c9a17bb035a3..c9a86109f9a3498efd822619c39160bdab36b1ea 100644
--- a/pkg/spiffs/include/spiffs_config.h
+++ b/pkg/spiffs/include/spiffs_config.h
@@ -53,19 +53,57 @@ extern "C" {
 
 // Set generic spiffs debug output call.
 #ifndef SPIFFS_DBG
-#define SPIFFS_DBG(...) //DEBUG(__VA_ARGS__)
+#define SPIFFS_DBG(...) //printf(_f, ## __VA_ARGS__)
 #endif
 // Set spiffs debug output call for garbage collecting.
 #ifndef SPIFFS_GC_DBG
-#define SPIFFS_GC_DBG(...) //DEBUG(__VA_ARGS__)
+#define SPIFFS_GC_DBG(...) //printf(_f, ## __VA_ARGS__)
 #endif
 // Set spiffs debug output call for caching.
 #ifndef SPIFFS_CACHE_DBG
-#define SPIFFS_CACHE_DBG(...) //DEBUG(__VA_ARGS__)
+#define SPIFFS_CACHE_DBG(...) //printf(_f, ## __VA_ARGS__)
 #endif
 // Set spiffs debug output call for system consistency checks.
 #ifndef SPIFFS_CHECK_DBG
-#define SPIFFS_CHECK_DBG(...) //DEBUG(__VA_ARGS__)
+#define SPIFFS_CHECK_DBG(...) //printf(_f, ## __VA_ARGS__)
+#endif
+// Set spiffs debug output call for all api invocations.
+#ifndef SPIFFS_API_DBG
+#define SPIFFS_API_DBG(...) //printf(_f, ## __VA_ARGS__)
+#endif
+
+// Defines spiffs debug print formatters
+// some general signed number
+#ifndef _SPIPRIi
+#define _SPIPRIi   "%d"
+#endif
+// address
+#ifndef _SPIPRIad
+#define _SPIPRIad  "%08x"
+#endif
+// block
+#ifndef _SPIPRIbl
+#define _SPIPRIbl  "%04x"
+#endif
+// page
+#ifndef _SPIPRIpg
+#define _SPIPRIpg  "%04x"
+#endif
+// span index
+#ifndef _SPIPRIsp
+#define _SPIPRIsp  "%04x"
+#endif
+// file descriptor
+#ifndef _SPIPRIfd
+#define _SPIPRIfd  "%d"
+#endif
+// file object id
+#ifndef _SPIPRIid
+#define _SPIPRIid  "%04x"
+#endif
+// file flags
+#ifndef _SPIPRIfl
+#define _SPIPRIfl  "%02x"
 #endif
 
 // Enable/disable API functions to determine exact number of bytes
@@ -137,6 +175,20 @@ extern "C" {
 #define SPIFFS_OBJ_NAME_LEN             (32)
 #endif
 
+// Maximum length of the metadata associated with an object.
+// Setting to non-zero value enables metadata-related API but also
+// changes the on-disk format, so the change is not backward-compatible.
+//
+// Do note: the meta length must never exceed
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + 64)
+//
+// This is derived from following:
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + sizeof(spiffs_page_header) +
+// spiffs_object_ix_header fields + at least some LUT entries)
+#ifndef SPIFFS_OBJ_META_LEN
+#define SPIFFS_OBJ_META_LEN             (0)
+#endif
+
 // Size of buffer allocated on stack used when copying data.
 // Lower value generates more read/writes. No meaning having it bigger
 // than logical page size.
diff --git a/pkg/spiffs/patches/0001-Constify-pointer-for-write-operations.patch b/pkg/spiffs/patches/0001-Constify-pointer-for-write-operations.patch
new file mode 100644
index 0000000000000000000000000000000000000000..3b6002de1015975ecdab064d56cc98b02a0b34df
Binary files /dev/null and b/pkg/spiffs/patches/0001-Constify-pointer-for-write-operations.patch differ
diff --git a/pkg/spiffs/patches/0001-Use-const-pointer-in-write-functions.patch b/pkg/spiffs/patches/0001-Use-const-pointer-in-write-functions.patch
deleted file mode 100644
index 565faf9d6ffdb993eb412c26deb2ecca95c305ef..0000000000000000000000000000000000000000
Binary files a/pkg/spiffs/patches/0001-Use-const-pointer-in-write-functions.patch and /dev/null differ
diff --git a/pkg/spiffs/patches/0002-Use-const-pointer-through-all-write-functions.patch b/pkg/spiffs/patches/0002-Use-const-pointer-through-all-write-functions.patch
deleted file mode 100644
index d5bc913e5e5d183b7459a4798fc4afa5ea425ca3..0000000000000000000000000000000000000000
Binary files a/pkg/spiffs/patches/0002-Use-const-pointer-through-all-write-functions.patch and /dev/null differ