Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
363 changes: 363 additions & 0 deletions firmware/boards/LUCIDCODE_INSPEC_N6/board_config.h

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions firmware/boards/LUCIDCODE_INSPEC_N6/board_config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
MCU=STM32N657xx
CPU=cortex-m55
FPU=fpv5-d16
PORT=stm32
SYSTEM=st/system_stm32n6
OMV_USB_VID=0x37C5
OMV_USB_PID=0x1206
OMV_FIRM_BASE=0x70000000
OMV_FIRM_ADDR=0x70080000
OMV_BOOT_ADDR=0x34180400
OMV_BOOT_CFLAGS=-mcmse \
-DOMV_BOOTLOADER \
-DUSER_TZ_SAU_SETUP \
-DCFG_TUD_MAX_SPEED=OPT_MODE_HIGH_SPEED \
-DCFG_TUSB_RHPORT0_MODE=OPT_MODE_DEVICE
OMV_BOARD_CFLAGS=-mcmse \
-DOMV_NOSYS_STUBS_ENABLE=1 \
-DMICROPY_HW_RUNS_FROM_EXT_FLASH=1
OMV_RAMFUNC_OBJS = bdev.o xspi.o spiflash.o
OMV_SIGN_BOOT=1
OMV_SIGN_HDRV=2.3
OMV_SIGN_FLAGS=0x80000000
OMV_PROG_STLDR=MX25UM51245G_STM32N6570-NUCLEO.stldr
OMV_JLINK_ARGS=--device STM32N657L0
OMV_STLINK_ARGS=--extload $(OMV_PROG_STLDR)
OMV_HSE_VALUE=48000000
OMV_ENABLE_BL=1
OMV_BOSON_ENABLE=1
OMV_GENX320_ENABLE=1
OMV_LEPTON_SDK_ENABLE=1
OMV_USB_STACK_TINYUSB=1
MICROPY_PY_CSI = 1
MICROPY_PY_CSI_NG = 1
MICROPY_PY_PROTOCOL = 1
MICROPY_PY_FIR = 1
MICROPY_PY_TOF = 1
MICROPY_PY_IMU = 1
MICROPY_PY_CRC = 1
MICROPY_PY_ULAB = 1
MICROPY_PY_DISPLAY = 1
MICROPY_PY_TV = 1
MICROPY_PY_AUDIO = 1
MICROPY_PY_LWIP = 1
MICROPY_PY_SSL = 1
MICROPY_PY_SSL_ECDSA_SIGN_ALT = 0
MICROPY_SSL_MBEDTLS = 1
MICROPY_PY_NETWORK_CYW43 = 1
MICROPY_PY_BLUETOOTH = 1
MICROPY_BLUETOOTH_NIMBLE = 1
MICROPY_PY_ML = 1
MICROPY_PY_ML_STAI = 1
89 changes: 89 additions & 0 deletions firmware/boards/LUCIDCODE_INSPEC_N6/boot_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
* SPDX-License-Identifier: MIT
*
* Copyright (C) 2013-2024 OpenMV, LLC.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
* Board configuration and pin definitions.
*/
// *INDENT-OFF*
#ifndef __BOOT_CONFIG_H__
#define __BOOT_CONFIG_H__
#include STM32_HAL_H
#include "Legacy/stm32_hal_legacy.h"
#include "port.h"

// Misc config.
#define OMV_BOOT_VID (0x37C5)
#define OMV_BOOT_PID (0x9206)
#define OMV_BOOT_DFU_TIMEOUT (1500)
#define OMV_BOOT_MAGIC_ADDR (0x3401FFFCU)
#define OMV_BOOT_LED_PIN (0) // index in omv_boot_pins

// Flash config.
#define OMV_BOOT_AXI_FLASH_ENABLE (0)
#define OMV_BOOT_SPI_FLASH_ENABLE (1)
#define OMV_BOOT_SPI_FLASH_MMAP (1) // Memory-map the flash on exit
#define OMV_BOOT_SPI_FLASH_MMAP_DTR (1)

// OSPI/XSPI config.
#define OMV_BOOT_XSPI_INSTANCE (2)
#define OMV_BOOT_XSPI_FREQUENCY (200000000)
#define OMV_BOOT_XSPI_FLASH_SIZE (0x2000000) // Must be a power of 2.
#define OMV_BOOT_XSPI_FLASH_RST_PIN (13) // index in omv_boot_pins

#define GPIO_SPEED_LOW GPIO_SPEED_FREQ_LOW
#define GPIO_SPEED_HIGH GPIO_SPEED_FREQ_VERY_HIGH

// Boot I/O pins.
static const pin_t omv_boot_pins[] = {
{ .gpio = GPIOA, .pin = GPIO_PIN_7, .speed = GPIO_SPEED_LOW, .mode = GPIO_MODE_OUTPUT_PP, .pull = GPIO_PULLUP },
{ .gpio = GPION, .pin = GPIO_PIN_0, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_1, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_2, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_3, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_4, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_5, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_6, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_7, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_8, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_9, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_10, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_11, .speed = GPIO_SPEED_HIGH, .mode = GPIO_MODE_AF_PP, .alt = GPIO_AF9_XSPIM_P2 },
{ .gpio = GPION, .pin = GPIO_PIN_12, .speed = GPIO_SPEED_LOW, .mode = GPIO_MODE_OUTPUT_PP, .pull = GPIO_PULLUP },
};
#define OMV_BOOT_PINS_COUNT (sizeof(omv_boot_pins) / sizeof(omv_boot_pins[0]))

// Boot partitions.
static const partition_t OMV_BOOT_DFU_PARTITIONS[] = {
{ .type = PTYPE_SPI_FLASH, .region = -1, .rdonly = 1, .start = 0x00000000, .limit = 0x00080000, .attr = 0 }, // Boot
{ .type = PTYPE_SPI_FLASH, .region = -1, .rdonly = 0, .start = 0x00080000, .limit = 0x00400000, .attr = 0 }, // FIRMWARE
{ .type = PTYPE_SPI_FLASH, .region = -1, .rdonly = 0, .start = 0x00400000, .limit = 0x00800000, .attr = 0 }, // FILESYSTEM
{ .type = PTYPE_SPI_FLASH, .region = -1, .rdonly = 0, .start = 0x00800000, .limit = 0x02000000, .attr = 0 }, // ROMFS0
};
#define OMV_BOOT_DFU_PARTITIONS_COUNT 4 // Must be a literal
#define OMV_BOOT_DFU_PARTITIONS_STR "BOOTLOADER", "FIRMWARE", "FILESYSTEM", "ROMFS0"

// XIP flash, not used for DFU.
static const partition_t OMV_BOOT_XIP_PARTITIONS[] = {
{ .type = PTYPE_XIP_FLASH, .region = 0, .rdonly = 1, .start = 0x70000000, .limit = 0x78000000, .attr = MEMATTR_NORMAL_WB_RA_WA },
};
#define OMV_BOOT_XIP_PARTITIONS_COUNT (sizeof(OMV_BOOT_XIP_PARTITIONS) / sizeof(OMV_BOOT_XIP_PARTITIONS[0]))
#endif //__BOOT_CONFIG_H__
149 changes: 149 additions & 0 deletions firmware/boards/LUCIDCODE_INSPEC_N6/imlib_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
/*
* This file is part of the OpenMV project.
*
* Copyright (c) 2013-2021 Ibrahim Abdelkader <iabdalkader@openmv.io>
* Copyright (c) 2013-2021 Kwabena W. Agyeman <kwagyeman@openmv.io>
*
* This work is licensed under the MIT license, see the file LICENSE for details.
*
* Image library configuration.
*/
#ifndef __IMLIB_CONFIG_H__
#define __IMLIB_CONFIG_H__

// Enable Image I/O
#define IMLIB_ENABLE_IMAGE_IO

// Enable Image File I/O
#define IMLIB_ENABLE_IMAGE_FILE_IO

// Enable LAB LUT
#define IMLIB_ENABLE_LAB_LUT

// Enable YUV LUT
//#define IMLIB_ENABLE_YUV_LUT

// Enable ISP ops
#define IMLIB_ENABLE_ISP_OPS

// Enable binary ops
#define IMLIB_ENABLE_BINARY_OPS

// Enable math ops
#define IMLIB_ENABLE_MATH_OPS

// Enable flood_fill()
#define IMLIB_ENABLE_FLOOD_FILL

// Enable mean()
#define IMLIB_ENABLE_MEAN

// Enable median()
#define IMLIB_ENABLE_MEDIAN

// Enable mode()
#define IMLIB_ENABLE_MODE

// Enable midpoint()
#define IMLIB_ENABLE_MIDPOINT

// Enable morph()
#define IMLIB_ENABLE_MORPH

// Enable Gaussian
#define IMLIB_ENABLE_GAUSSIAN

// Enable Laplacian
#define IMLIB_ENABLE_LAPLACIAN

// Enable bilateral()
#define IMLIB_ENABLE_BILATERAL

// Enable linpolar()
#define IMLIB_ENABLE_LINPOLAR

// Enable logpolar()
#define IMLIB_ENABLE_LOGPOLAR

// Enable lens_corr()
#define IMLIB_ENABLE_LENS_CORR

// Enable rotation_corr()
#define IMLIB_ENABLE_ROTATION_CORR

// Enable phasecorrelate()
#if defined(IMLIB_ENABLE_ROTATION_CORR)
#define IMLIB_ENABLE_FIND_DISPLACEMENT
#endif

// Enable get_similarity()
#define IMLIB_ENABLE_GET_SIMILARITY

// Enable find_lines()
#define IMLIB_ENABLE_FIND_LINES

// Enable find_line_segments()
#define IMLIB_ENABLE_FIND_LINE_SEGMENTS

// Enable find_circles()
#define IMLIB_ENABLE_FIND_CIRCLES

// Enable find_rects()
#define IMLIB_ENABLE_FIND_RECTS

// Enable find_qrcodes() (14 KB)
#define IMLIB_ENABLE_QRCODES

// Enable find_apriltags() (64 KB)
#define IMLIB_ENABLE_APRILTAGS
#define IMLIB_ENABLE_APRILTAGS_TAG36H11

// Enable fine find_apriltags() - (8-way connectivity versus 4-way connectivity)
// #define IMLIB_ENABLE_FINE_APRILTAGS

// Enable high res find_apriltags() - uses more RAM
#define IMLIB_ENABLE_HIGH_RES_APRILTAGS

// Enable find_datamatrices() (26 KB)
#define IMLIB_ENABLE_DATAMATRICES

// Enable find_barcodes() (42 KB)
#define IMLIB_ENABLE_BARCODES

// Enable find_features() and Haar cascades.
#define IMLIB_ENABLE_FEATURES

// Enable Tensor Flow
#define IMLIB_ENABLE_STAI

// Enable AGAST.
#define IMLIB_ENABLE_AGAST

// Enable find_template()
#define IMLIB_FIND_TEMPLATE

// Enable find_lbp()
#define IMLIB_ENABLE_FIND_LBP

// Enable find_keypoints()
#if defined(IMLIB_ENABLE_FAST) || defined(IMLIB_ENABLE_AGAST)
#define IMLIB_ENABLE_FIND_KEYPOINTS
#endif

// Enable load, save and match descriptor
#define IMLIB_ENABLE_DESCRIPTOR

// Enable find_hog()
// #define IMLIB_ENABLE_HOG

// Enable selective_search()
// #define IMLIB_ENABLE_SELECTIVE_SEARCH

// Enable PNG encoder/decoder
#define IMLIB_ENABLE_PNG_ENCODER
#define IMLIB_ENABLE_PNG_DECODER

// Stereo Imaging
// #define IMLIB_ENABLE_STEREO_DISPARITY

#endif //__IMLIB_CONFIG_H__
57 changes: 57 additions & 0 deletions firmware/boards/LUCIDCODE_INSPEC_N6/manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# OpenMV library
add_library("openmv-lib", "$(OMV_LIB_DIR)")

# Drivers
require("onewire")
require("ds18x20")
require("dht")
require("neopixel")
freeze ("$(OMV_LIB_DIR)/", "modbus.py")
freeze ("$(OMV_LIB_DIR)/", "pid.py")
freeze ("$(OMV_LIB_DIR)/", "bno055.py")
freeze ("$(OMV_LIB_DIR)/", "ssd1306.py")
freeze ("$(OMV_LIB_DIR)/", "ssd1351.py")
freeze ("$(OMV_LIB_DIR)/", "pca9674a.py")
freeze ("$(OMV_LIB_DIR)/", "tb6612.py")
freeze ("$(OMV_LIB_DIR)/", "vl53l1x.py")
freeze ("$(OMV_LIB_DIR)/", "machine.py")
freeze ("$(OMV_LIB_DIR)/", "display.py")

# Bluetooth
require("aioble")
freeze ("$(OMV_LIB_DIR)/", "ble_advertising.py")

# Networking
require("ssl")
require("ntptime")
require("webrepl")
freeze ("$(OMV_LIB_DIR)/", "rpc.py")
freeze ("$(OMV_LIB_DIR)/", "rtsp.py")
freeze ("$(OMV_LIB_DIR)/", "mqtt.py")
freeze ("$(OMV_LIB_DIR)/", "requests.py")

# Utils
require("time")
require("senml")
require("logging")
freeze ("$(OMV_LIB_DIR)/", "mutex.py")

# Libraries
require("ml", library="openmv-lib")
include("$(MPY_DIR)/extmod/asyncio")

# Boot script
freeze ("$(OMV_LIB_DIR)/", "_boot.py")

# INSPEC
freeze ("$(TOP_DIR)/../../../../software", "ble.py")
freeze ("$(TOP_DIR)/../../../../software", "face.py")
freeze ("$(TOP_DIR)/../../../../software", "config.py")
freeze ("$(TOP_DIR)/../../../../software", "inspec.py")
freeze ("$(TOP_DIR)/../../../../software", "wifi.py")
freeze ("$(TOP_DIR)/../../../../software", "rem.py")
freeze ("$(TOP_DIR)/../../../../software", "nrem.py")
freeze ("$(TOP_DIR)/../../../../software", "quality.py")
freeze ("$(TOP_DIR)/../../../../software", "led.py")
freeze ("$(TOP_DIR)/../../../../software", "lsd.py")
freeze ("$(TOP_DIR)/../../../../software", "version.py")
Loading