tchebb / bose-dfu

Firmware updater for various Bose devices
MIT License
37 stars 4 forks source link

Support flashing `.xuv` firmware, which accompanies the `.dfu` firmware for most devices #6

Open tchebb opened 1 year ago

tchebb commented 1 year ago

As @gaborrell pointed out in #4, the index.xml for QuietComfort 35 II (BayWolf) from downloads.bose.com contains not just a stack_plus_app.dfu but also two .xuv files, ext_signed.xuv, and acorn_coeffs_signed.xuv. Upon further investigation of the archives in bosefirmware/ced, it seems like my device, Foreman, is coincidentally the only one that doesn't have updates with at least one .xuv file.

These .xuv files contain binary data in a rudimentary address+data ASCII hex encoding. The "ext" files are particularly interesting: once decoded back to binary, they begin with fsr_dfu1 magic, which also occurs at various points inside the .dfu files. However, the data following that magic in a given ext_signed.xuv file does not also occur in the corresponding stack_plus_app.dfu file, and in at least one case the former file is larger than the latter, indicating it's an independent piece of the firmware that also needs to be flashed.

Reports indicate that flashing the .dfu file alone seems to work and change the indicated firmware version even for devices that also have .xuv files, but if the two are truly multiple pieces of one firmware image, there could easily be functional issues that occur when they don't match.

To investigate these files further (and hopefully support them properly in bose-dfu), I'll need USB captures of the official updater updating any device that uses them (i.e. any device except the SoundLink Color II). You can gather this with Wireshark (make sure to install USBPcap during installation). If anyone could gather these and share them privately, I'd be grateful! If you filter your capture before sharing it, ensure you don't inadvertently filter out any packets going to your Bose device. The capture should have packets going both to and from the device in both DFU and non-DFU mode.

gaborrell commented 1 year ago

I'll get the capture for you.

gaborrell commented 12 months ago

I'll get the capture for you.

@tchebb I just sent the file.

tchebb commented 10 months ago

Just an update here: I got the capture, @gaborrell, and it looks like it has all the information I wanted. The ext firmware seems to be updated through a separate protocol that runs in normal (non-DFU) mode. It shouldn't be too hard to implement, but it will take time that I haven't had yet—especially since I don't own a device with ext firmware, so I'll have to rely on others to test during development.

If anyone wants to take a stab at implementing it themselves, I'm happy to provide support and give pointers in the code. Otherwise, I'll get around to it when I can find the time.

gaborrell commented 10 months ago

Hi Tom,

Good to hear from you :) Sounds good what you wrote but unfortunately I'm not into programming/developing so I cannot really take that part. But what I'm thinking about is how it would change the situation if I send you my device for a few weeks or months to you so you could work on that part freely? Regards, Gabor

On Wed, Oct 25, 2023 at 10:03 PM Tom Hebb @.***> wrote:

Just an update here: I got the capture, @gaborrell https://github.com/gaborrell, and it looks like it has all the information I wanted. The ext firmware seems to be updated through a separate protocol that runs in normal (non-DFU) mode. It shouldn't be too hard to implement, but it will take time that I haven't had yet—especially since I don't own a device with ext firmware, so I'll have to rely on others to test during development.

If anyone wants to take a stab at implementing it themselves, I'm happy to provide support and give pointers in the code. Otherwise, I'll get around to it when I can find the time.

— Reply to this email directly, view it on GitHub https://github.com/tchebb/bose-dfu/issues/6#issuecomment-1779969126, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5MP2WSVTYMGIGMYG6GKGLLYBFWADAVCNFSM6AAAAAA4NRHKJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZZHE3DSMJSGY . You are receiving this because you were mentioned.Message ID: @.***>

tchebb commented 10 months ago

I really appreciate the offer, but sadly time is a bigger issue than hardware: I couldn't commit to finishing the feature quickly even if I had your device, and I don't want to end up keeping it from you indefinitely.

I'll see if I can find a cheap used device with XUV updates for my own testing. Since most devices seem to use XUV files, I imagine that won't be too hard.