Closed mossmann closed 2 months ago
I've changed this to draft because it will be broken by #48 which we expect to merge soon. We'll probably use a vendor request instead of bDeviceClass
to detect Apollo firmware.
I've force-pushed a new solution based on the Apollo ID vendor request. This could be slightly simpler if it used the USB product string instead, and that would allow removal of the vendor request from firmware, but I think the vendor request is a more robust solution. For example, a product string solution could fail if we ever do things like name the flash bridge "Apollo Flash Bridge" in its product string.
When looking for devices running Apollo firmware, ignore those running Saturn-V or anything else with an unexpected bDeviceClass. Because the USB VID/PID is shared between Saturn-V and Apollo, this is needed to prevent us from trying to communicate with a Saturn-V device as if it were running Apollo.
Previously Saturn-V set bcdDevice to 0.0 which resulted in a failure to find a platform file. With https://github.com/greatscottgadgets/saturn-v/pull/14 Saturn-V's bcdDevice is now 1.0 which matches a Cynthion platform file. This PR is needed to prevent LUNA from trying to build gateware for a Cynthion with hardware revision r1.0 which is really Saturn-V version 1.0 running on a Cynthion of any hardware revision.