aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyke van Laethem2017-11-21 18:16:10 +0100
committerDamien George2018-07-18 17:12:25 +1000
commit03b8429c0cf182f89fea8883cfc005dbb041ba2f (patch)
tree9e9172136046faf2c7b5cf9f89c215b916edfeb8
parentb493de75f33fecc14cdf2d5d2c4faf0079d13662 (diff)
nrf: Remove default FROZEN_MPY_DIR.
Saves 448 bytes of flash. Can still be enabled using: make FROZEN_MPY_DIR=freeze BOARD=foo
-rw-r--r--ports/nrf/Makefile2
-rw-r--r--ports/nrf/README.md14
2 files changed, 14 insertions, 2 deletions
diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile
index 1a475bcac..eb3e78786 100644
--- a/ports/nrf/Makefile
+++ b/ports/nrf/Makefile
@@ -29,8 +29,6 @@ endif
# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h $(BUILD)/pins_qstr.h
-FROZEN_MPY_DIR = freeze
-
# include py core make definitions
include ../../py/py.mk
diff --git a/ports/nrf/README.md b/ports/nrf/README.md
index d1c292e7d..839211d2c 100644
--- a/ports/nrf/README.md
+++ b/ports/nrf/README.md
@@ -72,6 +72,20 @@ The **make sd** will trigger a flash of the bluetooth stack before that applicat
Note: further tuning of features to include in bluetooth or even setting up the device to use REPL over Bluetooth can be configured in the `bluetooth_conf.h`.
+## Compile with frozen modules
+
+Frozen modules are Python modules compiled to bytecode and added to the firmware
+image, as part of MicroPython. They can be imported as usual, using the `import`
+statement. The advantage is that frozen modules use a lot less RAM as the
+bytecode is stored in flash, not in RAM like when importing from a filesystem.
+Also, frozen modules are available even when no filesystem is present to import
+from.
+
+To use frozen modules, put them in a directory (e.g. `freeze/`) and supply
+`make` with the given directory. For example:
+
+ make BOARD=pca10040 FROZEN_MPY_DIR=freeze
+
## Target Boards and Make Flags
Target Board (BOARD) | Bluetooth Stack (SD) | Bluetooth Support | Flash Util