Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argument --flash: invalid UploadMethod value: 'dfu' #2194

Open
jurgelenas opened this issue Apr 30, 2023 · 5 comments
Open

argument --flash: invalid UploadMethod value: 'dfu' #2194

jurgelenas opened this issue Apr 30, 2023 · 5 comments
Labels
enhancement 🪄 New feature or request

Comments

@jurgelenas
Copy link
Member

dfu flashing method found in the SIYI hardware is not recognized as a valid UploadMethod value:

usage: flasher.pyz [-h] [--dir DIR] [--phrase PHRASE] [--ssid SSID]
                   [--password PASSWORD] [--auto-wifi AUTO_WIFI]
                   [--no-auto-wifi] [--airport-baud [AIRPORT_BAUD]]
                   [--rx-baud [RX_BAUD]] [--lock-on-first-connection]
                   [--no-lock-on-first-connection] [--tlm-report [TLM_REPORT]]
                   [--fan-min-runtime [FAN_MIN_RUNTIME]] [--uart-inverted]
                   [--no-uart-inverted] [--unlock-higher-power]
                   [--no-unlock-higher-power]
                   [--buzzer-mode {quiet,one-beep,beep-tune,default-tune,custom-tune}]
                   [--buzzer-melody BUZZER_MELODY]
                   [--domain {eu_433,au_433,in_866,eu_868,au_915,fcc_915}]
                   [--target TARGET] [--flash {wifi,uart,bf,etx,stlink,dir}]
                   [--out OUT] [--port PORT] [--baud BAUD] [--force]
                   [--confirm] [--tx] [--lbt]
                   [file]
flasher.pyz: error: argument --flash: invalid UploadMethod value: 'dfu'
@pkendall64
Copy link
Collaborator

Do we really care about this one?? I can add it if required, but it's just for a single target and it can still be flashed via platformio.

@jurgelenas
Copy link
Member Author

I do not care about it personally, just reporting an issue. We could also remove dfu flashing method from targets.json.

In general, if we have this device & flashing method in the configurator it should work.

@CapnBry
Copy link
Member

CapnBry commented May 9, 2023

It is the only way to flash SIYI TX devices, which people use. Our PIO build supports it, what's .... what ... what is flasher.pyz?

That's binary_flash.py? Can't we just shell out like we do now, but obvs we need more than python files to use the dfu-util binary

        board = env.BoardConfig()
        # PIO's ststm32 forces stm32f103 to upload via maple_upload,
        # but we really actually truly want dfu-util.
        env.Replace(UPLOADER="dfu-util", UPLOADERFLAGS=["-d", "0483:df11",
            "-s", "%s:leave" % board.get("upload.offset_address", "0x08001000"),
            "-D"], UPLOADCMD='$UPLOADER $UPLOADERFLAGS "${SOURCE.get_abspath()}"')

@jurgelenas
Copy link
Member Author

That's binary_flash.py? Can't we just shell out like we do now, but obvs we need more than python files to use the dfu-util binary

Yes it is binary_flash.py. If it is just a simple code change that is required to fix it I am all for fixing it before we release v3.3.

@pkendall64
Copy link
Collaborator

It will be bringing in a new python library for DFU support. It's not a massive library but I can't test it.
https://github.com/square/pyfu-usb is the library I was thinking to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🪄 New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants