Skip to content

mazda: fix HBC under radar takeover - #15

Open
mzdnick wants to merge 1 commit into
zoompilot:developfrom
mzdnick:mazda-hbc-clutter-replay
Open

mzdnick wants to merge 1 commit into
zoompilot:developfrom
mzdnick:mazda-hbc-clutter-replay

Conversation

@mzdnick

@mzdnick mzdnick commented Sep 15, 2026

Copy link
Copy Markdown

Problem

Synthetic radar during alpha-long was sending empty 5/6 tracks, so the camera saw a dead radar and stopped deciding auto high beams. Also, the replacement CRZ_CTRL never relayed the camera's HBC-arm bit, so the dash's green HBC light never lit.

Fix

  • Send one synthetic far-object track on 0x365 (camera bus only); body bus keeps the empty templates for stop-and-go.
  • Relay camera's HBC-arm bit (0x440 BIT2) into CRZ_CTRL bit 13 on both buses, matching stock.

Validation

  • Validated on a 22 CX-5. Unsure how the synthetic object interacts with alpha-long.
  • 551 car + 278 safety + 271 interface tests pass; golden regenerated.

AI Usage

Disclaimer: GLM-5.3 by Z.ai was used to help develop, debug, and document this submission. All changes were reviewed and validated by me.

@mzdnick
mzdnick force-pushed the mazda-hbc-clutter-replay branch from fcf66bf to 4e4747b Compare September 17, 2026 01:57
@mzdnick mzdnick changed the title mazda: replay a captured 5/6 track cycle during the radar takeover mazda: fix HBC under radar takeover Sep 17, 2026
@mzdnick
mzdnick marked this pull request as ready for review September 17, 2026 02:22
@mzdnick
mzdnick force-pushed the mazda-hbc-clutter-replay branch from 9145552 to b1b5eb2 Compare September 17, 2026 06:12
Under the alpha-long radar takeover the synthetic radar sent only empty 5/6 track templates, and the camera read that as a dead radar: auto high beams stopped deciding. Send one occupied 0x365 track on the camera bus, a far static object (175 m nominal, 87-350 m band, zero closing speed) that never suppresses beams; the body bus keeps the empty templates stop-and-go needs, and libsafety pins the occupied pattern per slot on the camera bus only.

The replacement CRZ_CTRL packed the camera's HBC-arming relay bit as 0, so the dash's green HBC light never lit. Relay 0x440 BIT2 into CRZ_CTRL NEW_SIGNAL_3 (bit 13) on both buses at 50 Hz, as stock does.

The idle 0x362 template drops its captured c7 8c phantom track, which stock never sends idle, and the validator special case goes with it.

Validation: night drive with alpha-long: beams react to darkness, bright areas, oncoming traffic, and leads; the green HBC light follows arming. Stop-and-go verified on the empty body-bus templates. 551 Mazda car tests, 278 Mazda safety tests, 781 car-wide interface tests; misra check passes.
@mzdnick
mzdnick force-pushed the mazda-hbc-clutter-replay branch from 7b99d4c to 673c8b1 Compare September 17, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant