These are chat archives for esp8266/Arduino

4th
Nov 2015
onkelfunny
@onkelfunny
Nov 04 2015 20:41
Hello. Where is the correct directory for the esp8266fs.jar on os x? I put it to HOME/Documents/Arduino/tools but without luck
Ivan Grokhotkov
@igrr
Nov 04 2015 20:42
I have this esp8266fs.jar in ~/Documents/Arduino/tools/ESP8266FS/tool/esp8266fs.jar
This is mentioned in reference:
Unpack the tool into `tools` directory (the path will look like `<home_dir>/Arduino/tools/ESP8266FS/tool/esp8266fs.jar`)
kathir1951
@kathir1951
Nov 04 2015 20:44
hi to all .I urgently need help .I was porting esphttpd projrct using sdk to Arduino IDE USING native C code of ESP8266 .I want to upload webpage.espfs at location 0x12000. Since Arduino uploads single bin file at location 0x00000.i cannot upload weppage.espfs at location 0x1200 . Can any one guide me how to spilit single arduino bin one at location 0x00000 and another at 0x40000 using changes in platform.text Pl suggest and method to change
onkelfunny
@onkelfunny
Nov 04 2015 20:45
@igrr thanks now it works
but

/code
[SPIFFS] data : /Users/waldemar/Documents/Arduino/WordClock/data
[SPIFFS] size : 3052
[SPIFFS] page : 256
[SPIFFS] block : 8192
/data.img
[SPIFFS] upload : /var/folders/_n/sy8p0xjs0dlffvp139xmn9qm0000gn/T/build7861671219293661246.tmp/WordClock.spiffs.bin
[SPIFFS] reset : nodemcu
[SPIFFS] port : /dev/cu.SLAB_USBtoUART
[SPIFFS] speed : 115200
[SPIFFS] address: 0x100000

Uploading 3125248 bytes from /var/folders/_n/sy8p0xjs0dlffvp139xmn9qm0000gn/T/build7861671219293661246.tmp/WordClock.spiffs.bin to flash at 0x00100000
warning: espcomm_send_command: didn't receive command response
warning: espcomm_send_command(FLASH_DOWNLOAD_BEGIN) failed
SPIFFS Upload failed!

