Skip to content

add USB logging#38186

Draft
elkoled wants to merge 4 commits into
masterfrom
usb3
Draft

add USB logging#38186
elkoled wants to merge 4 commits into
masterfrom
usb3

Conversation

@elkoled

@elkoled elkoled commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Adds basic USB logging.

TODO:

  • add kernel error counters (PORTLI link error count, SS reset count)
  • add usb3 config cloudlog (dwc3/PHY tuning)
  • add LTSSM link-state tracking

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

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

I think we'll want to both log generic, low-level USB state and parse out our specific peripherals.

Such that consumers of this don't need to know the chestnut VID/PID, loop through the low level state, etc:

hardwareState {
  ....

  chestnutPresent: bool;

  // low level state straight from the kernel
  usbState {

  }
}

Comment thread selfdrive/test/test_onroad.py Outdated
"selfdrive.modeld.modeld": 22.0,
"selfdrive.modeld.dmonitoringmodeld": 18.0,
"system.hardware.hardwared": 4.0,
"system.hardware.usbd": 1.0,

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.

i think this just goes in hardwared

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I thought about 100Hz+ usb state sampling inside usbd to catch transients but could do that in the kernel with interrupts and sample only the resulting counters in hardwared with 2Hz

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