question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Please specify `upload_port`" error even though I'm uploading using USBasp

See original GitHub issue

Hi!

I go this strange error and AFAIK I’ve never seen this before. I’m trying to upload code to an ATmega324PB (MightyCore) and have the following platformio.ini file

; ENVIRONMENT SETTINGS
[env:MightyCore]
platform = atmelavr
framework = arduino

; TARGET SETTINGS
; PlatformIO requires the board parameter. Must match your actual hardware
board = ATmega324PB
; Clock frequency in [Hz]
board_build.f_cpu = 8000000L

; BUILD OPTIONS
; Current pinout
board_build.variant = mightycore_standard
; Comment out to enable LTO (this line unflags it)
build_unflags = -flto

; UPLOAD SETTINGS
; Upload serial port is automatically detected by default. Override by uncommenting the line below
;upload_port = COM4
; Upload baud rate
;board_upload.speed = 57600

; Upload using programmer
upload_protocol = usbasp
; Aditional upload flags
upload_flags = -Pusb

; SERIAL MONITOR OPTIONS
; Monitor and upload port is the same by default
;monitor_port = COM4
; Serial monitor baud rate
;monitor_speed = 250000

For uploading, I choose “Upload using Programmer” under env:MightyCore. After a short while I get this error:

Linking .pio\build\MightyCore\firmware.elf
Checking size .pio\build\MightyCore\firmware.elf
Building .pio\build\MightyCore\firmware.hex
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [=====     ]  54.0% (used 1105 bytes from 2048 bytes)
PROGRAM: [=====     ]  51.7% (used 16676 bytes from 32256 bytes)
Configuring upload protocol...
AVAILABLE: usbasp
CURRENT: upload_protocol = usbasp
Looking for upload port...
Error: Please specify `upload_port` for environment or use global `--upload-port` option.
For some development platforms it can be a USB flash drive (i.e. /media/<user>/<device name>)
*** [program] Explicit exit, status 1
============================================================================================================ [ERROR] Took 5.72 seconds ============================================================================================================
The terminal process terminated with exit code: 1

Why do I have to specify upload_port when I’m using a USBasp programmer?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:14 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
MCUdudecommented, Aug 20, 2019

Awesome! PlatformIO is getting better every day 👍 Thank you for being so available and spending time helping out users like me!

Please inform me when new releases of your cores will be available.

AFAIK only MightyCore is affected by the SPI1 related bug we’ve discussed earlier. I’ll keep you informed! It won’t be long, promise 🙂

0reactions
saintofinternetcommented, Nov 20, 2021

My Env. settings are as follows

[env:168pa16m] platform = atmelavr board = pro8MHzatmega328 framework = arduino lib_deps = locoduino/MemoryUsage@^2.21.1 upload_protocol = usbasp

I am getting the following error after upload via USBASP programmer to an Arudino Pro Mini

avrdude: verifying … avrdude: verification error, first mismatch at byte 0x20a9 0x21 != 0xf1 avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (E:FD, H:DA, L:FF)

avrdude done. Thank you.

*** [upload] Error 1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Please specify `upload_port` - PlatformIO Community
I get this error even though I have specified it in platformio.ini. ... `upload_port` for environment or use global `--upload-port` option.
Read more >
USBasp error while uploading - Arduino Forum
The solution? Go to tools|Burn bootloader to reload your bootloader via the USBasp. Then try to upload via the serial port -- this...
Read more >
Flashing Marlin... Help : r/Ender3Pro - Reddit
I am flashing the updated Marlin 2.0 BugFix onto my Ender 3 Pro. I successfully added/updated a bootloader with Arduino.
Read more >
Does anyone happen to know what to specify for upload_port ...
Does anyone happen to know what to specify for upload_port when using a USBasp on a Mac to flash with PlatformIO? Unlike Windows,...
Read more >
DIYBMS v4 - diyBMS - OpenEnergyMonitor Community
Hi Rick, i was trying last night to program my first module with an arduino, ... Upload options: custom upload port, speed and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found