Commit Graph

66 Commits

Author SHA1 Message Date
iabdalkader
bbfe90aa74 ports/stm32: Configure system clock before HAL_Init.
This ensures SystemCoreClock is updated after the
system clock has been configured.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-15 19:20:46 +02:00
iabdalkader
49d830d6dc ports/stm32: Fix build.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-15 19:20:46 +02:00
iabdalkader
18a53b7fee ports/stm32: Use MicroPython GPDMA handles.
Now that MicroPython uses GPDMA for N6, the GPDMA handles
as well as IRQs are shared.

Note: care must be taken when choosing GPDMA channels
to avoid conflicts with MicroPython's channels.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-15 19:20:46 +02:00
iabdalkader
9112cf2aae misc: Clean-up CSI flags.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-09 12:00:59 +02:00
Ibrahim Abdelkader
294eaf309f
Merge pull request #2795 from openmv/fix_dma_sec
Some checks failed
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (DOCKER) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled
ports/stm32: Fix N6 DMA security config.
2025-08-03 12:25:55 +03:00
iabdalkader
84b1814ae7 ports/stm32: Fix N6 DMA security config.
Fix DMA security config for non-circular channels.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-08-03 10:39:51 +02:00
Kwabena W. Agyeman
a15fb0b831 ports/stm32: Add max transfer sizes for the N6. 2025-08-03 09:45:47 +02:00
Kwabena W. Agyeman
c9dfbb7650 ports: Add GPU tranform support. 2025-07-31 13:26:14 -07:00
Kwabena W. Agyeman
47c5618231 lib/imlib: Add transform argument to draw_image. 2025-07-31 13:13:45 -07:00
Kwabena W. Agyeman
20839405a2 lib/imlib: Add transform support to GPU drivers. 2025-07-31 13:12:48 -07:00
iabdalkader
60d015c82d ports/stm32: Use HAL_InitTick to init SysTick.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-27 15:35:51 +02:00
iabdalkader
7f20081d9c ports/stm32: Use the new framebuffer API.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-23 18:24:55 +02:00
iabdalkader
f3e530cfec ports/stm: Re-enable frame interrupt in JPEG mode.
This macro was removed so FRAME_IT was not enabled.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-23 11:03:43 +02:00
Kwabena W. Agyeman
bacfb7aeb7 modules/py_fir_lepton: Remove lepton control through fir module. 2025-07-21 23:10:40 -07:00
iabdalkader
95d1c0a6cc ports/all: Switch to gnu11 standard.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-21 17:51:07 +02:00
Ibrahim Abdelkader
c736ea4076
Merge pull request #2772 from kwagyeman/kwabena/remove_buzzer
Some checks are pending
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Waiting to run
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Waiting to run
🔥 Firmware Build / build-firmware (DOCKER) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV2) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Waiting to run
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Waiting to run
🔥 Firmware Build / code-size-report (push) Blocked by required conditions
🔥 Firmware Build / stable-release (push) Blocked by required conditions
🔥 Firmware Build / development-release (push) Blocked by required conditions
ports/stm32: Remove old buzzer module.
2025-07-21 11:03:33 +03:00
Kwabena W. Agyeman
0390360a92 ports/stm32: Fix typo in stm32_pwm. 2025-07-21 09:24:57 +02:00
Kwabena W. Agyeman
ccb947924a ports/stm32: Remove old buzzer module. 2025-07-20 22:33:08 -07:00
iabdalkader
a82169dae2 ports/stm32: Use common alignment macros.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-16 11:18:56 +02:00
iabdalkader
58fe4f33b5 ports/stm32: Refactor CSI PWM config.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-12 17:12:37 +02:00
iabdalkader
cb0b0bc224 ports/stm32: Add timer helper functions.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-12 17:12:37 +02:00
iabdalkader
07d3e3f559 ports/stm32: Support using DCMI and DCMIPP.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-12 17:12:34 +02:00
iabdalkader
77d79ba58a ports/stm32: Decouple CSI instance used by main driver.
This patch removes the assumption that the main driver
always uses the default CSI instance. Instead, the CSI
instance used by each interface is now explicitly set.

This prepares the driver for supporting multiple CSIs
using the main driver.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-12 17:12:34 +02:00
iabdalkader
a48e545bc0 ports/stm32: Disable DCMI pins init for DCMIPP.
DCMIPP is used exclusively for CSI sensors now.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-12 17:12:34 +02:00
Ibrahim Abdelkader
f7aa6985e5
Merge pull request #2658 from openmv/remove_uvc2
Some checks failed
🔥 Firmware Build / build-firmware (ARDUINO_GIGA) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_33_BLE_SENSE) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NANO_RP2040_CONNECT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_NICLA_VISION) (push) Has been cancelled
🔥 Firmware Build / build-firmware (ARDUINO_PORTENTA_H7) (push) Has been cancelled
🔥 Firmware Build / build-firmware (DOCKER) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV2) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV4P) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMVPT) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_AE3) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_N6) (push) Has been cancelled
🔥 Firmware Build / build-firmware (OPENMV_RT1060) (push) Has been cancelled
🔥 Firmware Build / code-size-report (push) Has been cancelled
🔥 Firmware Build / stable-release (push) Has been cancelled
🔥 Firmware Build / development-release (push) Has been cancelled
ports/stm32: Remove UVC firmware.
2025-07-09 11:31:53 +03:00
Ibrahim Abdelkader
1b59395beb
Merge pull request #2759 from kwagyeman/kwabena/enable_n6_lcd
boards/OPENMV_N6: Enable SPI LCD/TV Displays.
2025-07-09 10:31:50 +03:00
Kwabena W. Agyeman
e14bbe586d lib/imlib: Fix update_jpeg_buffer to update from the passed image.
framebuffer_update_jpeg_buffer was previously bugged as it always
updated the jpeg buffer from the frame buffer versus the image
object it was attached to. e.g. img.flush() always flushed the
frame buffer and not the image object it was called on.
2025-07-07 20:39:29 -07:00
Kwabena W. Agyeman
90f48cdfe7 boards/OPENMV_N6: Enable SPI LCD/TV Displays.
Triple buffering does not work at the moment.
2025-07-06 19:08:20 -07:00
iabdalkader
ff3e4e0183 ports/stm32: Refactor CSI ISP code.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-06 14:26:23 +02:00
iabdalkader
7934ea0a1e ports/stm32: Refactor DMA code.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-05 15:14:18 +02:00
iabdalkader
6406e719ce ports/stm32: Add DMA init functions.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-05 15:10:18 +02:00
iabdalkader
2b4d66ba23 ports/stm32: Refactor MDMA code.
Moved to separate file to make omv_csi more readable.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-05 14:50:03 +02:00
iabdalkader
85179136ab ports/stm32: Rename port files consistently.
Just a search/replace/rename for consistency with other
ports.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-05 14:50:03 +02:00
iabdalkader
09c0052dfa ports/all: Decouple the clock from main CSI state.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-05 14:17:31 +02:00
iabdalkader
3e8cc670f9 ports/stm32: Refactor omv_csi_init.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-07-02 18:12:59 +02:00
iabdalkader
6ddd0b0faf ports/stm32: Fix I2C lockup on bus error.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-30 23:43:20 +02:00
iabdalkader
5aec3162ec ports/stm32: Fix DCMI pipe reset.
Since the DCMI is not reinitialized on every reset anymore,
the pipe states must be reset to reconfigure them. The HAL
drivers never just handle these things as usual.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-30 23:43:20 +02:00
iabdalkader
1ddd69bfbe ports/stm32: Fix spi_transfer_abort.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-29 17:20:49 +02:00
iabdalkader
7f4e5e81c7 common/csi: Abort CSIs on soft-reboot.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-29 17:20:49 +02:00
iabdalkader
64fa8c472f ports/stm32: Implement shutdown op.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-29 17:20:49 +02:00
iabdalkader
822fc11003 ports/stm32: Fix PSRAM settings.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-29 17:11:27 +02:00
Kwabena W. Agyeman
7d2b334066 ports/stm32: Fix all sensor RGB565/GRAYSCALE/BAYER/YUV422 modes.
Tested against all our supported sensors. Everything works.
2025-06-27 23:27:16 -07:00
iabdalkader
a266ac33f1 ports/all: Fix calls on uninitialized CSIs.
Detection flag should be set after CSIs are detected in
the scanning code, and functions that loop over CSIs
should check it.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-27 10:03:48 +02:00
iabdalkader
25b7b8cbb2 ports/stm32: Add support for multiple CSIs.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
2025-06-25 21:15:24 +02:00
Kwabena W. Agyeman
c4795d3191 ports/stm32: Increase SPI DMA efficency.
The SPI fifo triggers a request when it has 4-bytes of data allowing
for more efficent bus usage. The same technique is used on the H7
to reduce system bus matrix resources.
2025-06-24 10:19:31 -07:00
Kwabena W. Agyeman
3984ec783f ports/stm32: Move VOSPI memory near DMA controller.
On the STM32N6 the DMA memory meant to be used with the SPI bus is
in the low-performance memory domain. Moving the DMA buffers and
linked list buffers there reduces the AHB cycle time by the DMA
controller making it more stable.
2025-06-24 10:19:31 -07:00
Kwabena W. Agyeman
fc0cc40a31 drivers/sensors/lepton: Update lepton driver with asynchronous fb.
The FLIR Lepton driver now continously receives frames in the background
that are stored in allocated frame buffers. On snapshot the stored frame
is post-processed to produce a color an image.

* Transpose now works allowing for image rotation with IMU.
* Bilinear scaling is now used when drawing at a higher res.
2025-06-24 10:19:29 -07:00
Kwabena W. Agyeman
89d60c8002 ports/stm32: Add missing init bits to fix glitches. 2025-06-23 14:40:11 -07:00
Kwabena W. Agyeman
1dece0b461 ports/stm32: Fully implement N6 GPU driver for draw_image. 2025-06-23 14:29:32 -07:00
Kwabena W. Agyeman
8f81f16963 ports/stm32: Fix NEMA GPU driver.
* You have to clean and invalidate the destination image so that
  the processor writes out the full image and so that the processor
  doesn't flush cache lines ontop of the GPU writing the image.
* The ICACHE doesn't automatically flush itself after a draw operation.
  Depending on the situation, it will just hold the entire source
  image internally and never read it again. In particular, when
  scaling something like 160x120 it just caches the whole image
  and never reads it again.
2025-06-23 12:34:41 -07:00