element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Blog Using SPIFFS with SparkFun ESP8266 Thing Dev
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ms_koster
  • Date Created: 17 Oct 2017 3:38 PM Date Created
  • Views 991 views
  • Likes 6 likes
  • Comments 2 comments
Related
Recommended

Using SPIFFS with SparkFun ESP8266 Thing Dev

ms_koster
ms_koster
17 Oct 2017

If you've ever tried to use SPIFFS on the Dev version of the SparkFun ESP8266 Thing, you will quite likely have encountered the error message "SPIFFS Not Defined for SparkFun ESP8266 Thing Dev" as soon as you tried to upload a disk image using the ESP8266 Sketch Data Upload tool from the Arduino environment. This blog has some background info on this, but for those who are impatient, I'll give you the solution first.

image

The Problem

The SparkFun ESP8266 Thing Dev board definition is missing some essential details for the SPIFFS Data Upload tool to work correctly. Why SparkFun didn't include these in the board files is beyond me, there seems to be no technical reason behind it. Maybe it was just forgotten and maybe it will be fixed in the future. Maybe it is already fixed by the time you read this :-)

 

The Solution

Very simple: add the missing details. First locate your ESP8266 boards definition file. Under Windows, it should be in C:\Users\<your user name>\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\boards.txt. First make a copy of this file, could be handy in case things get messed up. Open this file with an editor that can deal with non-DOS line endings, such as WordPad. You will find using Notepad (Windows' default choice for a .txt file) confusing since it won't show the lines properly.

In the boards.txt file, look for the line that starts with "thingdev.build.flash_freq" (Use Ctrl-F for this or you will spend a long time scrolling and looking). This brings you straight into the right spot in the right section for the SparkFun Thing Dev board. Now right below this line, add the following lines:

 

thingdev.build.spiffs_start=0x6B000

thingdev.build.spiffs_end=0x7B000

thingdev.build.spiffs_blocksize=4096

thingdev.build.spiffs_pagesize=256

 

Save the boards.txt file, reboot the Arduino environment and now the upload tool should be working fine. Bear in mind though that the SPIFFS Data Upload Tool is famous for giving problems when being used while the Arduino Serial Monitor is active, so make sure that the latter is closed, or not even started to begin with.

Congratulations, you now have a working setup for a SPIFFS Data Upload transaction on your SparkFun ESP8266 Thing Dev board. If you have no clue what just happened here, read the background info below.

 

SPIFFS, is that some kind of TV Snack?

In the case of ESP8266 based boards, it is a piece of magic to use part of your EEPROM as some sort of external hard disk. From the firmware on your board, you can access files and even modify them, and since they are stored on EEPROM, changes will survive power cycles. It is also possible to write an entire disk image to the ESP8266 in a way similar to programming the software into your board. For this, you create a subdirectory "Data" in the folder of your sketch and then you put all the neccessary files in that folder. Do not create any subdirectories in the Data folder as the SPIFFS tooling is simple and won't deal with subdirs. Once you're ready putting the files in that Data folder, you can upload them to your board by selecting Tools / ESP Sketch Data Upload in your Arduino environment.
The upload tool can be obtained from here: https://github.com/esp8266/arduino-esp8266fs-plugin and a nice overview of how to use SPIFFS can be found here: http://www.instructables.com/id/Using-ESP8266-SPIFFS/Having a file system available on a board like this could be handy for a number of reasons. Using the ESP8266 as a web server comes to mind first, although I think for that you shouldn't go with a SparkFun board for that application (see also "A word of warning" further down below). But these "Things" are meant to be used as IoT boards and it is getting more common for IoT back-end servers to require certificates for things to authenticate to that server. Being able to put certificates in a simple file system is more practical than putting them in code as some sort of string constant.

 

To Dev Or Not To Dev, what's the difference?

This has been confusing some people for a while already, so don't feel ashamed :-) The difference is not that big, but the regular Thing assumes you have a USB to Serial converter for programming and preferably one with a specific pinout, so it can be hooked up straight to some of the Thing's external connectors. So it DOES have a USB connector, but this does nothing beyond powering the board from it. The Dev version has an onboard FTDI chip, which does that USB to Serial converting magic for you. In other words, the dev board can be programmed directly through the USB connector. There are some other minor differences in the implementations of the programming in respect to the Auto Reset / Auto programming circuitry, but you probably won't be to interested in that. What matters here is that for both boards, the ESP8266 is automatically put in programming mode by the Arduino Environment, so no need for these finger twitching toggle-reset-while-holding-down-prog-button exercises.
Looking further into the schematics, you will find that the Dev version sacrificed the LiPo charging functionality for the  built-in USB converter. If you really need that LiPo charger, you're probably best off developing on a Dev board and then go through the USB to Serial hassle once with a regular Thing.

 

A word of warning on SPIFFS and the SparkFun Thing boards

The SparkFun ESP8266 Thing boards have many qualities, but EEPROM size is not one of them. In total, there is only 512 KB available, of which supposedly 64 KB are available for your SPIFFS filesystem. This can probably tweaked in some ways, but you will quite likely need most of that EEPROM for your software, leaving that mere 64 kB for your files. You can't really do much about it until you take out your soldering equipment and replace the EEPROM chip for a larger one. In which case you might just as well order an ESP8266 board from another supplier, that comes with a bigger EEPROM chip straightaway.

  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 8 years ago +1
    This is good information for the users of this board. I was wondering, could someone explain the product? 'm not sure I understand it: ( Sparkfun took the idea of a product that retails for about $3, and…
  • ms_koster
    ms_koster over 8 years ago in reply to shabaz +1
    Interesting question, actually. For some people, the extra holes are probably worth the $15 markup. For most buyers, I guess it's the whole package. Reliable supply, ready out of the box (although you…
  • ms_koster
    ms_koster over 8 years ago in reply to shabaz

    Interesting question, actually. For some people, the extra holes are probably worth the $15 markup. For most buyers, I guess it's the whole package. Reliable supply, ready out of the box (although you still have to solder the headers on the PCB) and their website has very structured information that will get you started right away. Should work great for hobbyists who'd rather spend money than time figuring out too many details on how to get an ESP8266 to work.

     

    For me, these boards came with IoT starter kits. I use them for prototyping, currently have some sitting at a production site for temperature measurements. But for the reason you mentioned (and a few more, such as memory and specific functionality) I'm going to design a specific PCB for this application as soon as prototyping is finished.

     

    I'm not aware of any adapter boards like you mentioned, but please bear in mind that ESP8266 is just a chip, that not many people buy. Instead they buy a module that has the ESP8266 on it. These modules come in many shapes and the one from SparkFun is just one of them, if you're looking for one that breaks out some pins of the ESP on a 2.54 mm pitch, I'm sure you will find cheaper alternatives.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 8 years ago

    This is good information for the users of this board. I was wondering, could someone explain the product? 'm not sure I understand it: ( Sparkfun took the idea of a product that retails for about $3, and changed it into a $18 product by adding 2.54mm spaced holes?

    Are there no adapter boards for less than this, surely any PCB manufacturer can churn out adapter PCBs for $0.10, allowing users to solder on their $3 ESP8266 boards in about 60 seconds, there are only a couple of dozen connections I thought?  (I'm not super familiar with the ESP8266, apologies if I've misunderstood the product).

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube