Skip to content

Add hi3516cv200_lite_spezvision-svi-252b-k202 device profile (SpezVis… - #161

Merged
openipc-ai merged 2 commits into
OpenIPC:masterfrom
ArthurKoba:port/svi-252b-hi3516cv200-imx323-final
Sep 19, 2026
Merged

openipc-ai merged 2 commits into
OpenIPC:masterfrom
ArthurKoba:port/svi-252b-hi3516cv200-imx323-final

Conversation

@ArthurKoba

Copy link
Copy Markdown
Contributor

Adds a device profile for the SpezVision SVI-252B K202 — HiSilicon
HI3516CV200, Sony IMX323, 8 MiB SPI NOR, wired Ethernet only.

The board needs a few device-specific settings beyond the standard
HI3516CV200 lite configuration:

  • IMX323 uses the I2C/DC 1080p sensor configuration.
  • The hardware daylight sensor is GPIO3_0 / GPIO24.
  • The bistable IR-cut filter uses GPIO4_2 / GPIO34 and GPIO4_1 / GPIO33.
  • muxes.sh selects GPIO mode for GPIO3_0 (0x200f0034 = 0) on every
    boot, independently of the selected streamer.
  • The board has no SD/MMC, Wi-Fi or used USB path, so the device kernel
    fragment disables those unused subsystems.
  • The 8 MiB image excludes unused sensor and peripheral files.
  • No backlightPin is configured because a separate software-controlled
    IR illuminator GPIO was not proven for this board.

Tested on a physical SpezVision SVI-252B K202: the firmware builds,
flashes and boots successfully; IMX323 video, Ethernet, the hardware
daylight sensor and automatic IR-cut switching are working.

One remaining visual quirk is outside the Builder profile: Majestic can
show a brief purple/magenta frame during the color-to-grayscale transition.
A configurable intra-transition delay is tracked in OpenIPC/majestic#325.
No board-specific workaround is included here.

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add SpezVision SVI-252B K202 HI3516CV200 device profile

✨ Enhancement ⚙️ Configuration changes 📝 Documentation 🕐 20-40 Minutes

Grey Divider

AI Description

• Adds an 8 MiB OpenIPC profile for SpezVision SVI-252B K202 cameras.
• Configures IMX323 video, daylight sensing, IR-cut GPIOs, and boot-time pin multiplexing.
• Removes absent storage, wireless, USB, and unused sensor support from firmware.
Diagram

graph TD
  P["Device Profile"] -->|selects| D["Build Config"] -->|builds| I["8 MiB Image"] -->|runs| B["Boot Scripts"] -->|configures| H["Camera Hardware"]
  P -->|merges| K["Kernel Fragment"] -->|trims drivers| I
  P -->|applies| E["Exclusion List"] -->|trims files| I
Loading
High-Level Assessment

A dedicated device profile is the appropriate repository-standard approach. Reusing another HI3516CV200 profile was considered, but this board requires distinct kernel pruning, image exclusions, sensor settings, GPIO assignments, and pinmux initialization.

Files changed (7) +220 / -0

Enhancement (1) +35 / -0
customizer.shConfigure IMX323 and board day/night controls +35/-0

Configure IMX323 and board day/night controls

• Sets the device upgrade target and IMX323 I2C/DC sensor configuration. It enables daylight monitoring, assigns the GPIO24 sensor and GPIO34/GPIO33 bistable IR-cut outputs, and configures H.264 at 25 FPS.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/general/overlay/usr/share/openipc/customizer.sh

Documentation (1) +1 / -0
README.mdRegister the SpezVision camera in the device matrix +1/-0

Register the SpezVision camera in the device matrix

• Adds the SVI-252B K202 as a completed HI3516CV200, IMX323, wired-only, 8 MiB NOR target.

README.md

Other (5) +184 / -0
spezvision-svi-252b-k202.fragmentDisable unsupported board peripherals in the kernel +39/-0

Disable unsupported board peripherals in the kernel

• Disables absent SD/MMC, wireless, USB, SCSI, FAT, and SPI NAND support. This avoids unnecessary probing and reduces the kernel footprint while retaining the board's required interfaces.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/br-ext-chip-hisilicon/board/hi3516cv200/spezvision-svi-252b-k202.fragment

hi3516cv200_lite_spezvision-svi-252b-k202_defconfigDefine the HI3516CV200 lite firmware build +60/-0

Define the HI3516CV200 lite firmware build

• Adds the Buildroot target for an 8 MiB HI3516CV200 SPI NOR image. It selects the board kernel fragment, HiSilicon platform packages, Majestic, networking utilities, and compressed root filesystems.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/br-ext-chip-hisilicon/configs/hi3516cv200_lite_spezvision-svi-252b-k202_defconfig

modulesSuppress removable-storage module loading +2/-0

Suppress removable-storage module loading

• Overrides the common module list with an empty board-specific list so startup does not load FAT or exFAT modules for nonexistent removable storage.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/general/overlay/etc/modules

muxes.shApply the daylight-sensor pinmux at boot +11/-0

Apply the daylight-sensor pinmux at boot

• Programs register 0x200f0034 to mux GPIO3_0 as the digital daylight sensor input independently of the selected streaming runtime.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/general/overlay/usr/share/openipc/muxes.sh

hi3516cv200_lite.listPrune unused files from the 8 MiB image +72/-0

Prune unused files from the 8 MiB image

• Excludes unrelated sensor configurations and libraries plus unused IR, RTC, iris, staging, and F2FS modules. The retained image is tailored to the board's IMX323 sensor and limited NOR capacity.

devices/hi3516cv200_lite_spezvision-svi-252b-k202/general/scripts/excludes/hi3516cv200_lite.list

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can describe a rule in plain language on the Rules page and Qodo drafts it for you

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

rootfs_script.sh tests every entry with [ -e "${TARGET_DIR}${entry}" ] against
the literal string, so a path containing a glob never expands and never deletes
anything. Both lines came across from the sibling hi3516cv200_lite list:

  /lib/modules/4.9.37/kernel/drivers/staging/*/*.ko
  /lib/modules/4.9.37/kernel/fs/f2fs/*.ko

Neither has a live target on this board in any case. hi3516cv200.generic.config
carries "# CONFIG_F2FS_FS is not set", and the one staging module that would
otherwise be built here is r8188eu, which this device's kernel fragment already
switches off at CONFIG_R8188EU.

Left in, every build of this device would print "excludes: 2 of 72 entries in
hi3516cv200_lite.list matched no file" — the same permanently-on warning OpenIPC#155
cleared out of five hi3518ev200_lite lists. That warning is how a stale exclude
gets noticed, so it should not be on by default.

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against hi3516cv200_lite_trassir-tr-d4121ir1-v2 (the only other Hi3516CV200 lite profile) and against what the firmware packages actually install. This is a careful profile — a few notes on what I checked, and one thing I pushed to the branch.

Exclude list. I walked it against the real install set rather than against the sibling's list, since the sibling's is itself incomplete. hisilicon-osdrv-hi3516cv200 installs 26 sensor .ini, 6 IQ .ini plus the default.ini -> ar0130.ini symlink, and 11 libsns_*.so plus the libsns_imx323_i2c_dc.so -> _v1.so symlink; hisilicon-opensdk adds 18 more .so for this family plus the libsns_ov2710_dc/_mipi symlinks. Your list removes every one of those except imx323_i2c_dc_1080p.ini, libsns_imx323_i2c_dc_v1.so and its symlink — which is exactly what the DllFile line in that .ini points at. ircut_demo, ir.ko, hi_rtc.ko and piris.ko are all genuinely installed for CV200 (ir.ko/piris.ko come from opensdk, not osdrv), so those four entries are live too. Emptying /etc/sensors/iq/ including the default.ini symlink matches what hi3518ev200_lite_switcam-hs303 and gk7202v300_lite_ipg-g3-wr already do.

Two entries could never match, so I pushed b177412 removing them:

/lib/modules/4.9.37/kernel/drivers/staging/*/*.ko
/lib/modules/4.9.37/kernel/fs/f2fs/*.ko

general/scripts/rootfs_script.sh tests [ -e "${TARGET_DIR}${entry}" ] on the literal string, so a glob never expands. They are dead on their own terms here as well — hi3516cv200.generic.config has # CONFIG_F2FS_FS is not set, and the one staging module that would otherwise be built is r8188eu, which your fragment already turns off at CONFIG_R8188EU. Left in they would print excludes: 2 of 72 entries ... matched no file on every build, the same permanently-on warning #155 cleared out of five other lists. They came across from the sibling; no fault of the port.

Kernel fragment. Nice — this is the first device here to use BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES instead of forking the whole 60 KB hi3516cv200.generic.config into the device directory the way the sibling does, so it cannot go stale against upstream. All 27 symbols exist and are enabled in the generic config, so every line does work; Buildroot 2024.02.10's merge_config.sh recognises the # CONFIG_X is not set form; and $(EXTERNAL_VENDOR) resolves through general/external.mk the same way the CUSTOM_CONFIG_FILE line above it does. The NOR path (CONFIG_MTD_SPI_NOR, CONFIG_SPI_HISI_SFC) is untouched by the NAND lines.

Runtime. muxes.sh is the right hook — S30customizer runs it unconditionally on every boot, devmem is in the busybox config, and mode 644 is fine since it is invoked as sh …. load_hisilicon's imx323) branch muxes I2C0 and the VI pads but never touches 0x200f0034, so nothing fights your GPIO3_0 setting. fw_setenv sensor imx323 is read back by rcS and S31hostname. Every cli -s path is a setting majestic actually carries — lightSensorInvert included, it ships in the stock /etc/majestic.yaml under nightMode: with a default of false — and lint-cli-paths.py is happy with the shapes.

Registration. ci-matrix.py --self-test passes at 116 devices and the diff narrows the build to this device alone. The upgrade URL filename matches what CI renames the artifact to, the exclude list keeps the <soc>_<flavor>.list name, and the README row is in sort order with the columns aligned.

Nothing else from me. Approving the workflow run now so we get a real build; the 8 MiB fit is the last open question and only the image can answer it.

@openipc-ai openipc-ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build is green — 10 min, rootfs 3956736 B with 1256 KB of headroom on the 8 MiB layout and 524 KB left on the kernel, and no stale entries left in the exclude list (114 files removed, nothing reported as unmatched). Tested on hardware by the author, verified against the packages here. Merging.

@openipc-ai
openipc-ai merged commit ca99173 into OpenIPC:master Sep 19, 2026
6 checks passed
@koba-ai-agent
koba-ai-agent Bot deleted the port/svi-252b-hi3516cv200-imx323-final branch September 20, 2026 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants