-->
Page 1 of 4

Flash Memory of ESP-12E

PostPosted: Sat Aug 08, 2015 7:06 pm
by brutzler
Thought the ESP-12e has 4M Flash memory?
When I choose the NodeMcu1.0 board (with the 12E) I get this after compiling:

...sketch uses xxx.xxx bytes. Maximum is 1.044.464 Bytes....

Something wrong in the boards-definition?

Re: Flash Memory of ESP-12E

PostPosted: Sat Aug 08, 2015 8:02 pm
by martinayotte
Why are you choosing NodeMcu1.0 board if you module is an ESP-12E ? ;)
Simply choose "Generic ESP8266 Module", another menu will be present where you can choose from 512K to 4M flavor.

Re: Flash Memory of ESP-12E

PostPosted: Sun Aug 09, 2015 2:23 am
by brutzler
martinayotte wrote:Why are you choosing NodeMcu1.0 board if you module is an ESP-12E ? ;)

Hmm... because I have a NodeMCU1.0 board with an ESP-12E. http://www.wemos.cc/ and another one with a different USB-TTL chip.
And i thought when I choose "NodeMCU 1.0 (ESP-12E Module)" from the boards list, then it is ok :roll:
Was afraid, i loose things like auto-bootloader, when I choose something different.

BTW:
What does this mean? 4M (3MSPIFFS) Isn't the whole memory available for flashing code?


EDIT: Even when I take "Generic with 4M Flash-Size" the compiler tells me "... maximum are 1.044.464 Bytes...."

Re: Flash Memory of ESP-12E

PostPosted: Sun Aug 09, 2015 8:51 am
by martinayotte
SPIFFS is a FileSystem that allows to store files directly in Flash instead of having an external SDCard or other storage.

If you don't need that and wish to use the whole Flash for code, it should be possible by creating a new variant board, in the file esp8266/hardware/esp8266/1.6.5-947-g39819f0/boards.txt (path may vary depending of your installation).

In this file, you can copy/paste the "NodeMCU 1.0 (ESP-12E Module)" and create new entry such as "NodeMCU 1.0 (ESP-12E Module) Full 4M". First, in the new entry, all name prefixes such "nodemcuv2." needs to be renamed like "nodemcuv2full4M". Then adjust the line "nodemcuv2full4M.upload.maximum_size=1044464" to some like "nodemcuv2full4M.upload.maximum_size=3932160" (which leaving at least a small place for tiny SPIFFS) . Next, the SPIFF itself need to be relocate as at tiny SPIFFS at the end of the Flash : "nodemcuv2full4M.build.spiffs_start=0x3C0000" and "nodemcuv2full4M.build.spiffs_end=0x3FB000"

Personally, I didn't try the above yet (I will when I get chance), but it should work pretty straight-fully, although there are maybe other changes to do with the linker scripts.