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

particle update does not throw error if dfu-util errors #206

Closed
technobly opened this issue Feb 8, 2016 · 14 comments
Closed

particle update does not throw error if dfu-util errors #206

technobly opened this issue Feb 8, 2016 · 14 comments
Labels

Comments

@technobly
Copy link
Member

Bootloader firmware will now propagate an error back to the host now when there is a write/erase failure during DFU transfer, however the CLI does not indicate an error if it sees one during particle update

Note: This may be an inherent issue with all dfu-util usage in the CLI.

This special electron v0.4.8-rc.6/v0.4.9 compatible bootloader will cause a write error after 15 seconds of uptime, you can use this to verify the issue and fix. Put in DFU mode, and wait about 10 seconds, then start the particle update. If using dfu-util directly you can see the progress bar stop and error reported.

@technobly technobly added the bug label Feb 8, 2016
@brycekahle
Copy link
Contributor

Do you know what error dfu-util reports?

@brycekahle
Copy link
Contributor

A full output from dfu-util would be helpful.

@technobly
Copy link
Member Author

Here's a sample output of the error during Write:

dfu10part1 ~/Downloads/binaries/system-part1-v0.4.8-rc.6-electron.bin 
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
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 = 0x08020000, size = 130884
Download    [==============           ]  56%        73728 bytesdfu-util: Error during download get_status

The error message during erase is different though.

@technobly
Copy link
Member Author

Here's a bootloader that will cause an Erase error after 15 seconds of up time, so easy to make a transfer pass, then fail.

Here's a sample output of the Erase error:

dfu10part1 ~/Downloads/binaries/system-part1-v0.4.8-rc.6-electron.bin 
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
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 = 0x08020000, size = 130884
Download    [                         ]   0%            0 bytesdfu-util: Error during special command "ERASE_PAGE" get_status

@brycekahle
Copy link
Contributor

Ok. I know the issue. It is currently ignoring stderr output with get_status as an error because Error during download get_status was a non-error before.

@technobly
Copy link
Member Author

Cool.. I know there are still some weird cases, but here's what things look like for me in this one case when everything completes correctly.

dfu10part1 ~/Downloads/binaries/system-part1-v0.4.8-rc.6-electron.bin 
dfu-util 0.8

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2014 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to dfu-util@lists.gnumonks.org

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Deducing device DFU version from functional descriptor length
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 = 0x08020000, size = 130884
Download    [=========================] 100%       130884 bytes
Download done.
File downloaded successfully

@technobly
Copy link
Member Author

@brycekahle I think we should also add this error as well Error during special command "ERASE_PAGE" get_status which could happen if the write protection cannot be changed, or noise/voltage issues are present.

@brycekahle
Copy link
Contributor

We should ignore that error?

@technobly
Copy link
Member Author

Nope, if we see the Erase error we can be reasonably sure that the dfu-util process failed to write the image correctly. We should not say everything completely successfully in that case.

@brycekahle
Copy link
Contributor

Great, so the change I made only ignores a very specific message. Everything else is treated like an error.

@technobly
Copy link
Member Author

Ahh.. Hmm.. When I looked at your change, it included a test for Error during download get_status which is the Write error specifically. So you are saying you are ignoring this specific error?

@technobly
Copy link
Member Author

I just checked with the updated CLI and it still ignores the Write error, which you can reproduce with the binary in the first post. Second post of mine has the error.

@brycekahle
Copy link
Contributor

Hmm, ok. Re-opening.

@brycekahle brycekahle reopened this Feb 10, 2016
@technobly
Copy link
Member Author

It also continues to ignore the Erase error, albeit ending particle update early. It says "System firmware update successfully completed!"

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

No branches or pull requests

2 participants