Skip to content

Add hi3516ev300_lite_xm-85h50ai device profile (XiongMai, motorized zoom+focus) - #141

Merged
openipc-ai merged 2 commits into
masterfrom
xm-85h50ai
Aug 31, 2026
Merged

Add hi3516ev300_lite_xm-85h50ai device profile (XiongMai, motorized zoom+focus)#141
openipc-ai merged 2 commits into
masterfrom
xm-85h50ai

Conversation

@openipc-ai

Copy link
Copy Markdown
Contributor

New device profile for XiongMai's 85H50AI — hi3516ev300 + imx335 with a motorized zoom/focus module whose MCU shares /dev/ttyAMA0 with the serial console at 115200, speaking the XM near-Pelco protocol (majestic-webui#227, driver btzoom-xm). Everything here was proven on a lab unit driven end to end through the WebUI.

  • Defconfig: byte-copy of firmware's hi3516ev300_lite_defconfig — no symbol changes (no builder_only_symbols entries), NOR 8M squashfs. The lite image already ships btzoom-xm via majestic-webui's bin/. No excludes list: firmware has none for hi3516ev300_lite and rootfs_script.sh treats it as optional.
  • customizer.sh (first boot): sensor imx335, the upgrade URL, and the PTZ trio — ptz_control pelco-xm, ptz_port /dev/ttyAMA0, ptz_caps 'zoom focus' so the WebUI renders only the axes that exist out of the box (the module accepts pan/tilt frames and silently ignores them). It also seds the getty line out of /etc/inittab — the MCU owns the console UART. Deliberately not an overlay override of inittab (that would shadow a firmware file and need a firmware-drift.json entry); the sed lands in the overlay and is self-healing: an upgrade that wipes the overlay also wipes /etc/custom.ok, so the customizer re-runs. Ends with the usual (sleep 3; reboot -f) &.
  • S01printk (additive overlay): quiets runtime kernel messages, which would otherwise drip onto the PTZ wire. Bootargs untouched — the MCU's 0xC5 framing demonstrably tolerates early-boot spray.
  • README row added. ci-matrix.py --self-test and check-firmware-drift.py --self-test both green locally (no new trait — hi3516ev300_lite is covered by existing smoke targets).

Ordering note: the out-of-the-box zoom/focus-only UI depends on ptz_caps support — majestic-webui#261 — being merged before this device's image is built for release. Without it the pad simply shows all axes (pan/tilt presses are refused by the module), so nothing breaks, it's just not the intended out-of-box state.

…oom+focus)

