after hunting some bugs and stability problems of current nodemcu dev branch down I came to
the conclusion that too many of them seem to be solved when using a newer SDK 1.0.X.
The current dev branch is based on SDK 0.9.5.
Here are just a few:
- http://www.esp8266.com/viewtopic.php?f=18&t=1418
- http://www.esp8266.com/viewtopic.php?f=18&t=2739
- https://github.com/nodemcu/nodemcu-firmware/issues/362
- https://github.com/nodemcu/nodemcu-firmware/issues/360
I started with fork https://github.com/chadouming/nodemcu-firmware by chad cormier roussel (chadouming),
which seems to be ( commit 7755a48382a8ef12c0022f492d7c1c5be5178084):
- based on dev096 branch of official nodemcu repo
- some module deactivated
- a few Makefile fixes
- SDK 1.0 libs (I didn't checked which version)
Unfortunately the binary libs of the SDK need about 4K more data memory which means 17K instead of 21K free heap
space in lua.
This is mostly BSS in the following files: (left: 0.9.5, right 1.0 from above repository, first 4 byte value is size in hex)
libat.a, at_port.o:
3 .bss 00000a9c 00000000 00000000 00000040 2** | 3 .bss 00000e0c 00000000 00000000 00000040 2**
libpp.a, wdev.o:
4 .bss 000041c0 00000000 00000000 00000ef0 2** | 4 .bss 00004e80 00000000 00000000 00001200 2**
I think we cannot ignore SDK 1.0 if don't want to track down already fixed bugs over and over again.
Compiler and linker optimization I can think of seem to be already done.
Some data may be movable to rodata as was already done for some other.
Making it easier for people to customize lua firmware to their needs is one way. As I understood it TerryE works on this.
Strings (some? all?) are already moved to read-only section.
I wonder if we can reduce storage requirement of lua programs if we try to reuse the read only stored strings
when parsing lua programs. (Like using an identity map in java.)
That way the lua modules and programs can use long meaningful names without needing heap memory.
Storing the code of modules in flash is another option (TODO: link to thread needed).
I would like to collect ideas and results of experiments here and probably move them to the wiki
it it seems useful.
What do you think?
Cal