Commit Graph

4072 Commits

Author SHA1 Message Date
iabdalkader
ccda403500 misc: Bump firmware version. 2024-09-04 15:24:16 +02:00
iabdalkader
05d40bf497 boards/ARDUINO_NICLA_VISION: Compile user modules with -Os. 2024-09-04 10:08:56 +02:00
iabdalkader
85db1a229c modules: Use the default optimization level for all user C modules.
By appending the optimization level to modules CFLAGS. Note this
works because according to the man page: If you use multiple -O
options, with or without level numbers, the last such option is
the one that is effective.
2024-09-04 10:08:41 +02:00
iabdalkader
4ad64c4698 lib/tflm: Use GC's free memory for the temporary tensor arena.
On some boards, FB memory can become less than the available GC memory
for example with 3 frame buffers or a big frame. In this case the first
pass allocation (the one used to get the tensor arena's actual size)
can fail, even though GC has enough memory to allocate the arena.
This patch uses GC's free memory in the first pass to get the arena
size.
2024-09-03 19:32:21 +02:00
iabdalkader
c39e7740c4 micropython: Update submodule.
* Fix libmetal's rules.
* Revert gc max_size.
2024-09-03 08:52:34 +02:00
iabdalkader
0138cdf403 misc: Move Haar cascades. 2024-09-01 18:57:19 +02:00
iabdalkader
1d63716872 misc: Move Haar cascades. 2024-09-01 18:35:36 +02:00
Ibrahim Abdelkader
73a30f19db
Merge pull request #2401 from kwagyeman/kwabena/parameterize_apriltags
imlib/apriltag: Disable unused TAG families by default.
2024-09-01 11:41:04 +03:00
Kwabena W. Agyeman
c0d4759f85 imlib/apriltag: Switch apriltag object to attributes. 2024-08-31 21:19:37 -04:00
Kwabena W. Agyeman
effe12f2cc imlib/apriltag: Disable unused TAG families by default. 2024-08-31 04:04:50 -07:00
iabdalkader
fdc8a07a33 micropython: Update submodule.
* Revert optimization levels.
* Allow boards to update TinyUSB CDC buffer sizes.
* Fix libmetal's build rule.
* Fix gc's max_free size.
2024-08-31 11:53:13 +02:00
iabdalkader
6513276c1d scripts/libraries: Remove ble_advertising.
aioble should be used instead. There's an example for the temperature
using aioble.
2024-08-30 20:38:06 +02:00
iabdalkader
f03c2658e7 drivers: Optimize IMU drivers for size.
Those don't need to be fast.
2024-08-30 20:18:36 +02:00
iabdalkader
7259a33411 imlib/apriltag: Switch to libm's sin/cos. 2024-08-30 20:14:56 +02:00
iabdalkader
0f8b852356 ports/stm32: Fix CM4 boot memory. 2024-08-30 13:40:11 +02:00
Ibrahim Abdelkader
00f71413b7
Merge pull request #2391 from openmv/makefile_update
misc/Makefile: Remove uninitialized flag.
2024-08-28 14:44:31 +03:00
iabdalkader
e727de1408 misc/Makefile: Remove uninitialized flag. 2024-08-28 13:28:37 +02:00
iabdalkader
bf4e7e4513 modules/py_image: Fix implicit float conversion. 2024-08-28 13:20:41 +02:00
Kwabena W. Agyeman
13b68a3ee8 sensors/ov7725.c: Fix sensor bayer pattern. 2024-08-23 18:30:31 -07:00
Kwabena W. Agyeman
f9e79d1d7b imlib: Optimize debayering with Helium. 2024-08-23 18:00:24 -07:00
iabdalkader
83804c9444 github/workflows: Fix LLVM path. 2024-08-23 16:02:39 +03:00
iabdalkader
13e6573c46 ports/all: Refactor sensor flags. 2024-08-23 15:36:31 +03:00
iabdalkader
436f226c6e misc: Add support for building specific imlib files with clang. 2024-08-21 11:39:30 +03:00
iabdalkader
ca48b8c262 misc/common: Fix profiling macro.
Now it can be called multiple times in the same function and
can be nested.
2024-08-17 22:02:37 +03:00
Ibrahim Abdelkader
bad9342552
Merge pull request #2377 from openmv/tflite_vela_update
tools/tflite2c: Set Vela optimization per model.
2024-08-17 18:55:49 +03:00
iabdalkader
4e3ec807f2 tools/tflite2c: Set Vela optimization per model. 2024-08-17 18:37:34 +03:00
iabdalkader
7b36e4ef67 imlib: Fix automatic vbuffer count.
Before this patch, a 1.5MB framebuffer used a single vbuffer for VGA
and smaller resolutions, causing the sensor driver to restart with
every snapshot. With this patch, a 1.5MB frame buffer uses 2 vbuffers
for VGA/RGB and 3 vbuffers for VGA/grayscale **by default**.
In the case of 2 vbuffers, it should leave the rest for `fb_alloc`, so
`fb_alloc` still gets some extra space, but only if there's any left.

`set_buffers` now replaces `auto_adjust`. Passing `-1` to `set_buffers`
will attempt to use 3 vbuffers, each with a size of `frame_size` if
they fit; otherwise, the maximum possible buffers will be used.
Passing `1` will use the whole framebuffer. In this case, `frame_size`
is ignored. Additionally, `set_buffers` is now more efficient with buffer
sizes. For example, if the source is 1bpp (Bayer) and the destination is
1bpp (grayscale or Bayer), the vbuffer size will be `w*h`, instead of
assuming that everything is 2bpp, which allows for more vbuffers.
2024-08-15 17:26:00 +03:00
iabdalkader
25756429e0 micropython: Update submodule.
Sync upstream Open-AMP changes.
2024-08-14 11:24:25 +03:00
iabdalkader
bcef3e7156 micropython: Update submodule.
Open-AMP fixes from upstream.
2024-08-13 12:00:35 +03:00
iabdalkader
d1a20fb89d misc/common: Implement usb_cdc_reset_buffers for TinyUSB. 2024-08-12 23:19:18 +03:00
iabdalkader
a11635b03b misc/common: Fix usb_cdc_reset_buffers prototype. 2024-08-12 23:18:59 +03:00
iabdalkader
b2aa7db192 micropython: Update submodule.
Fix CDC debug buffer issue.
2024-08-12 23:17:26 +03:00
iabdalkader
c5e4297bef common/usbdbg: Revert changes to usbdbg/framebuffer.
This reverts commit afcd12cb6a.
2024-08-12 22:19:49 +03:00
iabdalkader
bf2e22614b boards/OPENMV4P: Set HW crop flag.
This should have been enabled in 51e6fd2912.
2024-08-12 17:25:41 +03:00
iabdalkader
bbc48aa0b2 drivers/dave2d: Add license file. 2024-08-07 20:17:22 +03:00
iabdalkader
da4c686dc3 sensors/ov7725: Set bayer format. 2024-08-06 17:43:41 +03:00
iabdalkader
b93b43f506 imlib: Fix raw framebuffer size. 2024-08-06 17:42:01 +03:00
iabdalkader
6508282562 misc/sensor: Add RAW flag.
For sensors that only support bayer output.
2024-08-06 17:35:52 +03:00
Kwabena W. Agyeman
afcd12cb6a common/usbdbg: Enable RAW binary mode streaming. 2024-08-05 18:43:24 -07:00
Kwabena W. Agyeman
6e705114f1 imlib/framebuffer: Fix RAW streaming call to draw_image. 2024-08-05 18:43:23 -07:00
Kwabena W. Agyeman
50639050fb imlib/draw: Move bilinear offset after GPU call. 2024-08-05 14:20:47 -07:00
iabdalkader
18bc05d132 imlib: Add support for sending raw preview frames.
This allows boards that don't have a hardware JPEG encoder, but
do have fast scaling, to bypass JPEG encoding and send down-scaled
raw frames. The raw preview frames are capped at a configurable max,
but should not exceed ~60KBs.
2024-08-05 17:53:19 +03:00
iabdalkader
dbe6ae9f18 misc/linker: Update linker script variables.
* Add start/end to JPEG buffer. This allows board config files to
define them using linker script syntax (K, M etc..).
* Rename variables more consistently.
2024-08-05 16:23:34 +03:00
iabdalkader
dfd62f4606 imlib/jpeg: Minor clean-up.
Remove STORECODE macro and just use write_bits. This has absolutely
no effect on performance, but makes the code easier read.
2024-08-04 17:17:44 +03:00
iabdalkader
529fc489b4 misc/common: Fix profile macro. 2024-08-04 15:14:39 +03:00
iabdalkader
aad37c9c85 misc/common: Add arg to profile macro.
This way it can be called multiple times in the same function.
2024-08-04 12:55:47 +03:00
iabdalkader
a096b149ea misc/common: Add timing macros.
Those can be used for timing functions. To enable build with PROFILE=1.
2024-08-03 19:35:49 +03:00
iabdalkader
bc34796b26 micropython: Update submodule. 2024-08-03 11:56:53 +03:00
iabdalkader
ead787a2e5 micropython: Update submodule. 2024-08-03 10:46:28 +03:00
iabdalkader
8b7bb8bdb6 boards/all: Remove USB packet size define. 2024-08-03 10:46:28 +03:00
iabdalkader
d34a2eae55 ports/wifidbg: Update WiFi debug code.
Note this feature will be replaced soon.
2024-08-03 10:46:28 +03:00
iabdalkader
f306d07b03 misc/usbdbg: Add CDC read/write callbacks.
These callbacks allow the debug code to read/write directly from
the stack, if possible, to avoid the extra memcpy.
2024-08-03 10:46:26 +03:00
Ibrahim Abdelkader
6b1308fcc5
Merge pull request #2342 from openmv/stm32_boot_uvc
ports/stm32: Move stm32-specific bootloader and uvc to port dir.
2024-08-01 21:05:32 +02:00
iabdalkader
9a3a8c4eb2 ports/stm32: Move stm32-specific bootloader and uvc to port dir.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-08-01 21:58:50 +03:00
iabdalkader
2de29c369b drivers/dave2d: Fix video memory bug. 2024-08-01 21:40:45 +03:00
Ibrahim Abdelkader
a5421c661b
Merge pull request #2339 from kwagyeman/kwabena/fix_mpu_uint32
common: Change linker variable to uint32.
2024-07-31 23:49:37 +02:00
Kwabena W. Agyeman
5d7f52bf44 common: Change linker variable to uint32. 2024-07-31 14:35:46 -07:00
iabdalkader
c1b20c2f7b drivers/dave2d: Remove license for now.
Apparently this is the wrong license, will update when I have
the right one.
2024-07-31 22:56:40 +03:00
Ibrahim Abdelkader
1fa077ffbe
Merge pull request #2334 from openmv/add_dave2d_driver
drivers/dave2d: Add D/AVE 2D GPU driver.
2024-07-31 20:05:06 +02:00
iabdalkader
20896add5b drivers/dave2d: Add D/AVE 2D GPU driver. 2024-07-31 21:01:48 +03:00
iabdalkader
d6b3b5a02f imlib: Fix framebuffer_get_buffer_size().
If the frame size is set, the memory for each buffer can be reduced,
freeing up space for fb_alloc(). However this can only be done if
the camera interface supports hardware cropping, i.e., the actual
frame size will match the specified window size, otherwise the
frame buffer size needs to stay the same.
2024-07-31 20:22:22 +03:00
iabdalkader
51e6fd2912 boards/All: Set hardware cropping flag for all st/nxp boards. 2024-07-31 20:15:14 +03:00
iabdalkader
14fbe44d4a misc: Bump firmware version. 2024-07-31 20:09:18 +03:00
Ibrahim Abdelkader
7a90254aac
Merge pull request #2329 from kwagyeman/kwabena/add_uint16_support
modules/py_ml: Add uint16 support to match ndarrays.
2024-07-31 18:56:43 +02:00
iabdalkader
ab62a038bf micropython: Update submodule. 2024-07-31 17:41:47 +03:00
iabdalkader
8b9a9aeafc misc: Bump firmware version. 2024-07-31 12:09:39 +03:00
Kwabena W. Agyeman
d48832c77c ports/stm32: Fix MPU region protection bug. 2024-07-30 22:35:12 -07:00
Ibrahim Abdelkader
51511ecb10
Merge pull request #2189 from kwagyeman/kwabena/line_op_update
modules/py_image: Update all lineops to use the draw_image backend.
2024-07-30 19:01:16 +02:00
Ibrahim Abdelkader
d2b9b57b47
Merge pull request #2332 from kwagyeman/kwabena/add_model_address
modules/py_ml: print model address location too.
2024-07-30 15:34:23 +02:00
Kwabena W Agyeman
4dbc7dc2fe
imlib/draw: Refactor draw_image to support gpu offload. (#2328)
* imlib/draw: Refactor draw_image to support gpu offload.

* misc/common: Fix GPU deinit.

---------

Co-authored-by: Ibrahim Abdelkader <i.abdalkader@gmail.com>
2024-07-30 09:38:42 +02:00
Kwabena W. Agyeman
9811006ca6 modules/py_ml: print model address location too. 2024-07-29 12:57:11 -07:00
Ibrahim Abdelkader
8f81c2f328
Merge pull request #2330 from kwagyeman/kwabena/add_pag7920
modules/py_sensor: Add missing PAG7920 enum.
2024-07-29 18:23:09 +02:00
iabdalkader
ac1e0a2663 misc/common: Add GPU memory section to common ld. 2024-07-29 10:50:05 +03:00
Kwabena W. Agyeman
cb1f63a95e modules/py_sensor: Add missing PAG7920 enum. 2024-07-28 21:00:54 -07:00
Kwabena W. Agyeman
b90b10dd1a modules/py_ml: Add uint16 support to match ndarrays. 2024-07-28 20:54:01 -07:00
Larry Bank
e54ed443cf imlib/jpegd: Fix for JPEG decoder boundary problem. 2024-07-26 12:03:04 -07:00
iabdalkader
6fb115a74c lib/tflm: Update submodule. 2024-07-25 23:11:17 +03:00
Kwabena W. Agyeman
1915bf2657 modules/py_image: Update all lineops to use the draw_image backend. 2024-07-25 11:43:19 -07:00
iabdalkader
6beb16d3a8 boards/OPENMV3: Revert imlib config. 2024-07-25 12:32:45 +03:00
iabdalkader
27e308fadc misc: dummy commit. 2024-07-25 03:12:27 +03:00
iabdalkader
96006c8eeb micropython: Update submodule. 2024-07-23 20:04:18 +03:00
iabdalkader
31c9280c68 lib/tflm: Fix Makefile rules to generate files once.
Files were generated twice.
2024-07-23 13:31:44 +03:00
iabdalkader
d7042349b5 tools/tflite2c: Support converting Vela models on the fly. 2024-07-23 10:40:39 +03:00
iabdalkader
1d48fe128a lib/tflm: Remove Vela models.
These will be generated on the fly.
2024-07-22 23:06:08 +03:00
Michael Paul Coder
9a881d477c
misc/README: Create toolchain parent directory. 2024-07-22 21:00:59 +10:00
Michael Paul Coder
9c938e045b
misc/README: Update builld instructions. (#2307)
misc/README: Update builld instructions.
2024-07-22 12:24:40 +02:00
iabdalkader
2d6bc18e9b misc/common: Reserve JPEG buffer only if defined. 2024-07-22 11:03:19 +03:00
Ibrahim Abdelkader
7e1be46202
Merge pull request #2305 from openmv/nosys_stubs
misc/common: Add nosys stubs.
2024-07-22 09:51:58 +02:00
iabdalkader
f9cbe170eb misc/common: Add nosys stubs. 2024-07-22 10:43:06 +03:00
Michael Paul Coder
0783a26761
misc: Update GCC toolchain installation instructions. 2024-07-20 22:40:46 +10:00
iabdalkader
574fc72c35 misc: Bump firmware version. 2024-07-20 11:13:43 +03:00
iabdalkader
bf64608f47 micropython: Update submodule. 2024-07-20 10:57:29 +03:00
Kwabena W Agyeman
b7800f1c8b
misc: Add back original licenses. (#2298)
misc: Add back original licenses.
2024-07-20 09:28:22 +02:00
Ibrahim Abdelkader
5df4e84699
Merge pull request #2293 from kwagyeman/kwabena/pack_unpack_2
modules/py_ml: Make predict output a numpy array.
2024-07-19 18:17:19 +02:00
Ibrahim Abdelkader
f922b76ae3
Merge pull request #2228 from kwagyeman/kwabena/fix_missing_invalidates
imlib/draw: Add missing speculative read invalidates.
2024-07-19 18:15:34 +02:00
iabdalkader
02888706c0 boards/ARDUINO_PORTENTA_H7: Enable Open-AMP. 2024-07-19 12:29:33 +03:00
Ibrahim Abdelkader
4a036f6059
Merge pull request #2299 from openmv/common_ld_fix
misc: Update common linker script.
2024-07-19 10:17:07 +02:00
iabdalkader
75c75b50ee misc: Update common linker script.
Align core and shm to 32.
2024-07-19 11:13:29 +03:00
Kwabena W. Agyeman
87e8cbba0e modules/py_tv: Improve cache display update cache efficency. 2024-07-18 17:46:16 -07:00
Kwabena W. Agyeman
9848eed128 modules/py_image: Replace unpack with ndarray creation. 2024-07-18 16:36:16 -07:00
Kwabena W. Agyeman
8b38f38378 modules/py_ml: Make predict output a numpy array. 2024-07-18 16:36:16 -07:00
Kwabena W. Agyeman
6ce27c910a boards: Enable 4 dims in ulab and disable haar cascades. 2024-07-18 16:36:16 -07:00
Ibrahim Abdelkader
e02bc63552
Merge pull request #2214 from kwagyeman/kwabena/update_morph
modules/py_image: Update morph() to use arg parse.
2024-07-19 00:40:46 +02:00
iabdalkader
1d52998683 micropython: Update submodule. 2024-07-19 01:37:21 +03:00
Kwabena W. Agyeman
919d3379d2 modules/py_image: Update morph() to use arg parse. 2024-07-18 12:27:10 -07:00
iabdalkader
17ff43d882 boards/ARDUINO_PORTENTA_H7: Set CYW43 Bluetooth firmware header. 2024-07-18 16:31:03 +03:00
iabdalkader
2a39d6690d boards/ARDUINO_NICLA_VISION: Set CYW43 Bluetooth firmware header. 2024-07-18 16:31:03 +03:00
iabdalkader
368d8af133 boards/ARDUINO_GIGA: Set CYW43 Bluetooth firmware header. 2024-07-18 16:31:03 +03:00
iabdalkader
1600c3a15f boards/ARDUINO_GIGA: Switch the CYW43 to firmware W4343WA1_45_98_102. 2024-07-18 16:31:03 +03:00
iabdalkader
269313c0ee boards/ARDUINO_PORTENTA_H7: Switch the CYW43 to firmware W4343WA1_45_98_102. 2024-07-18 16:31:03 +03:00
iabdalkader
24db2052ca boards/ARDUINO_NICLA_VISION: Switch the CYW43 to firmware W4343WA1_45_98_102. 2024-07-18 16:31:03 +03:00
iabdalkader
b1d20d23e8 drivers: Add CYW43 Bluetooth firmware blob. 2024-07-18 16:30:57 +03:00
iabdalkader
50ec7ac138 drivers/cyw4343: Add firmware W4343WA1_45_98_102. 2024-07-18 15:59:13 +03:00
iabdalkader
a98575fde2 micropython: Update submodule. 2024-07-18 11:20:15 +03:00
iabdalkader
ac886a7933 micropython: Update submodule. 2024-07-17 19:23:55 +03:00
Ibrahim Abdelkader
5b9bba2670
Merge pull request #2290 from openmv/tflm_update
lib/tflm: Update submodule.
2024-07-16 23:27:06 +02:00
iabdalkader
bdc355e08c lib/tflm: Update submodule. 2024-07-17 00:22:58 +03:00
Kwabena W. Agyeman
ddc1de8fb9 ports/stm32/jpeg: Add missing speculative read invalidates. 2024-07-16 13:49:14 -07:00
Kwabena W. Agyeman
4110022e5d imlib/draw: Add missing speculative read invalidates. 2024-07-16 13:49:12 -07:00
iabdalkader
e6f4afd661 misc: Fix DMA memory alignment. 2024-07-16 23:02:09 +03:00
iabdalkader
3b197a770d boards: Increase TinyUSB ring buffer size.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-07-16 14:33:48 +03:00
iabdalkader
3e61aa8933 misc/usbdbg: Increase text buffer size in GET_STATE. 2024-07-16 14:15:15 +03:00
Ibrahim Abdelkader
547859cb00
Merge pull request #2283 from kwagyeman/kwabena/fix_mlx90640
ports/mimxrt: Fix I2C for the MLX90640 driver.
2024-07-16 12:04:19 +02:00
Ibrahim Abdelkader
5b85cee97c
Merge pull request #2286 from openmv/ml_model_addr
modules/py_ml: Add tensor area memory address to model object.
2024-07-16 11:50:12 +02:00
iabdalkader
d66aaa8b35 modules/py_ml: Add tensor area memory address to model object.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2024-07-16 12:44:38 +03:00
Kwabena W. Agyeman
b7e0b40058 ports/mimxrt: Fix I2C for the MLX90640 driver. 2024-07-15 12:55:16 -07:00
Kwabena W. Agyeman
38d930ab65 sensors/hm0360: Enable HM0360 to work on GIGA. 2024-07-14 19:45:42 -07:00
Ibrahim Abdelkader
357b6f9b07
modules/py_ml: Fix model kwargs. (#2280)
* modules/py_ml: Fix model kwargs.
2024-07-14 23:44:37 +02:00
iabdalkader
2199ba489f lib/tflm: Update libtflm submodule. 2024-07-14 17:55:29 +03:00
Kwabena W. Agyeman
d24d2136ea modules/py_ml: Fully vectorize all input and output scaling/datatypes. 2024-07-13 11:33:09 -07:00
Ibrahim Abdelkader
6247269e6e
Merge pull request #2278 from openmv/micropython_update
micropython: Update submodule.
2024-07-13 19:16:06 +02:00
iabdalkader
caf5c4e24c micropython: Update submodule. 2024-07-13 20:13:06 +03:00
Ibrahim Abdelkader
e9a6cbac34
Merge pull request #2263 from kwagyeman/kwabena/fix_ml_scaling
modules/py_image: Change scale argument to (min,max) range.
2024-07-13 18:50:45 +02:00
Ibrahim Abdelkader
7bc48b6d0c
Merge pull request #2277 from openmv/update_micropython
micropython: Update submodule.
2024-07-13 18:14:06 +02:00
iabdalkader
cadcda8248 micropython: Update submodule. 2024-07-13 19:07:12 +03:00
Kwabena W. Agyeman
8b1b548ed2 scripts/examples: Add regression example. 2024-07-12 15:35:44 -07:00
Ibrahim Abdelkader
abe54df3e7
Merge pull request #2274 from openmv/ml_updates
modules/py_ml: ML updates and fix.
2024-07-12 23:40:55 +02:00
iabdalkader
4506682c2d modules/py_ml: Save labels in model object. 2024-07-13 00:33:27 +03:00
iabdalkader
dd1474e22e misc: Export common environment variables from top Makefile. 2024-07-12 23:06:32 +03:00
iabdalkader
0fbc6f114e modules/py_ml: Fix ndarray ndims check. 2024-07-12 22:01:57 +03:00
Ibrahim Abdelkader
829bbc5cf8
Merge pull request #2264 from kwagyeman/kwabena/buffer_check
modules/py_image: Add buffer length sanity check.
2024-07-11 18:42:49 +02:00
Ibrahim Abdelkader
9a67079fd6
Merge pull request #2272 from openmv/tinyusb_debug
misc: Tinyusb debug updates.
2024-07-10 11:38:30 +02:00
Ibrahim Abdelkader
4aab0f1aa4
Merge pull request #2271 from kwagyeman/kwabena/fix_input_buffer_size
modules/py_ml: Fix the size of the input bytearray.
2024-07-10 11:38:20 +02:00
iabdalkader
9c1283c58e ports/all: Wrap more CDC functions.
Just to ensure tud_task is not call by other code while debugging
is enabled.
2024-07-10 12:35:08 +03:00
iabdalkader
0a69b3df16 misc: Update TinyUSB debug code.
* Wrap-up more CDC functions. Note these were moved to common code
upstream, so in the future we'll only need to wrap one or two functions.
* Recover from text ringbuf overflow by resetting it.
* More efficient text ringbuf read/write.
2024-07-10 12:35:05 +03:00
Kwabena W. Agyeman
454fab7448 modules/py_ml: Fix the size of the input bytearray. 2024-07-09 22:19:15 -07:00
iabdalkader
2a3be63d41 misc: Fix malloc heap memory typo. 2024-07-10 00:20:01 +03:00
iabdalkader
0cef6239e0 misc/usbdbg: Add GET_STATE command.
The GET_STATE command is a command that returns flags, frame width,
height, size, and the text buffer (up to 40 bytes), in a single 64
bytes packet to reduce the bandwidth/overhead of the protocol.
The packet format is:
word    word    word    word    2 words     40 bytes
<flags> <width> <height> <size> <reserved>  <null-terminated text>

The flags are mostly reserved, only the following bits are defined:
0x001 script running
0x010 text buffer valid.
0x100 JPEG frame buffer ready.
2024-07-09 19:18:51 +03:00
Kwabena W. Agyeman
a36ac2db06 modules/py_image: Add buffer length sanity check. 2024-07-08 23:03:07 -07:00
Kwabena W. Agyeman
7b79fb4c77 modules/py_image: Change scale argument to (min,max) range. 2024-07-08 22:32:57 -07:00
Ibrahim Abdelkader
96af65fd14
Merge pull request #2257 from kwagyeman/kwabena/code_cleanup_2
lib/tflm: Code cleanup.
2024-07-08 09:09:58 +02:00
Kwabena W. Agyeman
94f260089f lib/tflm: Code cleanup. 2024-07-07 23:38:17 -07:00
Kwabena W. Agyeman
3f8491cb0e scripts/libraries: Move nms to python. 2024-07-07 23:02:15 -07:00
Ibrahim Abdelkader
f3f6141894
Merge pull request #2252 from openmv/ml_input_update
modules/py_ml: Add support for multi-input models.
2024-07-07 21:26:46 +02:00
iabdalkader
93e17a3a8d modules/py_ml: Remove input/output callbacks. 2024-07-07 21:48:42 +03:00
iabdalkader
70b89f4744 modules/py_ml: Update ML API to support multi-input models. 2024-07-07 21:48:42 +03:00
Kwabena W. Agyeman
de0d46fa68 modules/py_image: Add unpacking to bytearray support. 2024-07-07 21:48:42 +03:00
iabdalkader
9a186f4e27 libraries/ml: Convert ml to a package.
Add preprocessing, model wrapper and utils.
2024-07-07 21:48:38 +03:00
iabdalkader
d69c2c0a78 lib/libtflm: Update submodule. 2024-07-07 20:06:13 +03:00
Ibrahim Abdelkader
e014e48fe3
Merge pull request #2249 from openmv/py_image_type
modules/py_image: Add Image as a type instead of function.
2024-07-07 07:42:56 +02:00
iabdalkader
9ae3d0355c modules/py_image: Add missing draw hint. 2024-07-06 22:54:40 +03:00
iabdalkader
f481c9df77 modules/py_image: Add Image as a type instead of function.
Otherwise something like isinstance(x, image.Image) does Not work.
2024-07-06 18:38:04 +03:00
Ibrahim Abdelkader
2922d6d1c6
Merge pull request #2209 from kwagyeman/kwabena/add_circle_aa
imlib/draw: Add AA support for draw_circle.
2024-07-04 21:21:35 +02:00
Kwabena W. Agyeman
2493c91e83 ports/stm32: Add mic gain support to py_audio when using dfsdm. 2024-07-03 17:30:43 -07:00
iabdalkader
93f2d4c419 boards/ARDUINO_GIGA: Enable Open-AMP support. 2024-07-03 17:44:41 +02:00
iabdalkader
3cc57fea49 ports/stm32: Remove deprecated CM4 firmware support.
Now replaced with Open-AMP. Examples and docs will follow later.
2024-07-03 17:44:41 +02:00
iabdalkader
edc1a14e46 boards/All: Update Ulab config. 2024-07-03 17:44:41 +02:00
iabdalkader
17ee1838e4 ports/rp2: Use frozen _boot_fat.py to create the FS. 2024-07-03 17:44:41 +02:00
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
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
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
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
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
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
Kwabena W. Agyeman
7bf5b3fa7e modules/py_image: Add support for turning lists/tuples into Images. 2024-06-21 22:05:11 -07:00
Kwabena W. Agyeman
7697a84e8f modules/py_tf.c: Remove old methods/functions. 2024-06-21 10:41:09 +02:00
Kwabena W. Agyeman
a4d97c5723 modules/py_tf.c: Fix bug with S128_127 scaling. 2024-06-21 10:41:09 +02:00
Kwabena W. Agyeman
3e37f46db4 modules/py_tf: Remove detect() and segment() in favor of predict(). 2024-06-21 10:41:09 +02:00
Kwabena W. Agyeman
3863c38228 modules/py_tf: Remove classification object. 2024-06-21 10:41:09 +02:00
Kwabena W. Agyeman
54e31b163b modules/py_tf: Merge model output object with model object. 2024-06-21 10:41:04 +02:00
Kwabena W. Agyeman
36610e8530 modules/py_tf: Refactor NMS code into it's own object. 2024-06-21 10:37:38 +02:00
Kwabena W. Agyeman
13ab81c0ee imlib/collections: Add support for moving items between lists. 2024-06-20 14:36:28 -07:00
Kwabena W. Agyeman
e3ceea4a6c modules/py_tf: Fix log buffer free-order. 2024-06-19 17:17:20 -07:00
Kwabena W. Agyeman
cc823e2fbb ports: Fix accidental CPU cache invalidation. 2024-06-18 22:04:31 -07:00
iabdalkader
6c212409ce modules/py_tf: Refactor py_tf module.
- Implement log handler.
- Remove all extra load functions: load, load_builtin_model, and the newly added tf.Model(),
  now all call the same function.
- Remove module-level functions. Code should load the model first, the use model.predict().
  This is a breaking change, but loading models on the fly was never a good feature.
- Model FB memory will be free'd in finalizer. The model's fb_memory is automatically
  free'd when it's delete (i.e., del model).
2024-06-16 17:23:58 +02:00
iabdalkader
51ed29b501 lib/libtf: Update libtf. 2024-06-16 16:42:09 +02:00
iabdalkader
6373e0d708 ports/stm32: Fix Audio module's root pointers. 2024-06-15 14:24:00 +02:00
iabdalkader
668959d5c0 modules/fir: Fix root pointer usage. 2024-06-15 13:32:24 +02:00
Ibrahim Abdelkader
854afd9915
Merge pull request #2227 from kwagyeman/kwabena/new_tf_method
modules/py_tf: Add generic CNN processing support.
2024-06-12 15:10:09 +02:00
Kwabena W. Agyeman
8c69b09f4f modules/py_tf: Add generic CNN processing support. 2024-06-11 22:11:32 -04:00
Ibrahim Abdelkader
8c8c7dbde1
Merge pull request #2190 from kwagyeman/kwabena/refactor_get_similarity
modules/py_image: Refactor get_similarity() to use draw_image backend.
2024-06-09 14:34:52 +02:00
iabdalkader
4e84b3eabb boards/ARDUINO_GIGA: Enable HIMAX sensors. 2024-05-30 20:46:15 +02:00
iabdalkader
d330c73bce misc: Bump firmware version. 2024-05-26 14:56:56 +02:00
Ibrahim Abdelkader
4759398742
Merge pull request #2207 from openmv/sensor_delay_pwdn_reset
misc: Increase delay after reset/power-down.
2024-05-25 20:47:18 +02:00
Ibrahim Abdelkader
48801fbc5c
Merge pull request #2210 from kwagyeman/kwabena/remove_pooling
imlib/pool: Remove obsolete pooling functions.
2024-05-25 15:08:18 +02:00
Ibrahim Abdelkader
1959b724e1
Merge pull request #2212 from kwagyeman/kwabena/fix_erode_mask
imlib/binary: Fix erode mask check.
2024-05-25 10:32:03 +02:00
iabdalkader
88027a9e27 boards/PORTENTA_H7: Override default reset and power delays. 2024-05-25 10:29:37 +02:00
iabdalkader
17ac3180b9 misc: Increase delay after sensor reset/power-down. 2024-05-25 10:29:25 +02:00
Ibrahim Abdelkader
44e92b4c0d
Merge pull request #2215 from kwagyeman/kwabena/ksize_fix
modules/py_image: Move ksize to be pos_arg.
2024-05-21 20:34:09 +02:00
Ibrahim Abdelkader
28d5fdfa1c
Merge pull request #1610 from openmv/invalidate_vbuffers
imlib: Invalidate vbuffers before returning them.
2024-05-21 20:33:42 +02:00
Ibrahim Abdelkader
0851f59300
Merge pull request #2220 from openmv/mimxrt_dma_fix
ports/mimxrt: Retry transfer if the DMA is still busy.
2024-05-21 20:33:24 +02:00
Ibrahim Abdelkader
fb86074477
Merge pull request #2221 from openmv/stm32_sensor_bug
ports/stm32: Reset vbuffer state when dropping frames.
2024-05-21 20:32:10 +02:00
iabdalkader
64b2708754 ports/stm32: Reset vbuffer state when dropping frames.
When dropping a frame the current vbuffer state was Not reset, which
caused the following frame(s) to be corrupted, probably also overwriting
the next vbuffer.
This bug is what caused transposed high-resolution frames to be corrupted.
If the DMA is not keeping up you should simply just see slower FPS or no
frames at all but definitely never corrupted frames, since they're dropped.
2024-05-21 20:15:34 +02:00
iabdalkader
75a934de0d ports/mimxrt: Retry transfer if the DMA is still busy.
Retry to submit the transfer a few times if the DMA is busy,
before dropping the frame.
2024-05-21 19:15:10 +02:00
iabdalkader
80fce781ab imlib: Invalidate vbuffers before returning them.
* Fixes #2216
2024-05-20 22:59:35 +02:00
Kwabena W. Agyeman
08ca21fd1b imlib/pool: Remove obsolete pooling functions. 2024-05-19 20:06:37 -07:00
Ibrahim Abdelkader
99c3ddd7fc
Merge pull request #2208 from kwagyeman/kwabena/minor_draw_line_cleanup
imlib/draw: Cleanup drawline code.
2024-05-19 09:55:14 +02:00
Ibrahim Abdelkader
c21472a1cd
Merge pull request #2213 from kwagyeman/kwabena/fix_morph_spelling
modules/py_image: Fix morph spelling.
2024-05-15 23:50:14 +02:00
Ibrahim Abdelkader
b2e90e6c47
Merge pull request #2191 from kwagyeman/kwabena/clean_to_x
modules/py_image: Update py_image_to with mp_arg_parse_all.
2024-05-13 16:51:08 +02:00
Kwabena W. Agyeman
f928965896 modules/py_image: Move ksize to be pos_arg. 2024-05-12 21:54:46 -07:00
Kwabena W. Agyeman
b7eda7d932 modules/py_image: Fix morph spelling. 2024-05-12 21:24:08 -07:00
Kwabena W. Agyeman
0638c936c6 imlib/binary: Fix erode mask check. 2024-05-12 21:16:27 -07:00
Kwabena W. Agyeman
3fee02ffb5 modules/py_image: Update py_image_to with mp_arg_parse_all. 2024-05-12 21:12:17 -07:00
Kwabena W. Agyeman
3776924659 imlib/draw: Add AA support for draw_circle. 2024-05-10 18:54:18 -07:00
Kwabena W. Agyeman
7d4f70e9ef imlib/draw: Cleanup drawline code. 2024-05-09 20:48:39 -07:00
Ibrahim Abdelkader
b4f1461e23
Merge pull request #2205 from kwagyeman/kwabena/change_arm_math
imlib: Change ARM_MATH_CM4/CM7 to DSP.
2024-04-22 15:27:05 +02:00