XiongMai's 85H50AI: hi3516ev300 + imx335 with a motorized zoom/focus
module whose MCU shares /dev/ttyAMA0 with the serial console at 115200,
speaking the XM near-Pelco protocol (majestic-webui's btzoom-xm).
Everything below was proven on a lab unit driven end to end through the
WebUI (majestic-webui#227).

The defconfig is a byte-copy of firmware's hi3516ev300_lite_defconfig —
no symbol changes, so no drift entries; the lite image already ships
btzoom-xm via majestic-webui's bin/. No excludes list: firmware has none
for hi3516ev300_lite and rootfs_script.sh treats it as optional.

customizer.sh (first boot) sets sensor, the upgrade URL, and the PTZ
trio — ptz_control pelco-xm, ptz_port /dev/ttyAMA0, and
ptz_caps 'zoom focus' so the WebUI renders only the axes that exist (the
module accepts pan/tilt frames and silently ignores them). It also
deletes the getty line from /etc/inittab: the MCU owns the console UART.
The edit lands in the overlay, and an upgrade that wipes the overlay
also wipes /etc/custom.ok, so the script re-runs and the camera heals
itself. Ends with the usual reboot so it all takes effect.

S01printk quiets runtime kernel messages, which would otherwise drip
onto the PTZ wire; bootargs stay untouched (the MCU's 0xC5 framing
tolerates early-boot spray).
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Add XiongMai 85H50AI zoom and focus device profile

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

Grey Divider

AI Description

• Adds an 8 MB HiSilicon profile for XiongMai 85H50AI cameras.
• Configures IMX335 and zoom/focus-only Pelco-XM control through the shared console UART.
• Disables UART getty and runtime kernel logging to prevent PTZ interference.
Diagram

graph TD
  A["Device profile"] --> B["First boot"] --> C["Boot settings"] --> D["WebUI PTZ"] --> G["Shared UART"] --> H["Motor MCU"]
  B --> E["Getty disabled"] --> G
  A --> F["Printk init"] --> G
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Replace inittab through the overlay
  • ➕ Makes the UART ownership change declarative in the image
  • ➕ Avoids modifying the file during first boot
  • ➖ Shadows a firmware-owned file
  • ➖ Requires firmware-drift tracking and ongoing synchronization
2. Disable the console in boot arguments
  • ➕ Prevents both early and runtime kernel output on the motor UART
  • ➕ Eliminates the need for a printk init script
  • ➖ Changes bootloader environment with greater recovery risk
  • ➖ Is unnecessary because the MCU tolerates early framed noise

Recommendation: Keep the tested first-boot inittab edit plus additive printk script. It preserves self-healing behavior after overlay resets, avoids shadowing firmware files, and limits console changes to what the motor protocol requires. Release builds should still be gated on WebUI ptz_caps support for the intended zoom/focus-only controls.

Files changed (4) +121 / -0

Enhancement (1) +41 / -0
customizer.shConfigure sensor and Pelco-XM zoom/focus control +41/-0

Configure sensor and Pelco-XM zoom/focus control

• Sets the IMX335 sensor, device-specific upgrade URL, Pelco-XM controller, ttyAMA0 port, and zoom/focus capabilities on first boot. It removes the serial getty to give the motor MCU exclusive UART access, then reboots to apply the settings.

devices/hi3516ev300_lite_xm-85h50ai/general/overlay/usr/share/openipc/customizer.sh

Documentation (1) +1 / -0
README.mdList the XiongMai 85H50AI device +1/-0

List the XiongMai 85H50AI device

• Adds the camera model, Hi3516EV300 SoC, IMX335 sensor, 8 MB NOR size, and motorized Pelco-XM zoom/focus status to the supported-device table.

README.md

Other (2) +79 / -0
hi3516ev300_lite_xm-85h50ai_defconfigDefine the 8 MB Hi3516EV300 lite image +64/-0

Define the 8 MB Hi3516EV300 lite image

• Adds the Buildroot profile for the ARM Cortex-A7 Hi3516EV300 platform with squashfs, the standard lite package set, Majestic WebUI, and motor support. The configuration mirrors the base firmware profile without device-specific symbol drift.

devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig

S01printkSilence runtime console output on the PTZ UART +15/-0

Silence runtime console output on the PTZ UART

• Adds an early userland init script that sets kernel printk level to zero. This prevents runtime kernel messages from interfering with the motor MCU while leaving tolerated early-boot output unchanged.

devices/hi3516ev300_lite_xm-85h50ai/general/overlay/etc/init.d/S01printk

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Exclude list is missing 📘 Rule violation ≡ Correctness 1
Description
The new registered device omits general/scripts/excludes/hi3516ev300_lite.list, although the
required device layout mandates that artifact. Without the device-specific pruning list, the NOR 8M
image also lacks the repository's standard mechanism for controlling root filesystem size.
Code

devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig[1]

+# Architecture
Evidence
PR Compliance ID 1 requires every registered device to contain
general/scripts/excludes/<soc>_<flavor>.list. The added defconfig registers
hi3516ev300_lite_xm-85h50ai, while repository inspection shows its general/ tree contains only
overlay/; the repository's own layout documentation independently identifies the missing
exclude-list path as mandatory.

Rule 1: New Devices Must Use the Required Directory Naming and File Layout
devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig[1-1]
README.md[143-154]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new device is registered by its defconfig but does not include the required `general/scripts/excludes/hi3516ev300_lite.list` artifact.

## Issue Context
Create the SoC/flavor exclude list in the device directory. Ensure it prunes only unused rootfs content and retains the IMX335 sensor library/configuration and every driver needed by this no-WiFi board.

## Fix Focus Areas
- devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can type 'qodo, fix this' on a finding and the fix lands right on your PR

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@@ -0,0 +1,64 @@
# Architecture

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

1. Exclude list is missing 📘 Rule violation ≡ Correctness

1

The new registered device omits general/scripts/excludes/hi3516ev300_lite.list, although the
required device layout mandates that artifact. Without the device-specific pruning list, the NOR 8M
image also lacks the repository's standard mechanism for controlling root filesystem size.
Agent Prompt
## Issue description
The new device is registered by its defconfig but does not include the required `general/scripts/excludes/hi3516ev300_lite.list` artifact.

## Issue Context
Create the SoC/flavor exclude list in the device directory. Ensure it prunes only unused rootfs content and retains the IMX335 sensor library/configuration and every driver needed by this no-WiFi board.

## Fix Focus Areas
- devices/hi3516ev300_lite_xm-85h50ai/br-ext-chip-hisilicon/configs/hi3516ev300_lite_xm-85h50ai_defconfig[1-1]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

…ive image

The registration rules name general/scripts/excludes/<processor>_<flavor>.list
as a required profile file, and on an 8M NOR board it earns its keep: this
board is imx335 only, so every other sensor's .so and ini goes. The entries
were generated from the file inventory of the lite image running on the lab
85H50AI rather than copied from another profile's list, so none of them is
stale on arrival (rootfs_script.sh warns when an entry matches nothing).
imx335 keeps both lane variants, iq/default.ini and its WDR configs.
@openipc-ai
openipc-ai merged commit 3921b34 into master Aug 31, 2026
6 checks passed
@openipc-ai
openipc-ai deleted the xm-85h50ai branch August 31, 2026 13:00
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.

1 participant