Digistump Forums

The Digispark => Digispark (Original) Support => Topic started by: MoFoQ on December 31, 2012, 03:46:57 pm

Title: Abort Mission, -1 error
Post by: MoFoQ on December 31, 2012, 03:46:57 pm
Originally, I too had the res >= 4 issue (which was solved with udev rules listed here; on a side-note, I think it should be placed in the "Connecting" tutorial).
Anyways, now I get the dreaded "Abort mission! -1 error has occured ..."


Binary sketch size: 756 bytes (of a 6,010 byte maximum)
Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 60% complete
> Erasing the memory ...
erasing: 79% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.


I've tried 6 different sparks and 2 different direct USB ports (not off a hub).
I'll try it on Windows in a bit.

Any thoughts/ideas?
Title: Abort Mission, -1 error
Post by: willscott on December 31, 2012, 04:29:22 pm
I also get this.  For me, the underlying libusb error was -EILSEQ, which it looks like means either there was a timeout, or a bad checksum on the response.

My spark works on my mac, so I\'m pretty sure has something to do with linux & the linux usb driver / libusb setup.
Title: Abort Mission, -1 error
Post by: MoFoQ on December 31, 2012, 07:18:18 pm
Hmm...that wasn\'t it either; I thought it might be that I needed to have micronucleus\'s uploader be executed with root privileges after reading the README for it so I edited and recompiled the avr-dummy to use sudo but it didn\'t seem to change anything...still got the error.
Title: Abort Mission, -1 error
Post by: probono on January 01, 2013, 01:58:47 pm
With my selfmade Digispark compatible breadboard circuit I got this as well. Had to try about 10 times until it succeeded. Seems like \"something\" (timing? voltage? software?) is not 100% reliable.
Title: Abort Mission, -1 error
Post by: MoFoQ on January 01, 2013, 04:30:13 pm
It\'s starting to look like it might be an issue with the uploader on Linux as I was able to get it to work just fine under Windows.

Is there a debug version of it so I can post debug results?
Title: Abort Mission, -1 error
Post by: probono on January 01, 2013, 04:38:38 pm
I was using Linux as well... Ubuntu 12.10, Quantal Quetzal
Title: Abort Mission, -1 error
Post by: digistump on January 01, 2013, 07:18:33 pm
@MoFoQ - you can try an upload of the either of the hex files in the micronucleus repository using just the micronucleus command line app: https://github.com/Bluebie/micronucleus-t85/tree/master/commandline

That might help you debug, and then you can compile the commandline app with any options you\'d like.

For the record this works for me on 12.04 Ubuntu - but I won\'t claim to be a linux expert and would appreciate anything you or anyone else discovers.

Title: Abort Mission, -1 error
Post by: Macjbraun on January 02, 2013, 03:56:39 pm
Try with a hub with no other USB devices plugged in the hub. Worked for me.
Title: Abort Mission, -1 error
Post by: MoFoQ on January 03, 2013, 12:23:06 pm
@digistump, are you referring to \"cdc232.hex\" and \"littleWire_v11.hex\"?

note, I\'m using 10.04 LTS on this machine, 12.04 on another.
And it doesn\'t seem to like using a USB hub (it doesn\'t even detect it being inserted)
Title: Abort Mission, -1 error
Post by: digistump on January 03, 2013, 12:51:38 pm
@MoFoQ - yes those or any other hex file- basically I\'m just suggesting that you try using micronucleaus directly so you can test with it directly instead of through the Arduino IDE

A few questions:

Is the machine you had it worked successfully on with windows the same machine as one of the linux ones?

Are the linux machines it is not working on laptops or desktops? If desktops have you tried the USB ports on the back with no extension cable?

I\'ll be uploading some linux builds today and I\'ll do a fresh load of 12.04 and see if I can duplicate it (haven\'t been able to duplicate it yet).

Thanks for sticking with me on troubleshooting this!
Title: Abort Mission, -1 error
Post by: MoFoQ on January 03, 2013, 08:32:24 pm
it\'s very odd how it works (it might be a permissions thing)

from now on, I will refer to the computers as Computer A and Computer B.
Computer A runs 10.04 only
Computer B runs Win7 and 12.04

Comp A output via micronucleus (non-root):