Ivan Grokhotkov
@igrr
Nov 04 2015 20:46
@kathir1951 you need a bit more than just changes to platform.txt.
Linker scripts have to be changed as well
I think it might be easier to place this weppage.espfs into a different location
i.e. into the space reserved for SPIFFS
@onkelfunny does this happen every time? I get this FLASH_DOWNLOAD_BEGIN failed error once in a while, but usually giving it another attempt helps
that's using nodemcu on OS X as well
kathir1951
@kathir1951
Nov 04 2015 20:49
@igrr yes possible then i have to change libhttpd.a can you give the location reserved for SPIFS
onkelfunny
@onkelfunny
Nov 04 2015 20:50
yes every time. i also tried the manual boot loader mode
Ivan Grokhotkov
@igrr
Nov 04 2015 20:51
@kathir1951 depends on the flash size you choose in Arduino Tools menu.
kathir1951
@kathir1951
Nov 04 2015 20:52
@igrr some clues for reserved location
Ivan Grokhotkov
@igrr
Nov 04 2015 20:52
for 4 Mbyte flash you dive into https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.4m.ld and see
PROVIDE ( _SPIFFS_start = 0x40300000 );
PROVIDE ( _SPIFFS_end = 0x405FB000 );
for 512k (64 k SPIFFS) option you open https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld/eagle.flash.512k64.ld and see
PROVIDE ( _SPIFFS_start = 0x4026B000 );
PROVIDE ( _SPIFFS_end = 0x4027B000 );
flash is memory mapped at 0x40200000, so to get flash offset you need to subtract that number
i.e. 0x6b000 — 0x7b000 for 512k option and 0x100000 — 0x3fb000 for 4m option
@onkelfunny let's try increasing flash erase timeout
could you build esptool from source or is it too much to ask?
if not, i'll build it for you and send you a binary :)
kathir1951
@kathir1951
Nov 04 2015 20:56
@igrr Thanks
onkelfunny
@onkelfunny
Nov 04 2015 20:56
@igrr i set the spiffs to 1M and the upload works
Ivan Grokhotkov
@igrr
Nov 04 2015 20:57
yes then it's related to flash erase time for sure.
onkelfunny
@onkelfunny
Nov 04 2015 20:57
ok
i try to compile it
currently it's hard-coded at 10 seconds
try increasing this to 15 seconds perhaps?
onkelfunny
@onkelfunny
Nov 04 2015 20:58
ok, will do
Markus
@Links2004
Nov 04 2015 20:59
@igrr thanks for adding :)
Ivan Grokhotkov
@igrr
Nov 04 2015 21:02
@Links2004 you're welcome
I figured out I'm not always around to merge and fix things, so it would be nice if someone else had access to the repository as well.
kathir1951
@kathir1951
Nov 04 2015 21:07
@igrr I am using 512k chip can you suggest how to modify linker script for 2 bin files one at location 0x0000 and 0x40000 since web pages.espfs occupies more I though of using free location between 0x12000 - 0x2e000
onkelfunny
@onkelfunny
Nov 04 2015 21:07
@igrr
int timeout_ms = 15000;
works fine. thanks!!
kathir1951
@kathir1951
Nov 04 2015 21:08
@igrr Nice to hear
@igrr Just as a learner I need your help
Ivan Grokhotkov
@igrr
Nov 04 2015 21:09
which segments do you want at 0x00000 and at 0x40000?
currently the segments are mapped as follows (platform.txt, line 78):
-eo "{runtime.platform.path}/bootloaders/eboot/eboot.elf" -bo "{build.path}/{build.project_name}.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bp 4096 -ec -eo "{build.path}/{build.project_name}.elf" -bs .irom0.text -bs .text -bs .data -bs .rodata -bc -ec
so we have .text segment of bootloader, padded to 4096 bytes, and then .irom0.text, .text, .data, .rodata segments of the application
So you can try moving .irom0.text out of this binary
Ivan Grokhotkov
@igrr
Nov 04 2015 21:18
i.e.
-eo "{build.path}/{build.project_name}.elf" -bo "{build.path}/{build.project_name}_00000.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bs .data -bs .rodata -bc -ec -eo "{build.path}/{build.project_name}.elf" -es .irom0.text "{build.path}/{build.project_name}_10000.bin" -ec
kathir1951
@kathir1951
Nov 04 2015 21:20
@igrr I want code/data( RAM? ) at 0x00000 and core/data(rom?) at 0x40000
Ivan Grokhotkov
@igrr
Nov 04 2015 21:20
remember to fix .irom0.text segment location in the linker script. by default it starts at 0x40201010, so you have to change that to 0x40210000 and adjust the length appropriately
just remember that this change will break OTA, because OTA implementation expects a single binary
onkelfunny
@onkelfunny
Nov 04 2015 21:28
@igrr is the spiffs function not recursive ?
./index.html
./js
./js/jquery.js
./ms
./ms/de_ch.json
./ms/de_de.json
only the index.html is uploaded
Ivan Grokhotkov
@igrr
Nov 04 2015 21:30
recursion was added in mkspiffs 1.2, and the latest boards manager package is still on 1.1
so if you are using boards manager package, it's not yet supported
onkelfunny
@onkelfunny
Nov 04 2015 21:31
ok. i can just replace the mkspiffs... correct?
Ivan Grokhotkov
@igrr
Nov 04 2015 21:32
as a workaround, you may try using git version. it got much simpler now: https://github.com/esp8266/Arduino#using-git-version-
replacing mkspiffs is not okay, because mkspiffs 1.1 used spiffs 0.3.2, while mkspiffs 1.2 uses spiffs 0.3.3
so you need a corresponding update of spiffs library in the core itself
that's why i suggest trying git version as described in the link above
this will bring you latest mkspiffs and the core itself
just be sure to remove boards manager package first, or it will override whatever happens to be in hardware directory
onkelfunny
@onkelfunny
Nov 04 2015 21:34
i created a symlink to the current version... now it works for me. thanks!