Atmega328p "entering programming mode Failed!"

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

Hi all,

This morning, my atmega328p don't accept anymore any communication with avr studio 4 + AVRIS mkII USB programmer.
The problem appears after a first programming, that was successful until the "verify" step, that failed.
After that, no com was possible (even the "read signature").
I have to say that before that problem, I sometimes encounter another kind of reccurent problem when my code was above "90.0% full" in FLASH space (very space reaction : EEPROM was corrupted after a FLASH PROGRAMMING above 90%, whithout any programming of the eeprom. I had to PROGRAM the EEPROM to correct eeprom corrupted data, then rePROGRAM FLASH below 90.0% to get it to work nicely.
It was very strange behaviour, no ?

What can I do now ?

Thanks for your help !

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

Standard question 1A in these cases: Did you by any chance order a change of the AVRs fuses? Especially the clock selection fuses?

What actual clock source (internal RC, external crystal etc...) where you relying on to get the AVR running (and programmable)?

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 for your answer Johan,

The clock source is external crystal : Atmega328p is also running to 20 MHz.
Your question is natural, but of course, the fuses are still constant for a while !

The really only thing that happen just before it crashed is the program I load into the flash (no eeprom change, no hardware change...).

If you see any 1B question or explanation, your welcome :)

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

Here is a bit more : this is the best I can do by myself. I'm a beginner in AVR chip !

C:\Users\....>avrdude -c avrisp2 -p m328p -P usb -F

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
avrdude: AVR device initialized and ready to accept instructions
avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
avrdude: Expected signature for ATMEGA328P is 1E 95 0F

avrdude done.  Thank you.
C:\Users\...>avrdude -c avrisp2 -p m328p -P usb -v

avrdude: Version 5.10, compiled on Sep  9 2010 at 15:36:47
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Program Files (x86)\Atmel\AVR Too
ls\AVR Toolchain\bin\avrdude.conf"

         Using Port                    : usb
         Using Programmer              : avrisp2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200055217
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page
      Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  Max W   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- --- -- ---------
           eeprom        65     5     4    0 no       1024    4      0  3600  36 00 0xff 0xff
           flash         65     6   128    0 yes     32768  128    256  4500  45 00 0xff 0xff
           lfuse          0     0     0    0 no          1    0      0  4500  45 00 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  4500  45 00 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  4500  45 00 0x00 0x00
           lock           0     0     0    0 no          1    0      0  4500  45 00 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0  0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0  0 0x00 0x00

         Programmer Type : STK500V2
         Description     : Atmel AVR ISP mkII
         Programmer Model: AVRISP mkII
         Hardware Version: 1
         Firmware Version Master : 1.13
         Vtarget         : 5.2 V
         SCK period      : 8.00 us

avrdude: stk500v2_command(): command failed
avrdude: stk500v2_command(): unknown status 0xc9
avrdude: stk500v2_program_enable(): cannot get connection status
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.


avrdude done.  Thank you.

What kind of test could help for diagnostic ?

Thanks by advance