$ ./micronucleus --run cdc232.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 66% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.


Comp A output via micronucleus (root):

# ./micronucleus --run cdc232.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 66% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.


Comp B (12.04) output from arduino IDE (non-root):

Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 60% complete
> Erasing the memory ...
erasing: 80% complete
> Starting to upload ...
writing: 80% complete
>> Abort mission! An error has occured ...
>> Please unplug the device and restart the program.


Comp B (12.04) output from arduino IDE (root):

Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 60% complete
> Erasing the memory ...
erasing: 80% complete
> Starting to upload ...
writing: 100% complete
>> Micronucleus done. Thank you!


Comp B (12.04) output from micronucleus (non-root):

$ ./micronucleus --run cdc232.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 66% complete
> Starting to upload ...
writing: 83% complete
> Starting the user app ...
running: 100% complete
>> Micronucleus done. Thank you!


Comp B (12.04) output from micronucleus (root):

# ./micronucleus --run cdc232.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 66% complete
> Starting to upload ...
writing: 83% complete
> Starting the user app ...
running: 100% complete
>> Micronucleus done. Thank you!


Comp B (12.04) summary:
arduino IDE (non-root): FAIL
arduino IDE (root): PASS
micronucleus (non-root): PASS
micronucleus (root): PASS
Title: Abort Mission, -1 error
Post by: MoFoQ on January 03, 2013, 08:36:06 pm
forgot to answer your questions about laptops and desktops.

Comp A is a desktop and I used the direct USB ports as well (front, back, etc.)

Comp B is a laptop.
I haven\'t had any issues under Windows 7 and under linux, it looks like micronucleus doesn\'t have an issue.
(though I did notice that if I used \"660\" as listed in the \"res > = 4\" fix, it would not detect insertion; I use \"666\" instead...yes...dreadfully evil :D )
Title: Abort Mission, -1 error
Post by: Emerica on January 03, 2013, 08:39:14 pm
Having this problem as well.
I\'ve tried multiple ports directly, through some extensions. 3 sparks.
Into a usb3 hub plugged into a usb2 port was a no go at all.
Ubuntu 12.04

Running Digispark Uploader...
Plug in device now...
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 20% complete
connecting: 23% complete
connecting: 27% complete
connecting: 30% complete
connecting: 34% complete
connecting: 40% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 40% complete
parsing: 60% complete
> Erasing the memory ...
erasing: 60% complete
erasing: 60% complete
[---------------------60 to 79%-----------------------]
erasing: 79% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.
Title: Abort Mission, -1 error
Post by: digistump on January 03, 2013, 08:56:15 pm
@Emerica - have you tried running it as root?
Title: Abort Mission, -1 error
Post by: Emerica on January 03, 2013, 09:08:39 pm
Yes, same deal. Either using sudo or sudo su and then trying, no go.
Followed the guide as well as:
/etc/udev/rules.d/49-digispark.rules
SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\"
KERNEL==\"ttyACM*\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\", ENV{ID_MM_DEVICE_IGNORE}=\"1\"



Title: Abort Mission, -1 error
Post by: digistump on January 03, 2013, 10:27:45 pm
Any chance you have a second OS on the machine to test with?
I\'m wondering if linux for some reason is more sensitive about the USB controller hardware on the computer - given @MoFoQ\'s issues with one of this computers, but not the other.
Title: Abort Mission, -1 error
Post by: Emerica on January 03, 2013, 10:59:30 pm
Nope, I do not, I could boot backtrack or something to see if it\'s distro related.
Building shields for now :)
Title: Abort Mission, -1 error
Post by: willscott on January 03, 2013, 11:28:24 pm
Once you get part way through the upload, it\'s a different problem.
Here\'s output from my syslog when attempting to use micronucleus from my ubuntu machine.

