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.

Uploading using programmer doesn't work

See original GitHub issue

Hi!

I believe there’s a bug here. When I’ve specified to use a dedicated programmer in platformio.ini (USBasp in this case) I’m not able to upload successfully by clicking the upload button in VS Code.

A little research reveals that this is caused by the -D flag in avrdude, which prevents the flash from being erased before upload. Is there any reason why the -D flag needs to be there in the first place? It’s not used by Arduino IDE. I suggest the user may add -D to upload_flags if there’s a special case where it’s needed. For most users, it’s only causing trouble.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
MCUdudecommented, Nov 27, 2020

A lot has changed since this issue was opened. The current implementation where we’re using a custom upload command is much better IMO.

0reactions
pfeerickcommented, May 7, 2019

Because erasing the flash would erase the bootloader… which you don’t really want to do since you’re about to use it! 😆 But you don’t have that concern with uploading with a programmer, so an erase gives you a clean slate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Error: avrdude' when uploading - Arduino Help Center
When uploading a sketch to your board you may get an error from the avrdude utility: stk500: avrdude: stk500_recv(): programmer is not...
Read more >
Uploading | Troubleshooting Guide For Arduino - GitHub Pages
General troubleshooting advice. Make sure it's actually an upload problem. The Arduino IDE compiles your code before uploading, so a bug in your...
Read more >
Fix avrdude: stk500_recv(): programmer is not responding
The first time, the sketch loaded without a problem. Then I changed a value in the sketch and tried to upload. That's when...
Read more >
Program doesn't run after Upload Using Programmer ... - GitHub
The issue of the program not running after Upload Using Programmer on ATmega2560 using Arduino as ISP has been solved by the update...
Read more >
Fix avrdude: stk500_recv(): programmer is not responding
We'll start at the most common and easiest, and move on to more detailed troubleshooting tasks if those don't work.
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