Repository navigation
fix(platform): handle (null) boardinfo sysfs and recognize RDK S100 V1P1 device-tree - #205
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 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".
| std::string result = text.substr(begin, end - begin); | ||
| if (to_lower(result) == "(null)") return ""; |
There was a problem hiding this comment.
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 👍 / 👎.
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 BSPboardinfodriver table only lists entries up to0x6A86(V1P0). When lookup fails,soc_name_show()formats aNULLpointer via%s, so/sys/class/boardinfo/soc_name(andboard_type) outputs the literal string(null)even though/proc/device-tree/modelcorrectly reportsD-Robotics RDK S100 V1P1.Previously:
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.docs/release/platforms.json(and the C++ transcriptions) did not recordD-Robotics RDK S100 V1P1unders100.device_tree_models.As a result, Model Zoo samples aborted during target detection on RDK S100 V1P1 even though
hbm_runtimeand BPU inference work normally.Changes
docs/release/platforms.json: Add"D-Robotics RDK S100 V1P1"tos100.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 tosocinfo//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 toplatforms.detect_target()inget_soc_name()andget_soc_name_fallback_free()when/sys/class/boardinfo/soc_nameis missing or"(null)".samples/vision/fasterrcnn/runtime/cpp/src/cli.cpp: Sync the embedded board identity table andread_identity()withdocs/release/platforms.jsonandplatforms.py.utils/py_utils/tests/test_platforms.py,samples/vision/yoloe/tests/test_cpp_preflight.py, andsamples/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 -Werrorparity verified)python3 -m unittest -v samples/vision/fasterrcnn/tests/test_cpp_host_parity.py(2/2 PASS)