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

invalid state error #17

Closed
matthewchung74 opened this issue Apr 21, 2016 · 15 comments
Closed

invalid state error #17

matthewchung74 opened this issue Apr 21, 2016 · 15 comments

Comments

@matthewchung74
Copy link

when doing a DFU update with a single zip that contains an application, softdevice, and bootloader, I am sometimes getting an Invalid State Error, even if the device is on the charger.

screen shot 2016-04-21 at 1 27 28 pm

this is running the latest code out of master. i'm not able to consistently reproduce. any help with understanding when this error appears would be helpful. thanks.

@philips77
Copy link
Member

Check out this issue: NordicSemiconductor/IOS-DFU-Library#8
Maybe adding 1.5 sec fixes the issue.

@matthewchung74
Copy link
Author

Thanks @philips77 . to double check, the fix might be apply a 1.5 s delay before calling my equvalient of https://github.com/NordicSemiconductor/IOS-nRF-Toolbox/blob/master/nRF%20Toolbox/DFU/DFUViewController/DFUViewController.m#L132 ?

i'll give that a shot. but what is pretty interesting is i did not have this issue occur with the current version in the app store. is there a delta between the two?

@philips77
Copy link
Member

The complete source is available here. The current version from master will be available as 3.0.1 soon, but you'll find a commit with version 3.0. But I see no reason why would such a difference in behavior exists.

@matthewchung74
Copy link
Author

Hi @philips77 I'm not 100%, since my failures are intermittent, but I'm trying things with the 1.5 second delay and I 'think' it seems better (as per your suggestion) . Do you have any thoughts as why that would make a difference?

@philips77
Copy link
Member

It may be related to the flash operations timings. It depends when do you get this error, just after sending Start DFU command and sizes? Or later. You may ask this question on the DevZone, at nordicsemi.com. Our support team will be much more qualified to speak about the bootloader.

@mostafaberg
Copy link
Contributor

@foobar8675 Sorry to refresh the old issue, did you get this working ? we have just released v4.0.4 and would like you to try it and see if your issue still reproduces, I'll give it a couple of days before closing this issue since it's been "resolved" for a few months now 👍 , just feel free to reopen if you still encounter issues later

@liuyan3176
Copy link

Sometimes also meet this issue...
And I found the reason is my phone try to re-connect the device nor to update it, so the device is in invalid state.
But I also have a little problem,when I update the device successful(StateCompleted),I have to re-scan the retrieveConnectedArray,wait the device name appear and can be connected.
Does anything matter in my update process?Is there anything method to auto-connect the device after the updating is successful?
Thanks a lot ~

@philips77
Copy link
Member

Fyi. If the previous DFU operation failed during uploading and you try to repeat it, the device will be in a state that allows resuming only. Sending Start DFU command will respond with Invalid State. The next retry will succeed.
We don't have resuming implemented in legacy DFU in ios nor Android. However, since 0.6.3(?) Android DFU library will try to reconnect itself if Invalid State error received.

@mostafaberg
Copy link
Contributor

@liuyan3176 Your issue is different it seems, first of all the library is only responsible for flashing, anything happening after that is up to you as a developer.

regarding the invalid state is that if you disconnect you will have to restart the whole process since we don't support resuming in the Legacy DFU mode.

@matthewchung74
Copy link
Author

@mostafaberg we have a delayed timer which seems to fix things but can you share what is different in 4.0.4 that would make this behave better?

@qszdjj
Copy link

qszdjj commented Sep 29, 2016

Version 4.0.4(12). IOS 10 The above all this problem.

@mostafaberg
Copy link
Contributor

@foobar8675 Can you take a look at today's release and see if there's anything different than what you're doing ?

@matthewchung74
Copy link
Author

Hi, I'm not working on this project anymore, but am cc'ing a couple people
who are.

On Tue, Oct 4, 2016 at 9:48 AM, Mostafa Torbjørn Berg <
notifications@github.com> wrote:

@foobar8675 https://github.com/foobar8675 Can you take a look at today's
release
https://github.com/NordicSemiconductor/IOS-nRF-Toolbox/releases/tag/4.1.0
and see if there's anything different than what you're doing ?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#17 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABm4xPIW23334nZE-a4cGLludt_LLBqcks5qwoNrgaJpZM4INF7o
.

Regards,
Matt

@mostafaberg
Copy link
Contributor

that's great, keep us posted, if we don't hear back in a couple of days we'll assume issue is resolved, you can ask the new person responsible to re-open a new issue if the bug is still there

@mostafaberg
Copy link
Contributor

Issue resolved ? :)

mostafaberg pushed a commit that referenced this issue Apr 18, 2017
…tonless-dfu-for-homekit-broken to develop

* commit 'e1760c6dc836b2b7abc995e1d8122461f41222e1':
  +Used service/charactersitic *Type properties respectively, fixes bug causing app to fail to read nonexistent characteristics +Minor imporevment to alert views to also show error messages +Added warning and disallowr addition of accessories when HomeKit can't work due to iCloud Keychain Sync being turned off on device
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

5 participants