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

[Bootloader] Return an error if busy or in an unavailable state #238

Open
isaacvr opened this issue Oct 31, 2019 · 0 comments
Open

[Bootloader] Return an error if busy or in an unavailable state #238

isaacvr opened this issue Oct 31, 2019 · 0 comments
Labels
bootloader MCU bootloader bug Something isn't working enhancement New feature or request firmware MCU firmware stdev

Comments

@isaacvr
Copy link
Contributor

isaacvr commented Oct 31, 2019

Feature description
When sending a request to the bootloader while it is busy or in an unavailable state, it responds nothing. It should return an error indicating in some way that is it not possible to do what was requested.

Is your feature request related to a problem? Please describe.
I did the following using the js library:

  1. I used the devUpdateFirmware function for updating the device and obtained this output:
    st1
    Also, the device showed this:
    dv1

  2. While having the console in focus, I pressed ctrl+c. That canceled the operation in the pc, but the hardware wallet was still waiting for user input. In this state, I called devUpdateFirmware again a got this output:
    st2
    It is important to note that the error message did not appear quickly, but after some time. This appear to indicate that the error message appeared because of a timeout and not because the device responded something in particular. Also, it was interesting that while the device was waiting for user input, the calls to the getDevice function also failed after some time, so the bootloader is not responding to them while waiting for input.

  3. I cancelled the operation in the device, so the screen ended in this state:
    dv2
    After that, I called devUpdateFirmware again a got this output:
    st3
    After the last line nothing else happened, neither on the device nor on the console, so the operation was stuck.

Testing in the console, this could appears like normal behavior, but carries some complications for the integration with a GUI. this is an example (this happened while creating the updater in the desktop wallet, using the daemon):

If the user tries to update the firmware and by accident cancels the operation, the device screen will ask the user to reconnect the hw wallet, but the user could simply retry using the desktop wallet. In that case, the hardware wallet will do nothing but the desktop wallet will ask the user to confirm the operation in the hardware wallet. It will stay like that for 50 secons until the http connection times out.

Describe the solution you'd like
In the previous examples, instead of not receiving a response, an error should have been received. An example is that if I use the devWipeDevice function while the device is in firmware mode and call devWipeDevice again while de device is still waiting for user input, this is the console output:
wp

Describe alternatives you've considered
The previous example about how the firmware reacts shows a possible solution, but in fact the implementation does not need to be the same. What is important is to have any kind of error, so the GUI can know that something went wrong with the operation and tell the user that the procedure was cancelled.

Additional context

Possible implementation

@isaacvr isaacvr added bootloader MCU bootloader bug Something isn't working enhancement New feature or request firmware MCU firmware stdev labels Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bootloader MCU bootloader bug Something isn't working enhancement New feature or request firmware MCU firmware stdev
Projects
None yet
Development

No branches or pull requests

1 participant