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

digispark-tiny upload failing #106

Closed
jonlorusso opened this issue Mar 3, 2015 · 10 comments
Closed

digispark-tiny upload failing #106

jonlorusso opened this issue Mar 3, 2015 · 10 comments
Milestone

Comments

@jonlorusso
Copy link

digispark-tiny upload is failing:

platformio run --target upload

Fails with:

[Tue Mar 3 20:01:16 2015] Processing digispark-tiny (platform: atmelavr, board: digispark-tiny, framework: arduino)
BeforeUpload(["upload"], [".pioenvs/digispark-tiny/firmware.hex"])
scons: *** [upload] Explicit exit, status Error: Please specify upload_port for environment or use global --upload-port option.

Error: Please specify upload_port for environment or use global --upload-port option.

When uploading to the digispark via micronucleus I am normally prompted to insert the device. No port name is required.

@ivankravets
Copy link
Member

Thanks a lot for report! This is a bug, I will fix it as soon as possible! Current solution is to put "something" to --upload-port, like:

> platformio run -t upload --upload-port /dev/null

Does it work for you?

@jonlorusso
Copy link
Author

$ platformio run --target upload --upload-port /dev/null

[Tue Mar 3 21:38:14 2015] Processing digispark-tiny (platform: atmelavr, board: digispark-tiny, >framework: arduino)
BeforeUpload(["upload"], [".pioenvs/digispark-tiny/firmware.hex"])
"/home/pi/.platformio/packages/tool-micronucleus/micronucleus" -c digispark --timeout 60 -b -P /dev/null -U flash:w:.pioenvs/digispark-tiny/firmware.hex:i

At this point, output pauses, and I plug in the device (despite not being prompted to). Once I plug in the device, I see:

micronucleus: library/micronucleus_lib.c:66: micronucleus_connect: Assertion `res >= 4' failed.

Please plug in the device ...
Press CTRL+C to terminate the program.

Aborted
scons: *** [upload] Error 134
========================= [ ERROR ] Took 14.70 seconds =========================

@ivankravets
Copy link
Member

@jonlorusso We will fix it tomorrow. I've just opened for it separated issue #107

@valeros
Copy link
Member

valeros commented Mar 3, 2015

It seems that this error is caused by usb permissions issue.
Did you try to insert platformio udev.rules file? https://github.com/ivankravets/platformio/blob/develop/scripts/99-platformio-udev.rules

@jonlorusso
Copy link
Author

Getting closer:

[Tue Mar 3 22:09:52 2015] Processing digispark-tiny (platform: atmelavr, board: digispark-tiny, framework: arduino)
BeforeUpload(["upload"], [".pioenvs/digispark-tiny/firmware.hex"])
"/home/pi/.platformio/packages/tool-micronucleus/micronucleus" -c digispark --timeout 60 -b -P /dev/null -U
flash:w:.pioenvs/digispark-tiny/firmware.hex:i
Please plug in the device ...
Press CTRL+C to terminate the program.
Device is found!
connecting: 40% complete
Device has firmware version 1.2
Available space for user applications: 6010 bytes
Suggested sleep time between sending pages: 8ms
Whole page count: 94 page size: 64
scons: *** [upload] Error 1
Erase function sleep duration: 752ms
parsing: 40% complete
Error opening flash:w:.pioenvs/digispark-tiny/firmware.hex:i: No such file or directory
Error loading or parsing hex file.
========================= [ ERROR ] Took 16.18 seconds =========================

@ivankravets ivankravets modified the milestones: 1.0.2, 1.1.0 Mar 4, 2015
@ivankravets
Copy link
Member

Fixed in #107 and will be released in PlatformIO 1.0.2 today.

Please re-open if you still have this issue.

@ivankravets
Copy link
Member

Could you try new version 1.1.0? Please use platformio upgrade command.

Thanks in advance!

@nebulous
Copy link

For future Googlers: a similar problem occurs in OS X with USB3 ports. Try connecting the target device via a USB2 hub.

@erm3nda
Copy link

erm3nda commented Nov 19, 2019

Case of mine, a workaround is to just press Upload, then power up device AFTER process is trying to upload (it will be paused for a while, no need to be a ninja).
No device in list, just install micronucleus drivers then voilá.

https://github.com/micronucleus/micronucleus
https://github.com/micronucleus/micronucleus/tree/master/windows_driver

In my particular case, i have atinny85 usb device, i found and used those drivers:
https://github.com/digistump/DigistumpArduino/releases/download/1.6.7/Digistump.Drivers.zip

Hope this helps.

@icepaule
Copy link

icepaule commented Nov 3, 2023

Case of mine, a workaround is to just press Upload, then power up device AFTER process is trying to upload (it will be paused for a while, no need to be a ninja). No device in list, just install micronucleus drivers then voilá.

https://github.com/micronucleus/micronucleus https://github.com/micronucleus/micronucleus/tree/master/windows_driver

In my particular case, i have atinny85 usb device, i found and used those drivers: https://github.com/digistump/DigistumpArduino/releases/download/1.6.7/Digistump.Drivers.zip

Hope this helps.

Thx a lot. It DID help.... ;-)

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

No branches or pull requests

6 participants