Printing out the unexpected res in micronucleus_eraseFlash in library/micronucleus_lib.c (since that\'s what\'s returning -1) gave me -84, which libusb says means either an invalid crc, or no response to the request.

The relevant log line is

kernel: usb 4-2: >usbfs: USBDEVFS_CONTROL failed cmd micronucleus rqt 192 rq 2 len 0 ret -84


My hunch is that either micronucleus isn\'t fully \"claiming\" ownership of the device from the kernel, and something else gets the response message that shouldn\'t, or it may have something to do with initial probing of the device expecting it to be a mass storage device, which confuses it.
Title: Abort Mission, -1 error
Post by: MoFoQ on January 04, 2013, 05:34:35 pm
for me:


[1046470.430083] usb 4-1: new low speed USB device using uhci_hcd and address 3
[1046470.586324] usb 4-1: configuration #1 chosen from 1 choice
[1046470.950213] usb 4-1: usbfs: USBDEVFS_CONTROL failed cmd micronucleus rqt 192 rq 2 len 0 ret -84
[1046471.540545] usb 4-1: USB disconnect, address 3
[1046472.330047] usb 4-1: new low speed USB device using uhci_hcd and address 4
[1046472.486510] usb 4-1: configuration #1 chosen from 1 choice
[1046474.290792] usb 4-1: USB disconnect, address 4


The last 3 lines will continue to repeat (with the address # changing) until I unplug the spark.
Title: Abort Mission, -1 error
Post by: digistump on January 04, 2013, 05:38:35 pm
@MoFoQ - again I apologize if this is a repeat but have you tried these steps: https://github.com/Bluebie/micronucleus-t85/wiki/Ubuntu-Linux

I\'m committed to updating the wiki tonight with among other things a comprehensive linux troubleshooting section.
Title: Abort Mission, -1 error
Post by: MoFoQ on January 04, 2013, 05:49:33 pm
Yup, no change:

mofoq@lynx:~/Downloads/arduino-1.0.3/micronucleus-t85-master/commandline$ ./micronucleus --run cdc232.hex
> Please plug in the device ...
> Press CTRL+C to terminate the program.
> Device is found!
connecting: 33% complete
> Device looks like ATtiny85!
> Available space for user application: 6010 bytes
> Suggested sleep time between sending pages: 8ms
> Whole page count: 94
> Erase function sleep duration: 752ms
parsing: 50% complete
> Erasing the memory ...
erasing: 66% complete
>> Abort mission! -1 error has occured ...
>> Please unplug the device and restart the program.
mofoq@lynx:~/Downloads/arduino-1.0.3/micronucleus-t85-master/commandline$ cat /etc/udev/rules.d/49-micronucleus.rules
# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-micronucleus.rules    (req\'d on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\"
KERNEL==\"ttyACM*\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\", ENV{ID_MM_DEVICE_IGNORE}=\"1\"
#
# If you share your linux system with other users, or just don\'t like the
# idea of write permission for everybody, you can replace MODE:=\"0666\" with
# OWNER:=\"yourusername\" to create the device owned by you, or with
# GROUP:=\"somegroupname\" and mange access using standard unix groups.
mofoq@lynx:~/Downloads/arduino-1.0.3/micronucleus-t85-master/commandline$ cat /lib/udev/rules.d/49-micronucleus.rules
# UDEV Rules for Micronucleus boards including the Digispark.
# This file must be placed at:
#
# /etc/udev/rules.d/49-micronucleus.rules    (preferred location)
#   or
# /lib/udev/rules.d/49-micronucleus.rules    (req\'d on some broken systems)
#
# After this file is copied, physically unplug and reconnect the board.
#
SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\"
KERNEL==\"ttyACM*\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\", ENV{ID_MM_DEVICE_IGNORE}=\"1\"
#
# If you share your linux system with other users, or just don\'t like the
# idea of write permission for everybody, you can replace MODE:=\"0666\" with
# OWNER:=\"yourusername\" to create the device owned by you, or with
# GROUP:=\"somegroupname\" and mange access using standard unix groups.
mofoq@lynx:~/Downloads/arduino-1.0.3/micronucleus-t85-master/commandline$ dmesg | tail
[1046954.320068] usb 4-1: new low speed USB device using uhci_hcd and address 12
[1046954.476348] usb 4-1: configuration #1 chosen from 1 choice
[1046957.540132] usb 4-1: USB disconnect, address 12
[1047123.900753] usb 4-1: new low speed USB device using uhci_hcd and address 13
[1047124.056974] usb 4-1: configuration #1 chosen from 1 choice
[1047124.422872] usb 4-1: usbfs: USBDEVFS_CONTROL failed cmd micronucleus rqt 192 rq 2 len 0 ret -84
[1047125.040125] usb 4-1: USB disconnect, address 13
[1047125.820068] usb 4-1: new low speed USB device using uhci_hcd and address 14
[1047125.977202] usb 4-1: configuration #1 chosen from 1 choice
[1047126.790271] usb 4-1: USB disconnect, address 14


(note, this is on 10.04 LTS and I have the udev rules in both locations in case 10.04 is considered a \"broken system\")
Title: Abort Mission, -1 error
Post by: digistump on January 04, 2013, 11:42:08 pm
@MoFoQ - I\'m out of ideas for now, for that I apologize.  I don\'t have the time right now to load up 10.04, but if I find the time I certainly will...

I\'m hoping someone else running 10.04 will give it a go too, so we can eliminate whether it is specific to your hardware/install
Title: Abort Mission, -1 error
Post by: MoFoQ on January 09, 2013, 03:02:10 pm
what about for 12.04? (micronucleus works by itself (non-root) but not through arduino IDE)
Title: Abort Mission, -1 error
Post by: teryret on January 11, 2013, 09:23:15 pm
I\'m getting this exact behavior as well (12.04 on a high end i7 workstation, two sparks).  The one thing I have to add is that when I run \"ls -l /dev/bus/usb/004\"  (ymmv on the 004 part) repeatedly at high speed I can watch the device connect and disconnect from the system.  As you\'d expect from the above dmesg logs it does indeed increment the file descriptor each time it connects (and it shows permissions 0666).

Edit: I\'m using the Arduino IDE (nothing requiring root), but other than that my setup is exactly the same.
Title: Abort Mission, -1 error
Post by: tasmaniac on January 17, 2013, 11:12:47 am
I am running Ubuntu 12.10
The following udev rules seem to fix the problem with needing to run as root.  Now I can run as a normal user

ENV{DEVTYPE}==\"usb_device\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\"
KERNEL==\"ttyACM*\", ATTRS{idVendor}==\"16d0\", ATTRS{idProduct}==\"0753\", MODE:=\"0666\", ENV{ID_MM_DEVICE_IGNORE}=\"1\"
Title: Re: Abort Mission, -1 error
Post by: alx on February 18, 2013, 10:12:45 am
I have the same problem here, aborting after erasing at 79% on my Mac Pro (2010, 10.8.2), also sudo does not help. On my Max Book Pro 13" (2009, 10.8.2) is does work, any ideas? (I've downloaded the digispark+arduino ide today, tried an example program)
Title: Re: Abort Mission, -1 error
Post by: digistump on February 18, 2013, 11:07:45 am
alx - have you tried a hub and/or other all the ports? if so, was the hub powered or unpowered?
Title: Re: Abort Mission, -1 error
Post by: alx on February 19, 2013, 03:35:51 am
yes, i've tried two powered hubs and the port directly on the mac pro, and in all cases the digithumb light up, so there is power, and since it's aborting at the end of the erasing it must have been found.
Title: Re: Abort Mission, -1 error
Post by: psychogenic on February 19, 2013, 11:38:00 am
FYI, I was having the same error at the end of the erase cycle and have posted a fix related to the micronucleus uploader, here (http://digistump.com/board/index.php/topic,464.0.html).

Regards,
PatD
Title: Re: Abort Mission, -1 error
Post by: digistump on February 19, 2013, 12:45:08 pm
alx - do you have multiple Digisparks - if so is the issue present with all digisparks? And if not, do you have a second machine you could test on?


Thanks for your patience!
Title: Re: Abort Mission, -1 error
Post by: alx on February 20, 2013, 10:28:08 am
@digistump: I also have the problem with the second digispark and have no problem on my MacBook (see my first post).

@psychogenic: compiling that and replacing the version inside arduino did it! thanks.

maybe somone should recompile it "officially" and pack a new bundle.
Title: Re: Abort Mission, -1 error
Post by: digistump on February 20, 2013, 01:16:18 pm
Great - I'll make sure the changes make it into the next official release
Title: Re: Abort Mission, -1 error
Post by: pckk on May 16, 2019, 02:23:58 am
OMG this issue.  ;D
สมัครufabet (http://www.ufabet99.vip)