commaai / panda

code powering the comma.ai panda
MIT License
1.54k stars 788 forks source link

Detect H723 in firmware #1988

Closed robbederks closed 4 months ago

robbederks commented 4 months ago

(another attempt at #1975)

Unfortunately, I couldn't find a good way to determine if the chip has the SMPS (725) or not (723) without multiple writes to PWR->CR3, and this appears to be the only real difference between the two.

This detection is based on the package type, which is nicely exposed in SYSCFG->PKGR. This does mean we can't have any overlap between 723 and 725 /735 packages in future designs, but it's unlikely we'll need to.

robbederks commented 4 months ago

Tested on:

All worked, including after power cycle. Feel free to merge