trouble transfering program with avr dragon and codevision

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

hi im using codevision avr and i have an avr dragon hooked up to my stk500 after i build my program and go to download to the board i get to the point where it is erasing the chip and i get a failed to erase chip message. i can go to avr studio and download the hex file through there using the dragon without any problems. thanks for your help.

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

Perhaps you should describe how you have conneted the Dragon. For example:

1. you may be using JTAG and the Dragon is just wired to the JTAG pins on the STK500.

2. you debug with JTAG but want to program via STK500 ISP header.

3. you are ISP-ing with the Dragon and completely ignore the STK500 ISP system.

Configure your CodeVision programmer accordingly. CV will only program by ISP (I think). But when you go into Studio for debugging, this will load the debugger with the "Platform and Device" setting.

David.

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

the settings in avr studio is for the dragon in isp mode. the outer light on the dragon is red and the inner is green. ive lowered the frequency to the lowest setting and still no luck.i am plugged into the six pin isp on the dragon. any other ideas would be appreciated.

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

I will assume:

1. the AVR is in the STK500 socket.
2. the 6-pin cable from the Dragon is connected correctly to the relevant 6-pin header on the STK500. The STK500 6-pin programming header (white) is disconnected.
3. you can program your current "wiring" setup wih Studio.

Go to CodeVision Programmer Settings and select Dragon + ISP

Go to CodeVision Programmer and try to Read signature etc.

Now try a regular Compile and Program.

David.

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

I gotta ask, if you are only using the Dragon to do ISP and not JTAG/dW then why would you bother? The STK500's own ISP programmer is more robust and at least as easy to use. The only "unknown" is picking which of the three coloured headers to connect the ISP6PIN to.

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

hi david and clawson i went to codevision and selected the dragon and isp and tried reading the signature it said error reading signature. and yes david all your assumptions were right as far as the settings. clawson im not using the stk500 isp only because i dont have a serial to usb converter. any other ideas would be appreciated.

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

1. I would just buy the cheapest USB->RS232 cable you can find.

2. It is a mystery. If Studio programs ok, then CV should do ok too.

3. I presume there is a Dragon.exe command line program, and this works ok.

4. And if you try avrdude -c dragon_isp -v -v , then you should get a detailed progress report. ( you may have to install the GNU Windows USB driver)

5. The only other possibility is that your STK500 is supplying a silly Vtarget voltage, or a silly clock frequency.

I am a great fan of the STK500, but if you cannot control or read it, it seems to be a complete waste of money. ------ beg, borrow or steal a serial cable.

You can test the STK500 clock frequency by burning a blinky with Studio. The Dragon can probably read your STK500 voltage via Studio. Do you have a multimeter?

David.

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

hi david thanks to you and clawson for your help i gave in and bought the usb to serial converter and all is well. im working with pavel from codevision as to why the dragon is not working.and clawson to answer your question on the dragon im still real new to this so i havent learned the jtag/dw programing features yet i hope to get there someday.

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

Hi, sorry for replying to a year-old thread but I was wondering if you found any way to solve this issue.

I have a Dragon (rev C) and I'm facing the exact same problem.
The Dragon is properly recognized and works fine with avr studio but it seems that codevision (2.04.9a eval) doesn't even know it's there...

I tried setting the ISP clock to the lowest possible, tried ISP and JTAG, even tried a different cable but nothing works.

I borrowed a STK600 from a friend today and it works fine with codevision so I guess it has to be some problem between codevision and the software driver of the Dragon...

Ok obviously you can just use the avr studio to program your chip with the hex that CV produces but constantly switching between the 2 programs can be pretty annoying when you are debugging.

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

Quote:

be pretty annoying

Alt-Tab?

