Skip to content

Feature request: allow bumble-rtk-util to work with serial transport #753

@jsmif

Description

@jsmif

I have a Realtek dev board which exposes the chip via serial rather than USB. I confirmed on Windows that bumble-rtk-util info usb:2550:8761 and bumble-rtk-util load usb:2550:8761 work on a different normal USB dongle, to confirm it's not having the same issue as #746. And then I want to issue bumble-rtk-util info serial:COM6,115200 and bumble-rtk-util load serial:COM6,115200 on the dev board, to take advantage of the fact that Bumble supports HCI over serial (so I don't have to implement firmware download myself).

However, when I do bumble-rtk-util info serial:COM6,115200 I get an error "USB device not supported by this RTK driver" (caused by the check() function failing because there is of course no USB metadata when I'm giving a serial transport.)

Interestingly, if I add --force it gets around this and works for info and load, despite the fact that the code is written in such a way as to assume USB transport.

However ultimately the --force with load (which is what I really care about) is unsuccessful. It seems to me based on serial logging like it's padding out the end of the last 0xFC20 VSC download command and including a lot of extra 0 bytes despite the fact that the default rtl8761bu_config.bin file has a size set to 0. Then the chip just doesn't reply, either with success or failure, and gets stuck in a failed mode and refuses to respond to anything else. So perhaps that issue would be fixed by giving the code the once-over necessary to support HCI over serial.

Edit: re load over serial not working, the issue is perhaps due to using a fixed size RTK_FRAGMENT_LENGTH, which I suspect it doesn't like over serial. I couldn't immediately figure out how to fix your OO code, but somehow you need to not be using the fixed-size length here, or else the last packet is almost guaranteed to be padded out to a size other than the size mentioned in the data format itself, which it either doesn't like, or doesn't handle gracefully.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions