Skip to content

fix(platform): handle (null) boardinfo sysfs and recognize RDK S100 V1P1 device-tree - #205

Merged
JasperXzy merged 1 commit into
developfrom
fix/s100-v1p1-board-identity
Nov 24, 2026
Merged

JasperXzy merged 1 commit into
developfrom
fix/s100-v1p1-board-identity

Conversation

@JasperXzy

Copy link
Copy Markdown
Contributor

Background

On RDK S100 V1P1 hardware (adc_boardid = 0x6A87) running RDK OS 4.0.5 (6.1.158-rt58-DR-4.0.5-2605072025), the BSP boardinfo driver table only lists entries up to 0x6A86 (V1P0). When lookup fails, soc_name_show() formats a NULL pointer via %s, so /sys/class/boardinfo/soc_name (and board_type) outputs the literal string (null) even though /proc/device-tree/model correctly reports D-Robotics RDK S100 V1P1.

Previously:

  1. detect_target() / identify_target() treated "(null)" as a valid non-empty SoC string and immediately returned unknown (None / "") without falling through to /proc/device-tree/model.
  2. docs/release/platforms.json (and the C++ transcriptions) did not record D-Robotics RDK S100 V1P1 under s100.device_tree_models.

As a result, Model Zoo samples aborted during target detection on RDK S100 V1P1 even though hbm_runtime and BPU inference work normally.

Changes

  • docs/release/platforms.json: Add "D-Robotics RDK S100 V1P1" to s100.device_tree_models.
  • utils/py_utils/platforms.py: Treat literal "(null)" (case-insensitive) read from sysfs identity files as missing (None) in _read_identity() so fallback precedence continues to socinfo / /proc/device-tree/model, while preserving strict fail-closed behavior for genuine unknown/conflicting non-null strings.
  • utils/c_utils/platform_identity.h: Mirror the exact "(null)" handling and "D-Robotics RDK S100 V1P1" device-tree match to preserve registry parity with Python.
  • utils/py_utils/inspect.py: Fall back to platforms.detect_target() in get_soc_name() and get_soc_name_fallback_free() when /sys/class/boardinfo/soc_name is missing or "(null)".
  • samples/vision/fasterrcnn/runtime/cpp/src/cli.cpp: Sync the embedded board identity table and read_identity() with docs/release/platforms.json and platforms.py.
  • Tests: Add regression & Python/C++ parity tests in utils/py_utils/tests/test_platforms.py, samples/vision/yoloe/tests/test_cpp_preflight.py, and samples/vision/yoloe/runtime/cpp/tests/test_preflight.cc.

Verification

  • python3 -m unittest -v utils/py_utils/tests/test_platforms.py (10/10 PASS)
  • python3 -m unittest -v utils/py_utils/tests/test_platform_profile.py (11/11 PASS)
  • python3 -m unittest -v samples/vision/yoloe/tests/test_cpp_preflight.py (2/2 PASS, C++17 -Wall -Wextra -Werror parity verified)
  • python3 -m unittest -v samples/vision/fasterrcnn/tests/test_cpp_host_parity.py (2/2 PASS)

@JasperXzy
JasperXzy requested a review from maxma615 as a code owner November 24, 2026 11:24
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T11:27:19.046160Z d6476f9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d6476f999a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +209 to +210
std::string result = text.substr(begin, end - begin);
if (to_lower(result) == "(null)") return "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Trim sysfs padding before comparing the null sentinel

On the S100 V1P1 board this change targets, sysfs returns (null)\n, so this comparison does not recognize the missing identity. The preceding kPad is constructed from a C string beginning with \x00, making it empty and leaving the newline untouched; calling this implementation with (null)\n returns seven characters rather than an empty string. Consequently, detect_board_target() still takes the nonempty-SoC branch and never reaches the newly registered device-tree fallback. Construct the padding string with an explicit length or use the shared trimming helper before checking the sentinel; cover newline-terminated sysfs and NUL-terminated device-tree values in the Faster R-CNN tests.

Useful? React with 👍 / 👎.

@JasperXzy
JasperXzy merged commit cfd1fce into develop Nov 24, 2026
3 checks passed
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