Commit Graph

23 Commits

Author SHA1 Message Date
Damien George
f9ecd484bb esp8266: Change to use new generic VFS sub-system.
The VFS sub-system supports mounting of an arbitrary number of devices
(limited only by available RAM).  The internal flash is now mounted at
"/flash".
2017-01-27 17:21:45 +11:00
Damien George
e343bea6e7 esp8266/modules/flashbdev: Change RESERVED_SECS to 0.
This effectively reverts the change that introduced this new constant.
The reason is so that users do not need to rebuild the filesystem on
their modules when upgrading the firmware.

Users can change RESERVED_SECS by hand if they need the feature, and in
future firmware it may default to a non-zero value.
2017-01-06 18:30:55 +11:00
Damien George
cc7e48fdc8 esp8266/modules/flashbdev: Remove now-unused function set_bl_flash_size. 2017-01-06 16:22:53 +11:00
Paul Sokolovsky
4a72294d7d esp8266/modules/flashbdev: Remove code to patch bootloader flash size.
This code is no longer pertinent for some time - since switchover to
SDK2.0, there must be correct flash size set for bootloader, or there's
a risk of flash data corruption. And indeed, the correct flash size is
by default auto-detected by esptool.py 1.2.
2017-01-05 22:26:23 +03:00
Damien George
bae7798f1e esp8266/modules/flashbdev: Add RESERVED_SECS before the filesystem.
Starting at esp.flash_user_start(), the reserved sectors are for general
purpose use, for example for native code generation.  There is currently
one sector reserved as such.
2017-01-04 23:47:09 +11:00
puuu
4fc607a1d7 esp8266: Move websocket_helper.py from scripts to modules for frozen BC.
websocket_helper.py is used by webrepl.  If webrepl is enabled and
websocket_helper.py is not frozen bytecode it leads to heap
fragmentation.
2016-12-05 13:01:08 +11:00
Paul Sokolovsky
1cc168d487 esp8266: Include upip as a standard frozen bytecode module.
Previously, it was included only in release builds, but it's important
tool which should be always at the fingertips to be useful (and to
pump up its usage).
2016-11-08 01:34:35 +03:00
Paul Sokolovsky
e84e3e7c10 esp8266: Rework webrepl_setup to run over wired REPL. 2016-11-06 10:01:48 +03:00
Damien George
7bb0f7b0f6 drivers: Add "from micropython import const" when const is used.
Following best-practice use of the const feature, to make it compatible
with Python.
2016-11-03 12:41:11 +11:00
ernitron
e5f06559e6 esp8266/modules: Fix negative temperature in ds18x20 driver. 2016-11-02 22:58:49 +11:00
Paul Sokolovsky
e6af94d13b esp8266/modesp: Add flash_user_start() function.
As we're looking towards adding OTA support, calculation of a FlashROM
area which can be used for filesystem (etc.) may become complex, so
introduce C function for that. So far it just hardcodes current value,
0x90000. In the future the function may be extended (and renamed) to
return the size of area too.
2016-10-24 16:52:15 +03:00
Paul Sokolovsky
3f251efb9b esp8266/modules/webrepl: Enforce only one concurrent WebREPL connection.
Concurrent WebREPL connections were never supported, now actually check
for this.
2016-10-20 16:50:38 +03:00
Damien George
59a9509703 esp8266/modules/ds18x20.py: Add support for DS18S20 devices. 2016-08-29 12:45:07 +10:00
Damien George
8e9b98e974 esp8266/modules/onewire: Change onewire.read() to onewire.readinto().
This allows 1-wire drivers (eg DS18X20) to perform in-place operations and
hence do less memory allocations.
2016-08-29 12:27:21 +10:00
Damien George
9fba618356 esp8266/modules: Split onewire.py into OneWire and DS18X20 driver.
The OneWire class is now in its own onewire.py module, and the temperature
sensor class is in its own ds18x20.py module.  The latter is renamed to
DS18X20 to reflect the fact that it will support both the "S" and "B"
variants of the device.

These files are moved to the modules/ subdirectory to take advantage of
frozen bytecode.
2016-08-29 12:12:49 +10:00
Paul Sokolovsky
3c9510d767 esp8266/modules/flashbdev: Start filesystem at 0x90000.
To accommodate growing firmware.
2016-08-09 14:59:27 +03:00
Paul Sokolovsky
ca59f5f208 esp8266/flashbdev: Reserve extra sysparam sector for SDK 2.0.0 compatibility. 2016-08-06 15:21:49 +03:00
Paul Sokolovsky
0d221775f5 esp8266/_boot.py: Decrease GC alloc threshold to quarter of heap size.
The idea behind decrease is: bytecode and other static data is also kept on
heap, and can easily become half of heap, then setting threshold to half of
heap will have null effect - GC will happen on complete heap exhaustion like
before. But exactly in such config maintaining heap defragmented is very
important, so lower threshold to accommodate that.
2016-07-23 13:56:24 +03:00
Paul Sokolovsky
c141584e1e esp8266/_boot.py: Set GC alloc threshold to half of heap size.
Should keep good chunk of heap unfragmented, if a user application allows
that at all.
2016-07-23 00:20:49 +03:00
Paul Sokolovsky
b8f45166c6 esp8266: Switch webrepl to use frozen bytecode. 2016-07-02 22:45:31 +03:00
Paul Sokolovsky
dec51e3519 esp8266: Switch webrepl_setup to use frozen bytecode. 2016-07-02 22:40:16 +03:00
Paul Sokolovsky
686367dcfc esp8266: Explicitly collect garbage in bootstrap scripts.
Leads to less fragmentation at teh time user code starts.
2016-07-02 19:22:55 +03:00
Damien George
db80c0ed46 esp8266: Enable frozen bytecode, with scripts in modules/ subdir.
To start with, the critical scripts _boot.py and flashbdev.py are frozen
to improve performance and reduce RAM consumption.

Saves about 1000 bytes of heap RAM for a bare boot with filesystem.
2016-06-29 13:59:19 +01:00