Entering programming mode__FAILED!
温柔似野鬼°
988次浏览
2020年07月29日 19:24
最佳经验
本文由作者推荐
形容脸的词语-惊奇的拼音
AVR studio 4 forum - Entering programming mode..FAILED!
gamorrow - Mar 26, 2007 - 04:12 PM
Post subject: Entering programming mode..FAILED!
I can't troubleshoot a constant repeat of "Entering Programming Mode..FAILED!
during Auto programming cycles. Each attempt gives me a Quick Tip that points to
ISP programming frequency well below 1/4 of clock frequency, however that is not
the case-I am using the same3 frequency when I had no problems Auto Programming.
There is nothing in the help sections that describes this type of encountered problems.
Any suggestions from you gurus?
clawson - Mar 26, 2007 - 04:15 PM
Post subject: RE: Entering programming mode..FAILED!
So what's on the "board" tab of that dialog?
(and PLEASE post JPGs/GIFs and not .DOC files - I took a risk opening this one but most people are more cautious!)
Cliff
gamorrow - Mar 26, 2007 - 05:04 PM
Post subject: Entering programming mode..FAILED!
SEE JPG FILE ATTACHED...
clawson - Mar 26, 2007 - 05:21 PM
Post subject: RE: Entering programming mode..FAILED!
OK, so is the AVR you are trying to connect to clocking at 4MHz or more? Try
dropping the ISP frequency (to less than 250kHz) and see what transpires.
Cliff
K-pup - Mar 29, 2007 - 12:51 PM
Post subject: RE: Entering programming mode..FAILED!
i constantly have this problem with my stk500 and it seems when my chip is on the stk500, my stkosc is set to 3.68Mhz i believe and my isp is at 460kHz and that used to work and one day it stopped, i then played around with the fuses and i believe that this has a major affect on the programming. not entirely sure how but the fuses determines how the frequency of ur micro is going to work, whether it is internal/external RC circuit, or external crystal! try playing around with that! i did and it totally messed up my circuit! so now i gota debug it back to work so becareful when playing with fuses
JCommLAB - May 14, 2007 - 04:16 PM
Post subject: RE: Entering programming mode..FAILED!
Here's a potential fix. First,
How I screwed it up:
I was porting some code from ATM103 to ATM165P.
"Experimenting" with the CLKPR register, I inadvertently messed up my Target
clk-to-ISPAVR clk ratio. Got the infamous "Entering programming mode FAILED"
message.
AVRStudio:Connect to STK500/ISP
I used the "Board" tab to attempt to set the ISP clock lower, to no avail.
Injecting an external clock to Xtal1 did no good.
(External crystal on my known-good board was known-ok and I knew I hadn't messed with the SPIEn fuse)
I grabbed an STK500 and used it for my ISP to no avail. I 'manually' updated the ISP code. Nope!
I grabbed yet another STK500, used in the same 6pin ISP mode,..still same error message. Removed VTarget jumper on STK500 and powered ISP from target, with no result.
My AVRISP was "Lost in Space". It would not even program or
erase other
(known-good) AVR boards I had laying around!
The "Fix": I installed the latest version of AVRStudio using the code provided, upgraded my AVRISP code. Still had the same error messages!
Using the same install .exe program, I un-installed the code using the 'remove'option.
I re-installed AVRStudio 4.12b460. and using the 'manual' method, re-installed the old AVRISP code into my programmer(s). Still got the same messages:Entering programming mode.. FAILED!
I reset ISP clk to less than 1/4 of target clock..etc. Same error message.
I un-installed AVRStudio 4.12b460,(again) then re-installed AVRStudio 4.13b528.
When attempting to program a chip on a 'known-good' board, Studio gave a message
that my AVRISP had an older version of the ISP code. I followed the prompts and re-loaded (again) the updated code.
Whew!!
Everything finally got back in sync and I can now program chips again!
The experience got me spooked, because I really don't know why this fixed the problem. The folks at Atmel warned me to be careful using the CLKPR reg and CLKDIV fuse features.....but they may not have realized the potential for AVRStudio/(orig hardware)AVRISP getting out of sync.
Maybe future version of AVR Studio could do a little more "hand holding" on this issue. For example, maybe a place where you could enter your proposed CLKPR value (that you plan on using in your code) and then AVRStudio (keeping track of your fuse settings,etc) could warn you if (and how) you are getting stupid.
Getting careless in this regard cost me a weekend of downtime!
ericzundel - Sep 06, 2009 - 01:52 PM
Post subject: RE: Entering programming mode..FAILED!
I am having a similar problem here today. I programmed in a bootloader and
things seemed to be working, then, I accidentally set the fuses of my ATMege328P
to 0xFF ext 0xda high and 0x05 low. I've got a 20MHz crystal soldered in, but
the fuses are now set for a 32kHz crystal.
I tried swapping in a 32kHz crystal but I still can't talk to the board. I've
tried two different programmers and unlike the previous post, I was able to
successfully communicate with another board. I'm thinking I just need to replace
the chip and be more careful the next time I set the fuses.
ericzundel - Sep 06, 2009 - 02:11 PM
Post subject: RE: Entering programming mode..FAILED!
Ah... that smell of hot plastic and burning flux is the sweet smell of success!
When we last left our hero (me), I had a 32 kHz crystal in my board to match the
0x05 fuse bits set for the ATMega328P and I had my ISP frequency set as low as
it would go (51 Hz) and it still wouldn't read the fuse bits or the device
signature.
The answer I found in another post: bring up the program dialog in AVRStudio,
and then power the board off and on. That's pretty lame, but it worked. I
re-programmed the fuses CORRECTLY, and re-soldered in my 20MHz crystal. I was
able to program the bootload
er again and my bootloader works! I don't know if
the 32kHz crystal had anything to do with it, but I'm not going to try it again
to find out.
For the record, I'm using AVRStudio 4.16 build 638 with an AVRISPmkII
programmer.
unreal - Sep 22, 2009 - 12:00 AM
Post subject: Entering programming mode.. FAILED
The MCU is Atmega 162, new out of box. I soldered it on a prototype device made by myself. I start AVR Studio and try to read the signature bytes, I get the right signature and move on to FUSES, uncheck the "Divide clock by 8 internally" and
select the new clock source as Ext. Crystal Osc. Frequency 3.0-8.0 MHz.
Then I go to Program Tab and try to erase and program the MCU... and get this error! I can't do anything, no programming, no erase, no set fuses, not even read the signature bytes.
I go to Board tab and select a lower ISP frequency (currently was 115,2kHz), the same error. I go down to the lowest ISP frequency (1,2kHz) and the same error.
What can I do? Any ideea? I'm totally confused why is this happening and why
it's not working anymore.
js - Sep 22, 2009 - 12:37 AM
Post subject: RE: Entering programming mode.. FAILED
My guess is that your crystal circuit is not working. Keep the ISP frequency at 115,2kHz and try to inject a clock of maybe 1 MHZ into XTAL1.
What frequency is your crystal? Do you have the necessary caps with it?
unreal - Sep 22, 2009 - 09:13 AM
Post subject: RE: Entering programming mode.. FAILED
Crystal frequency is 3,6864 MHz and caps are 18pF. I've made two identical
devices (same code, same schematic) and the device 2 works.
I'll try to inject a clock but I've got no clock source available, just the
STK500.. I hope to find a way to get a clock from there.
clawson - Sep 22, 2009 - 09:28 AM
Post subject: RE: Entering programming mode.. FAILED
Quote:
I've got no clock source available, just the STK500
Okxymoron - the STK500 includes a clock geenrator.
unreal - Sep 22, 2009 - 12:01 PM
Post subject:
I supplied an external clock signal from STK500 to XTAL1 pin and works.
Analyzing the XTAL1 pin, I found out that isn't properly soldered.
Thanks for help.
chuuken - Oct 21, 2009 - 05:19 AM
Post subject:
I am having a similar issue; (entering programming mode... FAILED!). I think the clock is the issue for me as well, but I'm not familiar with the external clock thing yet.
I'm using an atmega8, a breadboard, a 5V power source, (the voltage reads
between 4.5 and 4.7 in AVRstudio), and an AVRISP mkii.
The circuit is set up the same way it has been in the past with working results, I have the programmer hooked up to the proper pins, (I've checked and rechecked,using a mulitimeter), I have a green status light on the mkii, (two green lights total, counting the USB light).
I've followed the instructions to completely reinstall AVRstudio, I'm using
v4.17 build 666. I've upgraded the firmware on the programmer, it shows v
ersion
0x010c.
The only thing I can think of, (given my lack of experience), is fuses. I think the chip is looking for an external clock, and I'm not currently giving it one. I've seen the circuit on the datasheet utilizing a crystal to bridge xtal1 and xtal2, with two caps going to ground. Would this fix the issue, if a clock is what is lacking? If so, what value caps should I use. The datasheet gives a range, does anyone have a preference?
Also, why is this an issue now? Does this sound like I changed something (fuse wise), in the past and forgot to change it back? How do I get the atmega8 to use its internal clock again?
The fuse I think has ANY bearing on this is;
SUT_CKSEL
which is set to
l/Resonator High Freq.;Start-up time:16K CK + 64ms
Do I want to change it to one of the settings that begin with "Int. RC Osc"?
Even if I do, it seems I have to figure out the external clock first, (if that's the problem), since it still fails to enter the programming mode when I select that Int. option.
Advice please, (and a reason why, for my benefit, super-please).
I am confused, and a bit frustrated, since I now own two AVRISP mkii units, (I wanted to rule out a bad unit... I have), and I still can't put my silly little programs on my chips! I want to get an AVR Dragon, but I am pretty sure if I can't get these little guys working, I'll find a way to break the dragon too.
Sorry for the long post,
Mike
js - Oct 21, 2009 - 07:10 AM
Post subject:
Well HAVE you changed any fuses? If not then the chip will still be on the
internal 1MHz mode. If you lose the clock there is NO ISP anymore untill you
provide a clock into XTAL1.
chuuken - Oct 21, 2009 - 06:21 PM
Post subject:
I have changed nothing on this chip, that I am aware of. I have tried two
separate atmega 8 chips, (new), as well. If I've changed something, it would be in the AVRstudio... Is that possible? (let me qualify this; I poked at the selection for the SUT_CKSEL fuse option a little, but the option I posted above was where it started and where I left it after my poking around).
Also, the SUT_CKSEL fuse I mentioned. Before I did anything to it, it was set to the option I referrenced. From what I was able to find, that is the origional setting (confirm/deny?). Is that the problem?
I plan to pick up the caps I need and put a crystal on it after work today. I'll report as to whether or not that fixes the issue.
------------------
** I pulled this out to make it its own thread, thanks.
**
------------------
atl95148 - Nov 04, 2009 - 01:24 AM
Post subject: RE: Entering programming mode..FAILED!
I am having same Failed Programming error after I play with the fuse bits.
Please suggest the solution. My boards was OK before. Now, I am dead.
atl95148 - Nov 04, 2009 - 01:31 AM
Post subject:
Please anyone help me. I play with the fuse bits and now my ISP program get
error "failed programming
". I am stuck. How do I get out?
meslomp - Nov 04, 2009 - 06:40 AM
Post subject: RE: Entering programming mode..FAILED!
the solution is dependant on what you did to the fuse bits......
try lowering the ISP speed to as low as possible and try to restore the fuse
bits.
add an external 1MHz signal to the xtal1 pin and try to read back and adapt the fuse bits....
or use high voltage programming to get the fuse bits back to a valid and working configuration..
and then there are all the other solutions that have been discusions on in this forum.....
clawson - Nov 04, 2009 - 09:15 AM
Post subject:
Moderator note:
The same thing was posted twice but both threads developed (9 replies each) so I have simply merged everything into this one copy.
Cliff
guiltyspark - Dec 17, 2009 - 04:40 AM
Post subject: Same problem... Any *other* ideas?
I'm using Windows XP (SP2), all current. AVRisp MkII with latest upgrade, and AVR Studio v4.17.666. I have an ATMEGA168 on a breadboard, with an LM7805 Voltage regulator, all necessary capacitors. I've got a 14.74MHz crystal on it (across XTAL1 & 2), with necessary capacitors.
I've checked the voltages and all the above with either a voltmeter or
oscilloscope (as appropriate).
----
I am using an AVRisp MkII programmer (hereafter called 'programmer'), in ISP
Mode. I have an 8K2 pull-up on the reset pin (I've also used a 4K7), and the
programmer gives me the obligatory green LED (the USB LED is also green and
blinks accordingly for comm with the CPU).
I have placed 1K pullup on each of the MISO/MOSI lines and a 1K pulldown
resistor on the SCK line.
----
The first time I connected it up, I could read signature info, fuse & lock bits, etc. I had to make sure the speed was at 15kHz, but it worked. H/W reads 4.9V on VCC, AVRef & AVCC (It's actually 4.96V). I went ahead and erased the chip, leaving all the fuse and lock bit settings alone, although since the chip is erased with 0xFF, all the lockbits get set to 'unprogrammed'.
I made the mistake of telling it to upgrade the programmer's firmware when it kept persisting in asking me if I wanted to-- after that, it messed the
programmer up so badly I couldn't even talk to it. Turned out, it messed up the USB Driver, and uninstalling AVR Studio as well as Win-AVR did not uninstall the backup driver configs the system keeps in the System32 folder (Drvrstor). Long story short, I got that sorted out and now can talk to the programmer just fine again, but now I can't program the MCU.
I get the ever ubiquitous message if I try to talk to the chip:
Setting mode and device parameters.. OK!
Entering programming mode.. FAILED!
Leaving programming mode.. OK!
I am set to 6.8kHz, as they state (I forget where) that if you go too low, you cannot enter programming mode. I've tried other speeds to no avail, and I'm certainly not anywhere near 1/5th the speed of the clock crystal on it. I've fid
fails. No matter what ISP frequency I chose, I get this error.
Well...I shut everything down...left my work area, watched some TV, had some ice cream and went to bed...this morning I powered up, and tried everything again and it worked like a charm....go figure.
guiltyspark - Jan 01, 2010 - 11:51 PM
Post subject: RE: Re: RE: Same problem... Any *other* ideas?
I'm glad it's still working for you! One thing I learned-- never have the target connected when you upgrade the ISP's firmware.
TheHoos - Jan 28, 2010 - 04:24 PM
Post subject: RE: Re: RE: Same problem... Any *other* ideas?
Mine was working fine and then one day it just stopped, and I get the error
mentioned here.
I managed to fix it and here's what the problem was. I entered Debugging mode at some point and after that I couldn't program it any more.
1) What you have to do is, enter Debug mode (so press the play button in AVR
Studio); this should work.
2) Then go to "AVR Dragon Options" - under the Debug pulldown-menu - and select the "Connections" tab.
3) Click on the button "disable DebugWIRE".
4) Confirm and everything should be back to normal.
At least that worked for me...
js - Jan 28, 2010 - 09:20 PM
Post subject: RE: Re: RE: Same problem... Any *other* ideas?
Quote:
1) What you have to do is,
...read the docs, it's all explained there.
(under Debugging in the Dragon's help file, pay attention to Fig 3.19)
But good engineers only do that AFTER the smoke comes out or things don't work.
All times are GMT + 1 Hour
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits