Implement uploading files to file system SPIFFS for ESP8266 // Issue #382

This commit is contained in:
Ivan Kravets
2015-12-28 01:15:06 +02:00
parent d7673b69e2
commit cae5f1f553
14 changed files with 171 additions and 39 deletions

View File

@@ -55,6 +55,10 @@ Allows to override :ref:`projectconf` option :ref:`projectconf_pio_src_dir`.
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_envs_dir`.
.. envvar:: PLATFORMIO_DATA_DIR
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_data_dir`.
Builder
-------

View File

@@ -113,6 +113,9 @@ Packages
* - ``tool-micronucleus``
- `Micronucleus <https://github.com/micronucleus/micronucleus>`_
* - ``tool-mkspiffs``
- `Tool to build and unpack SPIFFS images <https://github.com/igrr/mkspiffs>`_
* - ``tool-mspdebug``
- `MSPDebug <http://mspdebug.sourceforge.net/>`_

View File

@@ -28,21 +28,24 @@ Packages
* - Name
- Contents
* - ``toolchain-xtensa``
- `xtensa-gcc <https://github.com/jcmvbkbc/gcc-xtensa>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``tool-esptool``
- `esptool-ck <https://github.com/igrr/esptool-ck>`_
* - ``tool-mkspiffs``
- `Tool to build and unpack SPIFFS images <https://github.com/igrr/mkspiffs>`_
* - ``framework-arduinoespressif``
- `Arduino Wiring-based Framework (ESP8266 Core) <https://github.com/esp8266/Arduino>`_
* - ``ldscripts``
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
* - ``sdk-esp8266``
- `ESP8266 SDK <http://bbs.espressif.com>`_
* - ``tool-esptool``
- `esptool-ck <https://github.com/igrr/esptool-ck>`_
* - ``framework-arduinoespressif``
- `Arduino Wiring-based Framework (ESP8266 Core) <https://github.com/esp8266/Arduino>`_
* - ``toolchain-xtensa``
- `xtensa-gcc <https://github.com/jcmvbkbc/gcc-xtensa>`_, `GDB <http://www.gnu.org/software/gdb/>`_
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).

View File

@@ -23,6 +23,7 @@ from :ref:`projectconf`
upload_speed = 9600
.. _platform_espressif_customflash:
Custom Flash Size
-----------------
@@ -39,8 +40,6 @@ The list with preconfigured LD scripts is located in public repository
* ``esp8266.flash.2m.ld`` 2M (1M SPIFFS)
* ``esp8266.flash.4m1.ld`` 4M (1M SPIFFS)
* ``esp8266.flash.4m.ld`` 4M (3M SPIFFS)
* ``esp8266.flash.8m.ld`` 8M (7M SPIFFS)
* ``esp8266.flash.16m.ld`` 16M (15M SPIFFS)
To override default LD script please use :ref:`projectconf_build_flags` from
:ref:`projectconf`.
@@ -50,6 +49,18 @@ To override default LD script please use :ref:`projectconf_build_flags` from
[env:myenv]
build_flags = -Wl,-Tesp8266.flash.4m.ld
.. _platform_espressif_uploadfs:
Uploading files to file system SPIFFS
-------------------------------------
1. Put files to :ref:`projectconf_pio_data_dir`
2. Run target ``uploadfs`` via :option:`platformio run --target` command.
By default, will be used default LD Script for the board where is specified
SPIFFS flash data (start, end, page, block). You can override it using
:ref:`platform_espressif_customflash`.
Over-the-Air (OTA) update
-------------------------

View File

@@ -115,6 +115,18 @@ This option can be overridden by global environment variable
are defined in :ref:`projectconf`, then **TRY TO DELETE** this folder. In
this situation you will remove all cached files without any risk.
.. _projectconf_pio_data_dir:
``data_dir``
^^^^^^^^^^^^
Data directory to store contents and :ref:`platform_espressif_uploadfs`.
A default value is ``%project_dir%/data``.
This option can be overridden by global environment variable
:envvar:`PLATFORMIO_DATA_DIR`.
[env:NAME]
----------
@@ -463,8 +475,9 @@ Example, specify own upload command for :ref:`platform_atmelavr`:
^^^^^^^^^^^
A list with targets which will be processed by :ref:`cmd_run` command by
default. You can enter more than one target separated with "space". Which
targets are supported is described in :option:`platformio run --target`.
default. You can enter more than one target separated with "space".
The list with available targets is located in :option:`platformio run --target`.
**Tip!** You can use these targets like an option to
:option:`platformio run --target` command. For example:

View File

@@ -53,6 +53,7 @@ Pre-built targets:
* ``program`` firmware "auto-uploading" for embedded platforms using external
programmer (available only for :ref:`platform_atmelavr`)
* ``uploadlazy`` upload existing firmware without project rebuilding
* ``uploadfs`` :ref:`platform_espressif_uploadfs`
* ``envdump`` dump current build environment
* ``size`` print the size of the sections in a firmware/program