Code Monkey home page Code Monkey logo

spiffy's Introduction

spiffy

No longer maintained. Please see forks for other repos!

Build a spiffs file system binary for embedding/writing onto the nodemcu ESP8266 spiffs file system

What is it

spiffy builds a binary spiffs image for you to write_flash to a esp8266 runing nodemcu so you can get all the files onto your cool IoT device in one fell swoop.

usage

Clone the repo and build spiffy

git clone https://github.com/xlfe/spiffy.git
cd spiffy
mkdir build
make

create a folder with the files you'd like to embed

mkdir files

and add your lua scripts, etc to ./files/

run spiffy to build the rom

$ ./build/spiffy
Creating rom spiff_rom.bin of size 16384 bytes
Adding files in directory files
init.lua added to spiffs (66 bytes)
$ ll *.bin
-rw-rw-r-- 1 build build 16384 Jan  1 21:00 spiff_rom.bin

NB: The default rom size is 16k - you can edit main.c to change this

burn your rom to the esp device

Thanks for the info The offset for spiffs file system:

  • eagle.app.v6.flash.bin: 0x00000~len( eagle.app.v6.flash.bin )
  • eagle.app.v6.irom0text.bin: 0x10000~0x10000 + len( eagle.app.v6.irom0text.bin )
  • spiffs_embed.bin: (0x10000 + lengthof(iromtext) + 0x4000) & (0xFFFFC000)
  • Ie: next to the irom0text.bin, but aligned to 4 * 4096 Bytes (0x4000).

For example:

uild@build:/opt/Espressif/nodemcu-firmware/bin$ ll
drwxrwxr-x  3 build build   4096 Dec 31 16:38 .
drwxrwxr-x 17 build build   4096 Jan  1 20:23 ..
-rw-rw-r--  1 build build  52064 Dec 31 16:25 eagle.app.v6.flash.bin
-rwxrwxr-x  1 build build 293568 Dec 31 16:25 eagle.app.v6.irom0text.bin

So to burn my image I would run:

esptool.py --port /dev/ttyUSB0 write_flash STARTADDR ../../spiffy/spiff_rom.bin
  • Ie: STARTADDR = (0x10000 + lengthof(iromtext) + 0x4000) & (0xFFFFC000)

Done!

spiffy's People

Contributors

xlfe avatar adiea avatar ajaybhargav avatar polkabana avatar vowstar avatar

Stargazers

Keyth M Citizen  avatar HuntEmAll.Dev avatar Sebastian Schröder avatar Christoph Grabo avatar ash avatar  avatar  avatar Nicolás Pace avatar Vjkqxz avatar shrugged avatar  avatar Lukáš Voborský avatar  avatar Ed Wios avatar Joan F Garcia avatar  avatar  avatar AJ Bahnken avatar cctsao1008 avatar Jorge Mesquita avatar Rafael Jesus avatar Reibl János Dániel avatar The Fozzy Bear avatar  avatar FlashSoft avatar Ricardo Meechan avatar Pascal Hirsch avatar Tomáš Procházka avatar Tuan avatar Matt A avatar Martin Bo Kristensen Grønholdt avatar Kalanda avatar Dmitry Kireev avatar yangbo avatar Dennis Marinus avatar Antonio Calatrava avatar  avatar thunder avatar  avatar 尹康凯 avatar Christian Adams avatar Ruslan Ohitin avatar  avatar  avatar Victor Brutskiy avatar

Watchers

Alexander D. Kanevskiy avatar Tomáš Procházka avatar Victor Brutskiy avatar James Cloos avatar  avatar Dennis Marinus avatar Marcin Kornat avatar yangbo avatar  avatar Gargamel avatar  avatar  avatar Don Kinzer avatar  avatar

spiffy's Issues

its not working with new firmware

can you check it?
lengthof(iromtext)=341364 soo flash address= 0x64000 and i am writing this adress and i am getting this.spiff bin contain init.lua,dht11.lua

for n,s in pairs(file.list()) do print(n.." size: "..s) end
� size: 48758784
> 

Can't build on mingw

I'm getting this error when building on Windows (mingw):

... depend build/spiffs_check.d
... depend build/spiffs_cache.d
... depend build/spiffs_hydrogen.d
... depend build/spiffs_gc.d
... depend build/spiffs_nucleus.d
... depend build/main.d
... compile build/main.o
In file included from src/main.c:1:0:
./src/spiffs.h:183:9: error: field '_errno' declared as a function
   s32_t errno;
         ^

License

Could you specify a license for that repository?
I'm assuming it would be a MIT license, because spiffs uses one. Could you add a LICENSE file for clarity?

spiffy & srec_cat question

Thanks for the tool, really nice.
I'm trying to use srec_cat in conjunction with spiffy. I'm building a spiffy_out.bin and trying to add it to a regular nodemcu_release.bin.
I'm getting my offset this way:

main_firmware_offset=0x$(echo "obase=16; $(($(stat -f%z 0x10000.bin)))" | bc)
spiff_start_offset=0x$(echo "obase=16; $(($(stat -f%z 0x10000.bin) + 16384))" | bc)
srec_cat -output nodemcu-firmware.out.bin -binary 0x10000.bin -fill 0xff $main_firmware_offset $spiff_start_offset ${spiff_start_offset}.bin -binary -offset $spiff_start_offset

my errors are:

srec_cat: 0x10000.bin: 1: warning: ignoring garbage lines
srec_cat: 0x10000.bin: 659: hexadecimal digit expected

Thank you!

File size limit?

Uploading a

Creating rom spiff_rom.bin of size 196608 bytes
Adding files in directory files
Unable to read file .
Unable to read file ..
bootstrap.css.gz added to spiffs (15615 bytes)
index.html added to spiffs (2876 bytes)
jquery.js.gz added to spiffs (30153 bytes)

Is there anything that could prevent 30K file to appear on the file system?

Make filesystem size a command line option

It would be a goot idea to have a command line option for the file system size. Editing the source code every time the available space in the NodeMCU flash changes is annoying.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.