Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By brutzler
#25506 OK,
never used esptool.py :-(
On firmware-uploading (before arduino+esp8266) I used another download tool. "ESP Flash Download Tool V0.9.3.1" Unfortunately never found an upread :-(
But I have seen, that esptool.py is running on windows too, only needs Python.

Is there any other GUI for it?
On AVR-times, Software like myAVR-Progtool was my favorite. You easy could read and write flash/Eprom and had an HEX-Editor integrated :-) http://shop.myavr.de/pic/tools/progtool_auslesen_g.png

mkspiffs: Is the following right?
- txt-file into mkspiffs: The result will be a bin file.
- This can be downloaded to the flash with a flashtool like esptool.
But: what offset? If I take offset 0x0h, than it will overwrite my "normal" program. And when i take a random offset, does SPIFFS find the files?
User avatar
By martinayotte
#25528
brutzler wrote:OK,
never used esptool.py :-(
On firmware-uploading (before arduino+esp8266) I used another download tool. "ESP Flash Download Tool V0.9.3.1" Unfortunately never found an upread :-(
But I have seen, that esptool.py is running on windows too, only needs Python.

Is there any other GUI for it?
On AVR-times, Software like myAVR-Progtool was my favorite. You easy could read and write flash/Eprom and had an HEX-Editor integrated :-) http://shop.myavr.de/pic/tools/progtool_auslesen_g.png

mkspiffs: Is the following right?
- txt-file into mkspiffs: The result will be a bin file.
- This can be downloaded to the flash with a flashtool like esptool.
But: what offset? If I take offset 0x0h, than it will overwrite my "normal" program. And when i take a random offset, does SPIFFS find the files?


About esptool.py, yes it requires Python.

But there is also the esptool from IGRR, which is located in your Arduino installation.

For mkspiffs, it takes the contents of a specified folder, grad all the files present and create spiffs.bin
For the upload of this bin, yes, you need to specify the right offset, which depends of the layout chosen in ArduionoIDE, for example, For "Generic / 512K - SPIFFS-64K", the offset is 0x6B000.
Those offsets are defined in hardware/esp8266/1.6.5-947-g39819f0/boards.txt
User avatar
By igrr
#25545 The main issue with mkspiffs + esptool is that upload time for the very typical 4Mb flash is quite long — on the order of minutes :(

I'll see if I can make esptool a bit smarter — i.e. not to transfer parts of binary image which are just 0xff.

There is also an ESP8266FS tool — essentially an Arduino plugin which runs mkspiffs and esptool with the right arguments. I'll add instructions to install it once the main issue with upload time is fixed.
User avatar
By martinayotte
#25547 Hi IGRR,

since you are there, I couldn't make the upload successful yet.
I see in mkspiffs that defaults for PageSize=256 and BlockSize=4096.
When I upload this image into my ESP, it looks corrupted and been reformatted.
I've added traces in the SPIFFS.begin(), and it looks like those parameters are different, explaining probably the previous behavior. the trace shows :
Code: Select allSPIFFSImpl: allocating 512+180+1400=2092 bytes
SPIFFSImpl: mounting fs @6b000, size=4000, block=1000, page=100
SPIFFSImpl: mount rc=0

The problem is I didn't find yet where the default "size=4000, block=1000" are coming from.
Could you give me hint ?
Is it normal that defaults are not the same in ESP code and mkspiffs tools, that would be easier ?

EDIT : Shame on me, the traces are in HEX not Decimal ... ;)
So, the settings are matching ! But still, why the SPIFFS been reformatted ?
Here the trace just after the upload, first mount failed, then reformat, than second mount succeed ...

Code: Select allSPIFFSImpl: allocating 512+180+1400=2092 bytes
SPIFFSImpl: mounting fs @6b000, size=4000, block=1000, page=100
SPIFFSImpl: mount rc=-1
SPIFFSImpl: mounting fs @6b000, size=4000, block=1000, page=100
SPIFFSImpl: mount rc=0


EDIT2: Just got it !!! :)
in mkspiffs github, the spiffs_config.h has the following define set to 0, which probably means "unformatted", by changing it to 1, it works ! ... (I will submit that to IGGR when I get a chance, after my pending PRs)

Code: Select all#define SPIFFS_USE_MAGIC                (0)

Now I get my uploaded SPIFFS showing correctly :
Code: Select allSPIFFSImpl: allocating 512+180+1400=2092 bytes
SPIFFSImpl: mounting fs @6b000, size=4000, block=1000, page=100
SPIFFSImpl: mount rc=0
/metalic.png - 1405
/Tourlou.txt - 1428
/README.md - 1428


EDIT3: I should not clame victory too soon !
Having added some images, I got probably corrupted SPIFFS image, because it is showing only 2 files :
Code: Select allSPIFFSImpl: allocating 512+180+1400=2092 bytes
SPIFFSImpl: mounting fs @6b000, size=4000, block=1000, page=100
SPIFFSImpl: mount rc=0
/green_led.jpg - 2023
/gray_led.jpg - 5344

But my folder is :
Code: Select all-rw-rw-r-- 1 martin martin 5344 Aug 10 15:32 gray_led.jpg
-rw-rw-r-- 1 martin martin 2023 Aug 10 15:32 green_led.jpg
-rwxrwxr-x 1 martin martin 1405 Aug 10 15:32 metalic.png*
-rw-rw-r-- 1 martin martin 1428 Aug  9 22:44 README.md
-rw-rw-r-- 1 martin martin 1917 Aug 10 15:32 red_led.jpg
-rw-rw-r-- 1 martin martin 1428 Aug  9 22:44 Tourlou.txt
-rw-rw-r-- 1 martin martin 2071 Aug 10 15:32 yellow_led.jpg


Searching on the net, I see that Peter Andersson (pellepl) have done some changes in spiffs github, maybe IGRR didn't get chance to grab those ...

EDIT4:
BTW, another relevant thing I've face during this investigation :
Trying to upload my spiffs image with "esptool.py", it is somehow corrupt my already installed firmware, but the same upload using IGRR's esptool does not. (after the upload, I wasn't able to connect to Wifi without a crash, even after clearing the Wifi settings using blink.bin, I had to re-upload my firmware ... :( )
Code: Select allesptool.py --port /dev/ttyUSB0 write_flash 0x6B000 myspiffs.bin

Code: Select allesptool -vv -cd ck -cb 115200 -cp /dev/ttyUSB0 -ca 0x6B000 -cf myspiffs.bin


EDIT5:
Oh !!! some interesting finding ! the bug mentioned above when I've added files, looking at the file list, I saw that one file was bigger then 4096 bytes, I've delete it, redo the image, upload and Bingo :) , all other files were there. So, there is a bug with files bigger than 4096 bytes ! :?