diff options
| author | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-17 14:55:57 (GMT) |
|---|---|---|
| committer | Daniel Thompson <daniel@redfelineninja.org.uk> | 2021-01-17 14:55:57 (GMT) |
| commit | 5170b974913129bce381d3061d967767a064f2f0 (patch) | |
| tree | 91fb5c25264890940228363daf32174a65afea98 /docs | |
| parent | 2805c1f84e0ccfa2d2a1756796987337b2e14d11 (diff) | |
docs: appguide: Document how to upload pre-compiled files
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/appguide.rst | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/docs/appguide.rst b/docs/appguide.rst index 5da8c7d..9f3cc01 100644 --- a/docs/appguide.rst +++ b/docs/appguide.rst @@ -298,8 +298,10 @@ takes around five seconds). Once the watch is in OTA mode then press the phyiscal button again to return to normal mode with the application cleared out. -Making it permanent -~~~~~~~~~~~~~~~~~~~ +.. _Uploading in source code form: + +Uploading in source code form +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ To ensure you application survives a reboot then we must copy it to the device and ensure it gets launched during system startup. @@ -351,6 +353,36 @@ to the watch: startup. If that happens, and you don't know how to debug the problem, then you can use wasptool to restore the original version of main.py . +Uploading in binary form +~~~~~~~~~~~~~~~~~~~~~~~~ + +Some applications are too large to be compiled on the target. These applications +need to be pre-compiled and can then either be uploaded in binary form to the +wasp-os filesystem or +:ref:`included in the firmware image<Freezing your application into the wasp-os binary>` +to further reduce the RAM overhead. + +To pre-compile your application: + +.. code-block:: sh + + sh$ ./micropython/mpy-cross/mpy-cross -mno-unicode -march=armv7m myapp.py + +To copy the binary to the wasp-os filesystem try: + +.. code-block:: sh + + sh$ ./tools/wasptool --binary --upload myapp.mpy + Uploading myapp.mpy: + [##################################################] 100% + +At this point your application is stored on the external FLASH but it will +not automatically be loaded but it can be imported using ``import myapp``. +The application can be registered from ``main.py`` using exactly the same +technique as :ref:`uploads in source code<Uploading in source code form>`. + +.. _Freezing your application into the wasp-os binary: + Freezing your application into the wasp-os binary ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
