Skip to content

Switcam B200 - #156

Open
Puzzak01 wants to merge 6 commits into
OpenIPC:masterfrom
Puzzak01:patch-3
Open

Switcam B200#156
Puzzak01 wants to merge 6 commits into
OpenIPC:masterfrom
Puzzak01:patch-3

Conversation

@Puzzak01

Copy link
Copy Markdown
Contributor

No description provided.

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

Copy link
Copy Markdown

PR Summary by Qodo

Add Switcam B200 SSC337DE device profile

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

Grey Divider

AI Description

• Add an SSC337DE NAND profile for the Switcam B200 camera.
• Configure video, audio, night mode, GPIO mappings, and device-specific upgrades.
• Reduce firmware contents by excluding unused NFS and SunRPC kernel modules.
Diagram

graph TD
  A["Firmware build"] --> B["B200 profile"] --> C["Customizer"] --> F["Runtime settings"]
  B --> D["GPIO map"]
  B --> E["Module excludes"]
Loading
High-Level Assessment

The device-scoped profile is the appropriate approach because the upgrade artifact, GPIO assignments, and Majestic defaults are specific to the Switcam B200 and follow existing repository conventions. Sharing these settings through a generic SSC337DE profile would risk applying hardware-specific behavior to unrelated cameras.

Files changed (4) +45 / -0

Documentation (1) +1 / -0
README.mdList Switcam B200 as a supported camera +1/-0

List Switcam B200 as a supported camera

• Adds the completed Switcam B200 to the device compatibility table with its SSC337DE SoC, SC223A sensor, and NAND storage.

README.md

Other (3) +44 / -0
customizer.shConfigure Switcam B200 runtime defaults +26/-0

Configure Switcam B200 runtime defaults

• Adds the device upgrade URL and configures H.264 video, image orientation, night-mode GPIOs, and AAC audio defaults through the OpenIPC CLI.

devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh

gpio.confDefine Switcam B200 GPIO assignments +13/-0

Define Switcam B200 GPIO assignments

• Maps GPIOs 13 and 12 to the IR-cut controls and GPIO 52 to infrared illumination. Marks unsupported or unused peripherals with disabled assignments.

devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/gpio.conf

ssc337de.listExclude unused network filesystem modules +5/-0

Exclude unused network filesystem modules

• Removes NFS, NFSv3, lockd, grace, and SunRPC kernel modules from the device firmware package.

devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list

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

qodo-free-for-open-source-projects Bot commented Sep 12, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (2) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Action required

1. New camera cannot enter build matrix ✓ Resolved 📘 Rule violation ≡ Correctness
Description
The ssc337de_ultimate_switcam-b200 device directory contains only its customizer, GPIO
configuration, and exclusion list, with no matching
br-ext-chip-sigmastar/configs/ssc337de_ultimate_switcam-b200_defconfig. Because builder.sh and
the CI matrix derive targets exclusively from matching *_defconfig files, explicit selection
resolves no source tree, CI omits the camera, and no build can copy its configuration or produce the
NAND archive referenced by its upgrade URL.
Code

devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8]

+fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/ssc337de_ultimate_switcam-b200-nand.tgz'
Evidence
Rules 2, 3, and 9 and the README require a board-named defconfig for a buildable image, while local
discovery, explicit board resolution, and CI all derive their targets exclusively from matching
*_defconfig files. The device currently contains only general/, so there is no registered target
capable of configuring the camera or producing its referenced upgrade archive.

Rule 2: Registered Devices Must Include the Required Files and Layout
Rule 2: Defconfig Name and Hardware Settings Must Match the Device
Rule 8: Device Firmware Must Build and Fit the Declared Flash Size
devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8-8]
builder.sh[88-92]
builder.sh[120-122]
.github/scripts/ci-matrix.py[145-152]
README.md[146-157]
builder.sh[88-96]
builder.sh[120-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 Switcam B200 device has no board-specific defconfig, so repository discovery, explicit builds, and CI do not recognize it as a build target and cannot produce the referenced NAND archive.
## Fix Focus Areas
- devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8-8]
## Recommended Fix
Add `devices/ssc337de_ultimate_switcam-b200/br-ext-chip-sigmastar/configs/ssc337de_ultimate_switcam-b200_defconfig`, based on the closest SSC337DE ultimate configuration. Configure it with hardware-appropriate SoC, variant, flash and NAND layout, toolchain, kernel, SC223A sensor, and required package settings.

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


2. First boot requests a missing update 📘 Rule violation ☼ Reliability
Description
customizer.sh stores an upgrade URL ending in ssc337de_ultimate_switcam-b200-nand.tgz instead of
the required ssc337de_ultimate_switcam-b200-nor.tgz. When the camera invokes its seeded updater,
it requests a filename outside the board artifact convention used by the release flow.
Code

devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8]

+fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/ssc337de_ultimate_switcam-b200-nand.tgz'
Evidence
Rule 4 requires the seeded URL to end with exactly -nor.tgz; the added command instead stores a
URL ending in -nand.tgz.

Rule 3: First-Boot Customizer Must Use Correct Device Runtime Configuration
devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8-8]

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 first-boot upgrade URL names a NAND archive rather than the required board-specific NOR release artifact.
## Fix Focus Areas
- devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8-8]
## Recommended Fix
Change the URL suffix from `ssc337de_ultimate_switcam-b200-nand.tgz` to `ssc337de_ultimate_switcam-b200-nor.tgz`.

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


3. Firmware keeps unwanted kernel modules 📘 Rule violation ➹ Performance
Description
The new exclusion file is named ssc337de.list instead of the flavor-qualified lookup key
ssc337de_ultimate.list, even though the device identity declares the ultimate flavor and the
repository selects _.list. Because the device payload is copied without renaming files, builds for
this target do not consume its five module deletions, retaining the listed NFS modules and
preventing those exclusions from contributing to image sizing.
Code

devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list[1]

+/lib/modules/4.9.84/kernel/fs/lockd/lockd.ko
Evidence
Repository documentation requires exclusion-list filenames to include both processor and flavor and
explains that these lists delete rootfs paths for image sizing. The board token declares the
ultimate flavor, the existing SSC337DE lite device demonstrates the same flavor-qualified
convention, and the added file is named only ssc337de.list, so it cannot match the required
ssc337de_ultimate.list lookup.

Rule 4: Exclude Lists Must Preserve Required Drivers and Use the SoC-Flavor Filename
devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list[1-5]
README.md[153-157]
builder.sh[153-154]
README.md[146-159]
CLAUDE.md[54-70]
CLAUDE.md[110-114]
devices/ssc337de_lite_zte-k543/general/scripts/excludes/ssc337de_lite.list[1-24]

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 exclusion filename omits the target's `ultimate` flavor, so it does not match the SoC-and-flavor lookup used for this board and its exclusions are not applied.
## Fix Focus Areas
- devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list[1-5]
## Recommended Fix
Rename `devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list` to `devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de_ultimate.list`, preserving all current exclusion entries unchanged.

ⓘ 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 hide the parts of a finding you never read, like the evidence or the agent prompt

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

#
# Set custom upgrade url
#
fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/ssc337de_ultimate_switcam-b200-nand.tgz'

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

2. First boot requests a missing update 📘 Rule violation ☼ Reliability

3

customizer.sh stores an upgrade URL ending in ssc337de_ultimate_switcam-b200-nand.tgz instead of
the required ssc337de_ultimate_switcam-b200-nor.tgz. When the camera invokes its seeded updater,
it requests a filename outside the board artifact convention used by the release flow.
Agent Prompt
## Issue description
The first-boot upgrade URL names a NAND archive rather than the required board-specific NOR release artifact.

## Fix Focus Areas
- devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh[8-8]

## Recommended Fix
Change the URL suffix from `ssc337de_ultimate_switcam-b200-nand.tgz` to `ssc337de_ultimate_switcam-b200-nor.tgz`.

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

@@ -0,0 +1,5 @@
/lib/modules/4.9.84/kernel/fs/lockd/lockd.ko

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

3. Firmware keeps unwanted kernel modules 📘 Rule violation ➹ Performance

4

The new exclusion file is named ssc337de.list instead of the flavor-qualified lookup key
ssc337de_ultimate.list, even though the device identity declares the ultimate flavor and the
repository selects <soc>_<flavor>.list. Because the device payload is copied without renaming
files, builds for this target do not consume its five module deletions, retaining the listed NFS
modules and preventing those exclusions from contributing to image sizing.
Agent Prompt
## Issue description
The exclusion filename omits the target's `ultimate` flavor, so it does not match the SoC-and-flavor lookup used for this board and its exclusions are not applied.

## Fix Focus Areas
- devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list[1-5]

## Recommended Fix
Rename `devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de.list` to `devices/ssc337de_ultimate_switcam-b200/general/scripts/excludes/ssc337de_ultimate.list`, preserving all current exclusion entries unchanged.

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

@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.

Thanks for the profile — the runtime side (GPIO map, night-mode pins, audio) looks like real hardware work. But the device is not registered, so nothing here is reachable by a build yet.

Blocking: there is no defconfig

devices/ssc337de_ultimate_switcam-b200/ ships only general/. The file that registers a device is missing:

