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

Attempting to flash a bootloader over USB should report that it is not supported #479

Open
zfields opened this issue Apr 10, 2019 · 4 comments

Comments

@zfields
Copy link

zfields commented Apr 10, 2019

It's my understanding it is impossible for the bootloader to be flashed over USB.

I get an error if I don't use the --force override.

However, if I do --force the CLI reports success. The device slow blinks yellow, then reboots and reconnects (breathing cyan).

zak@zPro:~/binary_output_interface/1.0.1/photon$ particle flash --usb ./release/[email protected] 
Error writing firmware: unknown module function 2, use --force to override
zak@zPro:~/binary_output_interface/1.0.1/photon$ particle flash --usb ./release/[email protected] --force

Flash success!
@monkbroc
Copy link
Member

Do you know what actually happens when that second command runs? You can use --verbose to get more output from the DFU flash.

What would you expect to happen when you force flash an invalid binary to the device?

@zfields
Copy link
Author

zfields commented Apr 10, 2019

Not this...

Flash success!

At least not in this circumstance, because nothing actually happened.

@monkbroc
Copy link
Member

The dfu-util flash command does complete successfully so the CLI reports Flash success!

$ particle flash --verbose --usb --force bootloader-1.0.1-electron.bin
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 2b04:d00a
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 4096
DfuSe interface name: "Internal Flash   "
Downloading to address = 0x08080000, size = 16344
Download	[=========================] 100%        16344 bytes
Download done.
File downloaded successfully

Flash success!

Let's rephrase the issue as "attempting to flash a bootloader over USB should report that it is not supported"

@monkbroc monkbroc changed the title --force flashing bootloader over USB reports success Attempting to flash a bootloader over USB should report that it is not supported Apr 11, 2019
@partictim
Copy link

Interestingly, I just used --force attempting to --usb update the bootloader on a B402, and have corrupted the bootloader such that the device now won't boot the appFW. Now hunting for an adapter cable to connect my ST-Link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants