Commit Graph

6010 Commits

Author SHA1 Message Date
iabdalkader
976aee80ae misc/mp_utils: Add pystack initializer. 2024-07-03 17:44:41 +02:00
iabdalkader
eaeff63f34 ports/stm32: Deinit CYW43 on soft-reset. 2024-07-03 17:44:41 +02:00
iabdalkader
75d968051b ports/mimxrt: Switch to the updated CYW43 driver v7_45_98_102. 2024-07-03 17:44:41 +02:00
iabdalkader
ec02218a1b ports/mimxrt: Deinit CYW43 on soft-reset. 2024-07-03 17:44:38 +02:00
iabdalkader
e758a0f958 ports/All: Update USBDBG to use the VM abort feature.
Replaces the forced PendSV jump with the new VM abort feature.
2024-07-03 15:40:02 +02:00
iabdalkader
0c67aba2ea boards/All: Freeze ssl module.
This module provides compatibility with CPython's SSL module.
2024-07-03 15:40:02 +02:00
iabdalkader
27be6e1f98 ports/All: Update Makefiles to support MicroPython 1.23. 2024-07-03 15:39:59 +02:00
iabdalkader
3a8f1bb540 modules: Switch to the new mp_obj_malloc_with_finaliser. 2024-07-03 14:42:18 +02:00
iabdalkader
f57c2f5e56 misc: Replace deprecated STATIC with static. 2024-07-03 14:42:18 +02:00
iabdalkader
4488f778f5 modules: Update ulab to 6.5.2. 2024-07-03 14:42:18 +02:00
iabdalkader
66a6177fbe micropython: Update to MicroPython v1.23.0. 2024-07-03 14:42:15 +02:00
Ibrahim Abdelkader
57215d10e9
Merge pull request #2242 from openmv/gc_blocks
misc: Add common linker script, and misc board config updates.
2024-06-30 18:46:43 +02:00
iabdalkader
be03021258 boards/All: Update memory configs.
* DMA buffers regions are automatically rounded up to the next power of 2 via
the linker script. This ensures that these buffers, when rounded up, can actually
fit into their respective memories. It also ensures that when/if the MPU is used
to configure these regions, it will not round up the regions sizes, which may cause
the MPU to configure a region bigger than the DMA buffer.
* GC blocks can be rearranged in any order, including the main heap/first block.
This is very important for boards with limited RAM to avoid fragmenting the contiguous
large heap early before it's actually needed.
* Moved VOSPI memory to its own section. The offset is no longer required, and the
linker script can detect overlaps.
* Renamed GC heap memory to allow more than one heap to exist, and added support for
it in the common linker script. This change allows adding a second heap for malloc/libc
easily if needed.
* For STM32 boards, the domain-specific DMA buffers can now be located anywhere within
their memory regions, as their MPU regions' base addresses and sizes are all set via
linker script variables. Previously, this was defined in headers, and sections could
have easily overlapped without warning.
2024-06-30 17:58:59 +02:00
iabdalkader
c28aea9ea4 misc: Fix first additional GC block name. 2024-06-30 17:32:13 +02:00
iabdalkader
c9de724be0 misc: Rename JPEG buffer size. 2024-06-30 17:32:13 +02:00
iabdalkader
ab92e46edd ports/nrf: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
c7a87bce8e ports/stm32: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
f06eb8e72e ports/stm32: Add MPU helper function. 2024-06-30 17:32:13 +02:00
iabdalkader
2f8977a5ac ports/mimxrt: Use the common linker script. 2024-06-30 17:32:13 +02:00
iabdalkader
9062a51d31 misc: Add common pre-processor linker script. 2024-06-30 17:32:09 +02:00
Ibrahim Abdelkader
420c4288a9
Merge pull request #2241 from openmv/tflite2c_align
tools/tflite2c: Fix model alignment.
2024-06-28 19:10:02 +02:00
iabdalkader
8e10020da1 tools/tflite2c: Fix model data alignment. 2024-06-28 19:04:36 +02:00
Ibrahim Abdelkader
0f2107c215
Merge pull request #2239 from openmv/tflm_upstream
TensorFlow: Switch to upstream TFLM and refactor all TensorFlow modules.
2024-06-28 16:42:02 +02:00
iabdalkader
8ee4a28327 scripts/examples: Update examples. 2024-06-28 16:32:04 +02:00
iabdalkader
40710a3573 ports/stm32: Support setting audio module samples at runtime. 2024-06-28 16:32:04 +02:00
iabdalkader
54104039b4 boards/All: Freeze the ML extension module for boards with ML support. 2024-06-28 16:32:04 +02:00
iabdalkader
b301701050 scripts/libraries: Add ML extensions module.
This module extends the built-in ML module with the Micro Speech
keyword spotter implementation.
2024-06-28 16:32:04 +02:00
iabdalkader
c7228cbb48 modules/py_tf: Refactor TensorFlow module.
This patch decouples the MicroPython TF module from the TensorFlow library,
allowing support for more DL/ML libraries and engines in the future.

The ML backend has been completely redesigned; the model object can now be
passed directly to the backend, allowing it to initialize the model internally.
Additionally, the backend's state/memory is now persistent (surviving across
invocations), which improves inference speed by around 20% and supports models
that require persistent memory, such as LSTM.

Finally, the ML module has been mostly rewritten to handle model input/output
shapes and data properly, and to support models with multiple outputs
2024-06-28 16:32:04 +02:00
iabdalkader
13c99c6332 boards/All: Optimize flash/memory usage to support the new TFLM. 2024-06-28 16:32:04 +02:00
iabdalkader
13cc273318 boards/all: Enable built-in TFLM models.
The new built-in model system allows fine-grained control over which models
get built into the firmware image. This patch enables FOMO for all boards
and audio processing models for boards with mics.
2024-06-28 16:32:04 +02:00
iabdalkader
073b161309 modules/py_image: Export py_image_type for use by other modules. 2024-06-28 16:32:04 +02:00
iabdalkader
76a17f81c9 tools/tflite2c.py: Update built-in model generator script.
Add support embedding models conditionally using the index file. Models listed
in `models/index.txt` will be generated with an enable macro, which can be defined
per board in `imlib_config.h` files. Other models in models/ will be built-in by
default.
2024-06-28 16:32:04 +02:00
iabdalkader
491fc1bd06 ports/nrf: Fix build. 2024-06-28 16:32:04 +02:00
iabdalkader
f4c91cbf6c ports/stm32: Update linker script.
Add more GC blocks, and separate the main GC heap from main memory.
2024-06-28 16:32:02 +02:00
iabdalkader
7a62df38e3 ports/stm32: Update port Makefiles to support the new TFLM. 2024-06-28 16:31:42 +02:00
iabdalkader
d51a11edbf ports/mimxrt: Update linker script.
Add more GC blocks, and separate the main GC heap from main memory.
2024-06-28 16:31:39 +02:00
iabdalkader
c79b3aecbb ports/mimxrt: Update port Makefiles to support the new TFLM. 2024-06-28 14:13:46 +02:00
iabdalkader
5e9453974e lib/tflm: Add TFLM submodule.
This submodule replaces the old libtf with a libraries built from
the TFLM upstream. The new libraries are faster and smaller than
the previous libtf.
2024-06-28 14:13:46 +02:00
iabdalkader
d1756b4b61 ports/stm32: Remove the obsolete micro speech C module.
This module no longer works with the updated TFLM since feature generation
has been removed and replaced by another audio preprocessor model. This
module will be replaced with a pure Python module or example.
2024-06-28 14:13:46 +02:00
iabdalkader
d0c85de2fe lib/libtf: Remove obsolete libtf. 2024-06-28 14:13:46 +02:00
iabdalkader
18caf947b9 ports/all: Fix RWX warning in linker scripts. 2024-06-28 14:13:46 +02:00
Ibrahim Abdelkader
235c337da0
Merge pull request #2232 from kwagyeman/kwabena/fix_cache_invalidation_issue
ports: Fix accidental CPU cache invalidation.
2024-06-28 14:09:28 +02:00
Ibrahim Abdelkader
60df3e61fc
Merge pull request #2238 from hasheddan/fix/readme-tensorflow
docs: fix misspelling of tensorflow
2024-06-22 20:05:11 +02:00
Daniel Mangum
104b189020 docs: fix misspelling of tensorflow
Fixes a typo of "TensorFlow" in the README.md.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
2024-06-22 12:00:38 -04:00
Ibrahim Abdelkader
8f1d621941
Merge pull request #2237 from openmv/gc_blocks
ports/all: Add support for additional GC blocks.
2024-06-22 17:07:07 +02:00
iabdalkader
112c753bb5 ports/stm32: Add support for additional GC blocks. 2024-06-22 17:02:53 +02:00
iabdalkader
7aa40047a7 ports/mimxrt: Add support for additional GC blocks. 2024-06-22 17:02:23 +02:00
iabdalkader
4dd63ce6e0 ports/nrf: Switch to mp_utils to initialize GC/Stack. 2024-06-22 17:02:23 +02:00
iabdalkader
df3e885d6b ports/rp2: Switch to mp_utils to initialize GC/Stack. 2024-06-22 17:02:23 +02:00
iabdalkader
79019cce0d misc: Add MicroPython GC helper functions. 2024-06-22 17:02:15 +02:00