Can't flash MCU.

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello I am trying to flash an atmega64. I accidentally tried to flash it when the debugging was still going on. I stopped debugging and now this the output when flashing.

 

 

avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9602
avrdude.exe: NOTE: FLASH memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: warning: cannot set sck period. please check for usbasp firmware update.
avrdude.exe: reading input file "Debug\.hex"
avrdude.exe: can't open input file Debug\.hex: No such file or directory
avrdude.exe: write to file 'Debug\.hex' failed

avrdude.exe: safemode: Fuses OK

avrdude.exe done.  Thank you.

Help!

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Show the command line used, as this error is pretty clear!

 

azimmali wrote:
avrdude.exe: can't open input file Debug\.hex: No such file or directory

 

It could not find the hex file with no name!

 

Jim

Mission: Improving the readiness of hams world wide : flinthillsradioinc.com

Interests: Ham Radio, Solar power, futures & currency trading - whats yours?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrdude -c usbasp -p atmega64 -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jim, for some reason it has started working now. I have no clue how.

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The attempt to program flash while debugging, and the AVRDUDE failure probably are not related.

 

You need to actually read through the AVRDUDE output in detail and take note of everything. Read, s-l-o-w-l-y, stop, think. Take special note of this 

can't open input file Debug\.hex: No such file or directory

 

A file with file path "Debug\.hex"? Something is obviously wrong there, right? E.g. there's no file name.

 

So, go back and inspect your command:

 

avrdude -c usbasp -p atmega64 -U flash:w:$(ProjectDir)Debug\$(TargetName).hex:i

Isn't it obvious that two macros (or whatever Atmel Studio calls them) has expanded to empty strings? These: $(ProjectDir) and $(TargetName). If both of those expand to empty strings, you will get the file spec that can be seen in the error from AVRDUDE.

 

You need to tell us in what context of Atmel Studio you are using this.

 

E.g. do you have a project open in Atmel Studio when you run the AVRDUDE command?

 

EDIT: Resolved while I was thinking and typing the above. 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

Last Edited: Wed. Dec 13, 2017 - 07:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have added USBasp as a custom programming tool - by following certain steps that I came across a blog. Here's the link to my reference:https://blog.manash.me/setting-up-atmel-studio-for-usbasp-and-avr-programming-802bb4dcf1e9

 

 

I did not use that command in AVRdude. I m flashing the mcu using AS7. It worked well until the last time it stopped writing. I asked my colleague to try flashing on his computer and it did work. Following that, I flashed once again and bingo it's back. I do not know what may have caused that temporary halt in program flash.

 

 

Thanks

Amateur programmer.
Believe when I tell you that my struggle on here is real.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

While the problem has been resolved...

azimmali wrote:
I did not use that command in AVRdude. I m flashing the mcu using AS7.

I know that.

 

I was trying to point out that you could start drawing conclusions on what went wrong by looking at the details of the messages from AVRDUDE. And that if you wanted help with that we'd need to understand more.

 

The use of the "macros" $(ProjectDir) and $(TargetName) made it entirely clear already at your post #3 that you where using Atmel Studio, running AVRDUDE through a custom External Tool (that you or someone else has set up in your Studio).

 

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Johan. :)

Amateur programmer.
Believe when I tell you that my struggle on here is real.