The message is telling you that a parameter is missing…
Error: Please specify upload_port for environment or use global --upload-port option.
What do you actually have in your platformio.ini
? Does it have the correct settings for your programmer? And are you using the program
/ upload with programmer
option rather than the standard upload option (which for this device family is more for serial uploading).
From another post made recently, it seems that …
upload_protocol = atmelice_isp
… should work for the Atmel ICE programmer (but I haven’t tried that with mine yet, so can neither confirm or deny that! ).