Skip to content

body v1 updater#3289

Open
stefpi wants to merge 22 commits intomasterfrom
body-v1-update
Open

body v1 updater#3289
stefpi wants to merge 22 commits intomasterfrom
body-v1-update

Conversation

@stefpi
Copy link
Copy Markdown
Contributor

@stefpi stefpi commented Apr 4, 2026

body can flash script. runs on initialization of comma body car interface and flashes the body if the firmware signature does not match current version signature

  • STM32F4 config, can handle, flash routine
  • version and address values in values.py
  • run update in init() of body interface.py
  • add second UDS request to body FW query config for software fingerprint
  • increase fw query timing from 0.1 to 0.2 to match 2 requests instead of 1

@github-actions github-actions bot added car related to opendbc/car/ body labels Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Car behavior report

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

✅ No changes detected

@github-actions github-actions bot added the car safety vehicle-specific safety code label Apr 7, 2026
@stefpi stefpi changed the title body update on initialization body v1 updater Apr 7, 2026
@github-actions github-actions bot removed the car safety vehicle-specific safety code label Apr 7, 2026
@stefpi stefpi marked this pull request as ready for review April 7, 2026 23:02
@stefpi stefpi marked this pull request as draft April 7, 2026 23:07
@stefpi stefpi marked this pull request as ready for review April 7, 2026 23:19
FINGERPRINTS = {
CAR.COMMA_BODY: [{
513: 8, 516: 8, 514: 3, 515: 4
513: 8, 516: 8, 514: 3, 515: 4, 517: 8, 518: 6, 519: 6
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.

let's split this out into its own PR

Comment on lines +47 to +51
Request(
[StdQueries.TESTER_PRESENT_REQUEST, StdQueries.APPLICATION_SOFTWARE_FINGERPRINT_REQUEST],
[StdQueries.TESTER_PRESENT_RESPONSE, StdQueries.APPLICATION_SOFTWARE_FINGERPRINT_RESPONSE],
bus=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.

remove this and just pass the hash with the existing request

Comment on lines +11 to +15
FIRMWARE_VERSION = "v0.3.1"
BIN_URL = f"https://github.com/commaai/body/releases/download/{FIRMWARE_VERSION}/body.bin.signed"
BIN_NAME = f"body-v1-{FIRMWARE_VERSION}.bin.signed"
BODY_DIR = os.path.dirname(os.path.realpath(__file__))
_PANDA_BIN_DIR = os.path.join(BODY_DIR, "../../../../panda/board/body/v1")
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.

let's just move the v1 stuff into panda

"sector_sizes": [0x4000 for _ in range(4)] + [0x10000] + [0x20000 for _ in range(11)],
}

class CanHandle:
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.

this should live in panda

Comment on lines +61 to +71
def fetch_bin(bin_path, update_url):
os.makedirs(os.path.dirname(bin_path), exist_ok=True)
result = subprocess.run(
["curl", "-L", "-o", bin_path, "-w", "%{http_code}", "--silent", update_url],
capture_output=True, text=True
)
status = result.stdout.strip()
if status == "200":
print("downloaded latest body firmware binary")
else:
raise RuntimeError(f"download failed with HTTP {status}")
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.

openpilot will pass this in from the panda build obj dir

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

body car related to opendbc/car/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants