fix(mmwave): no false MR60BHA2 detection on empty UART (#1107)#1119
Merged
Conversation
… on empty UART (#1107) probe_at_baud counted bare 0x01 (SOF) bytes and declared MR60BHA2 on a single one. A floating UART1 with no sensor reads noise full of 0x01s → false 'Detected MR60BHA2 (caps=0x000f)'. Now a candidate must be a full 8-byte header with a valid header checksum (bytes 0..6) AND a known frame type (0x0A__ / 0x0F09), and clear the ≥3 threshold; removed the weak single-hit fallback. Real sensors stream valid frames continuously, so detection of present hardware is unaffected. Co-Authored-By: claude-flow <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the false-detection half of #1107.
Root cause:
probe_at_baud()counted bare0x01(MR60_SOF) bytes and declared MR60BHA2 on as little as one (mr60_sof_seen > 0fallback). A floating UART1 with no sensor reads line noise full of0x01s →Detected MR60BHA2 at 115200 baud (caps=0x000f)with no hardware.Fix: a candidate must now be a validated 8-byte header —
0x01+ a correct header checksum over bytes 0..6 (mr60_calc_checksum) + a known frame type (0x0A__/0x0F09) — and clear the existing ≥3-frame threshold. The weak single-hit fallback is removed. A real MR60 streams valid frames continuously, so genuine detection is unaffected; noise can no longer pass.Scope/honesty: this resolves the false-detection (problem 1). The
sendto ENOMEM+yield=0pps(problem 2) is most likely a separate network-path issue (unreachable target IP → LWIP buffer exhaustion, same signature as a dead UDP target) — I've asked the reporter to confirm target reachability on the issue. Compile-validated by CI; I could not test on the exact N16R8 rig.🤖 Generated with claude-flow