(even if you use Studio with GCC where you build and debug in the same program the entire screen is redrawn each time you switch from edit/build mode to debug mode so it's not really any different).

One thing you might try (though this is a Loooonnnggg shot!) is to go to www.atmel.no/beta_ware/ and download the new Jungo USB driver which may in some sense have improved the visibility between CodeVision and the Dragon.

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

Did you select Settings-Programmer-Dragon?

Then what did you try? "Read Programmer Firmware Version"?

What were the results? Smoke and fire? Klaxons? BSOD?

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

tasosmos wrote:
Ok obviously you can just use the avr studio to program your chip with the hex that CV produces but constantly switching between the 2 programs can be pretty annoying when you are debugging.

This is just life. A CodeVision / Studio debug session works like this:

1. Compile and build in CodeVision. (programming is unnecessary)
2. Flip to Studio.
3. Studio recognises that the COFF file has altered.
4. Studio prompts and reloads the new COFF file via debugWire or JTAG.
5. You single-step. Watch. Examine registers ...
6. You can view the source code as you debug. But you cannot edit the READ-ONLY source code in Studio.
7. Flip back to CodeVision.
8. Edit the source. Goto step (1).

Rinse and Repeat.

While you are part-way through a Studio debug session, you cannot use ISP or JTAG via CodeVision. Quite simply because Studio has control of dW or JTAG. Stop the Debug session. Disable dW. CodeVision (or any other external programmer) can ISP program again.

David.

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

@david & clawson: Sorry if I misled you but I didn't mean debugging in the sense of using a debug interface etc.

I meant just burning a program you've written to the hardware and seeing whether it works as expected.

For that obviously you don't necessarily have to use the avr studio... :-)

@theusch: Of course I changed the programmer to Dragon from the settings menu before doing anything.

I suppose you've got a STK because if you choose the Dragon the "Read Programmer Firmware Version" disappears from the chip programmer menu.

No matter what you do the Dragon doesn't enter programming mode. That is also indicated from the leds remaining on idle status.

Codevision just returns an error as if the dragon isn't even connected.

I've already tried the latest jungo driver, no luck...

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

I possess an early Dragon but have seldom used it.

So I connected to a mega168 via the 6-pin ISP, and set CodeVision to use the Dragon ISP.

I had to go to Studio to upgrade the Dragon.
Then went back to CodeVision.

I could 'Compile + Program' in one go, exactly the same as using the STK500. It was noticeably slower. Some 9 seconds to program and verify a small mega168 app. Using Studio, the same operation took about a second.

Using avrdragon.exe, it took about 4 seconds.

In my experience, the CodeVision 'Programmer' tool will work perfectly with any of the programmers in the drop-down list. It works very efficiently with the STK500. It works a bit slowly with say an AVR910 type.

David.

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

I have the same problem:
- early Dragon
- latest www.atmel.no/beta_ware/ Jungo USB driver - couldn't get anywhere at all without that
- Dragon firmware upgraded in Studio 4.18
- Dragon works fine in Studio
- Selected Dragon as programmer in CV 2.5.0 (commercial)
- Can't do anything from the CV Programmer - read signature/program etc - just (eventually - 10 seconds?) reports "AVR Dragon error in XXXXX" where XXXXX is the attempted operation. The same error occurs if a) ISP cable not connected to target b) Dragon not connected to USB - so it's just acting like it's not connected (when it is)

EDIT: attempting to read/program ATMega1284P
EDIT2: Dragon updated in Studio 4.18 SP3 (Build 716)

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

Reply from Pavel

> Most likely you are using Windows 7 64bit.
> This is a bug in the AVRDRAGON.EXE utility that comes with AVR Studio 4.18
> SP3.
> When it is launched by the CVAVR IDE, it can't read the part description
> files in
> order to know the list of supported devices.
> You can easily reproduce this by launching AVRDRAGON -h from the command
> prompt.
> The bug was reported to Atmel.
> Hopefully they will fix it in the next release of AVR Studio.

I am indeed using Win 7 64-bit. Forgot to say that.

Doh.

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

It is a small world. Tried get my AvrDragon ISP to work last night on all machines. XP OK, Vista OK, W7 Starter 32 bit failes w/CV, OK w/Studio Went to report on CV yahoo group, Martin beat me to it, amazing.

It all starts with a mental vision.

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

Pavel found a solution. I tested and works on W7 32 bit.

Re:CVAR yahoo groups

We have found a solution to this problem, until Atmel fixes it.

You must completely disable User Account Control (UAC) in Windows 7, then
restart your PC.
Launch CVAVR and do some simple operation with the Tools|Chip programmer,
for example read chip signature.
After that you may re-enable UAC and restart again your PC.
From now on, AVR Dragon can be used with CVAVR.
If you re-install or upgrade AVR Studio, you must repeat the above steps.

Regards,
Pavel

It all starts with a mental vision.

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

Mixed success - certainly works some times now, when previously zero success.

But only works about 6-7 times in 10 when going repetitively through random sequences of reading chip sig, programming FLASH, programming EEPROM, reading EEPROM etc

...and can't read fuse bits or calibration byte at all...