devices/ssc337de_ultimate_switcam-b200/br-ext-chip-sigmastar/configs/ssc337de_ultimate_switcam-b200_defconfig

Its name must match the directory name exactly — that is what make BOARD= looks up, and ./builder.sh ssc337de_ultimate_switcam-b200 fails without it.

The consequence is worse than "the board is not built", and it is visible on this PR right now:

$ python3 .github/scripts/ci-matrix.py --self-test     # master: 114 devices
$ python3 .github/scripts/ci-matrix.py --self-test     # this branch: 114 devices

$ gh pr view 156 --json files -q '.files[].path' | python3 .github/scripts/ci-matrix.py --stdin
ci-matrix: 114/114 devices (needs_build=True) --- devices/ssc337de_ultimate_switcam-b200/general/overlay/usr/share/openipc/customizer.sh is in no directory CI builds

Two things fall out of that. The self-test passes, because a directory with no defconfig is not in the device set at all — there is nothing for it to disagree about, so CI cannot warn you. And because ci-matrix.py maps a changed file to "the devices whose defconfig shares its directory", an unrecognised path widens back to the full matrix instead of narrowing. Run 34712449145 on this branch is therefore building all 114 devices, none of which is the B200.

The closest template is devices/ssc337de_ultimate_foscam-x5/ — same SoC, same ultimate flavor. Copy its defconfig and change the SoC/flash/WiFi/sensor lines for this board. Note BR2_OPENIPC_FLASH_SIZE is the NOR/NAND size in MB and is still required.

Also

Three inline comments below: the excludes filename, the -nand.tgz artifact name, and the README row position.

Happy to help with the defconfig if you can post the board's flash size, WiFi module (if any) and NAND geometry — those are the parts only someone with the hardware can supply.

@@ -0,0 +1,5 @@
/lib/modules/4.9.84/kernel/fs/lockd/lockd.ko

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.

This list will never be read — it needs the flavor in its name.

The filename is computed by the firmware, not taken from the device directory. general/scripts/rootfs_script.sh:25:

LIST="${BR2_EXTERNAL_GENERAL_PATH}/scripts/excludes/${OPENIPC_SOC_MODEL}_${OPENIPC_VARIANT}.list"

For this board that resolves to ssc337de_ultimate.list, so ssc337de.list is never opened. And the whole block is wrapped in if [ -f "${LIST}" ] — the script reports, never fails — so a misnamed list prunes nothing and prints no diagnostic at all. Rename the file to ssc337de_ultimate.list (keep it named after soc+flavor, not the device).

While you are in here: this list carries only the five nfs/sunrpc entries, where the sibling devices/ssc337de_lite_zte-k543/general/scripts/excludes/ssc337de_lite.list also prunes 18 sensor_*_mipi.ko. Worth mirroring that block minus sensor_sc223a_mipi.ko, which is the sensor this board actually uses.

One thing not to rely on as a substitute: pinning BR2_OPENIPC_SNS_MODEL="sc223a" in the defconfig will not cover those modules. general/package/sigmastar-osdrv-infinity6b0/sigmastar-osdrv-infinity6b0.mk branches on OPENIPC_SNS_MODEL only for /etc/sensors/*.bin; the sensor_*_mipi.ko come from the kernel build and are unaffected. (This is the opposite of T31, where pinning the sensor does make the list redundant.)

Once the list is being read you can confirm it in the build log — rootfs_script.sh prints excludes: N of M entries in <name> matched no file for a list it opened, which is the cheap way to tell a working list from a decorative one.

#
# Set custom upgrade url
#
fw_setenv upgrade 'https://github.com/OpenIPC/builder/releases/download/latest/ssc337de_ultimate_switcam-b200-nand.tgz'

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.

-nand.tgz needs confirming — it is only produced under one condition.

A nand artifact exists only when the defconfig sets BR2_TARGET_ROOTFS_UBI=y; see the repack target in the firmware Makefile:

ifeq ($(BR2_TARGET_ROOTFS_UBI),y)
ifneq ($(filter $(BR2_OPENIPC_SOC_VENDOR),"rockchip" "sigmastar"),)
	@$(call PREPARE_REPACK,,,rootfs.ubi,16384,nand)

CI then renames it to <device>-nand.tgz, so the name here is right if the build emits one — which cannot be checked, because the defconfig is missing.

Worth a deliberate answer rather than a default: every NAND board currently in the tree points its upgrade URL at -nor.tgz, not -nand.tgzhi3516ev300_ultimate_rostelecom-ipc8232swc-we, hi3516ev300_ultimate_rvi-1ncmw2028, and ssc325de_lite_imou-c22ep-s2 (the closest match: sigmastar, BR2_TARGET_ROOTFS_UBI=y). They all set BR2_TARGET_ROOTFS_SQUASHFS=y alongside UBI and so build both artifacts.

So either set BR2_TARGET_ROOTFS_UBI=y and keep -nand.tgz deliberately, or match the siblings. Please say which, so whoever hits a broken self-update later can find the reasoning.

(The Qodo bot above states -nor.tgz is mandatory — that is not true in general, the suffix follows the artifact the build actually produces.)

Comment thread README.md
Smartwares CIP-37210AT T21N JXF37 RTL8188FU_USB NOR_16M done
Switcam HS303 v1 HI3518EV200 JXF22 RTL8188FU_USB NOR_16M done
Switcam HS303 v2 HI3518EV200 OV9732 RTL8188EU_USB NOR_16M done
Switcam B200 SSC337DE SC223A NAND done

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.

Small one: the table is sorted alphabetically, so Switcam B200 belongs above the two Switcam HS303 rows, not below them. Column alignment itself is correct.

Also worth confirming rather than leaving blank: the WiFi column is empty and the customizer sets no fw_setenv wlandev. Those two are at least consistent with each other, but an ethernet-only Switcam is unusual — if the board does have a WiFi module, both this row and the defconfig's BR2_PACKAGE_<chip>_OPENIPC=y line need it.

@openipc-ai

Copy link
Copy Markdown
Contributor

Thanks for the quick turnaround — two of the three are properly fixed:

  • ssc337de_ultimate.list is now the name rootfs_script.sh actually looks up, so the list will be read.
  • BR2_TARGET_ROOTFS_UBI=y (plus UBI_SUBSIZE, ubinize_sigmastar.cfg, LEBSIZE=0x1f000) means the build really does emit a nand artifact, so -nand.tgz in the customizer is correct rather than aspirational. Matching ssc325de_lite_imou-c22ep-s2 there was the right call.

The blocker is still open, though — and for a reason you cannot see anywhere in the GitHub UI.

The defconfig filename ends in an invisible character

ssc337de_ultimate_switcam-b200_defconfig has a stray U+200E LEFT-TO-RIGHT MARK appended to it:

$ ls devices/ssc337de_ultimate_switcam-b200/br-ext-chip-sigmastar/configs/ | cat -A
ssc337de_ultimate_switcam-b200_defconfigM-bM-^@M-^N$
                                         ^^^^^^^^^^  e2 80 8e = U+200E

It renders as nothing — in the file tree, in the diff, in the commit, in your editor. But the filename no longer equals the directory name, which is the exact string make BOARD= and ci-matrix.py look for, so nothing has changed since the last push:

$ python3 .github/scripts/ci-matrix.py --self-test
ci-matrix: self-test ok (114 devices, ...)          # identical to master -- device not registered

$ gh pr view 156 --json files -q '.files[].path' | python3 .github/scripts/ci-matrix.py --stdin
ci-matrix: 114/114 devices (needs_build=True) --- devices/ssc337de_ultimate_switcam-b200/br-ext-chip-sigmastar/configs/ssc337de_ultimate_switcam-b200_defconfig<U+200E> is in no directory CI builds

My guess is it rode along in a pasted filename — invisible marks like this are easy to pick up copying a name out of a rendered page or a chat client.

The fix

Deleting that one character is the whole fix. Verified locally on your branch:

$ python3 .github/scripts/ci-matrix.py --self-test
ci-matrix: self-test ok (115 devices, ...)

$ gh pr view 156 --json files -q '.files[].path' | python3 .github/scripts/ci-matrix.py --stdin
ci-matrix: 1/115 devices (needs_build=True) --- narrowed to the affected devices
  ssc337de_ultimate_switcam-b200

114 -> 115 devices, and the PR stops building the entire matrix and builds just your board.

Locally:

cd devices/ssc337de_ultimate_switcam-b200/br-ext-chip-sigmastar/configs
git mv "$(ls)" ssc337de_ultimate_switcam-b200_defconfig
git commit -m "strip stray U+200E from defconfig filename"

Or in the web UI: open the file, hit the pencil, clear the filename box completely and retype the name by hand rather than pasting it. Then confirm with ci-matrix.py --self-test -- it should say 115 devices, and that is the check CI runs too.

Happy to push the rename to patch-3 myself if you would rather not fight an invisible byte -- maintainer_can_modify is on. Just say the word.

Still open from the earlier review, neither blocking:

  • The excludes list is still only the five nfs/sunrpc entries. Mirroring the sensor block from ssc337de_lite.list (minus sensor_sc223a_mipi.ko, which this board uses) is what the list is for, though at 16M NAND you have the room either way.
  • The README row sorts below the two Switcam HS303 rows; alphabetically B200 goes above them.

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