ATMEL Studio6 & AVRISP MKII Problem with programming

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

Hallo everybody

I'm from german and my english is not good.

I have problems with my programming tool "AVRISP MKII", Studio6 SP2 and Atmel XMEGA-A1 Xplained evaluation kit. Significant difference between verified and programmed data in the lower memory area, see attachment.

Youtube-Video: http://www.youtube.com/watch?v=3...

I test examples from Studio6 and the problem is the code-size in xmega-prozessor. The errors occur in programming sizes of 0x200, 0x400, 0x600, 0x800 and more.

ATMEL USB driver is latest from the website (beta-ware).

Everything is ok when i work with Studio 5.1 and same A1-Xplained-Kit.

I hope you can help me. Thanks a lot.

Greetings from germany. Rolf

Attachment(s): 

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

1. You must disable JTAG before you can use PDI.
2. Apparently you can insert a series resistor that might allow you to have both JTAG and PDI simultaneously. I have not tried it.
3. Your AVRISP-2 should work reliably (untested).

I possess a Dragon / JTAGICE-mkII. So it is easier to just use JTAG. Using Flip / Batchisp is quite a pain. However, it should be relatvely easy to install a more convenient bootloader.

Oops. Meanwhile, I thought that I would disable JTAGEN. Then try PDI with a Dragon. This seems to have killed everything. No PDI and no JTAG. And yes, I have tried connecting a 1k pull down to CLK.

I can access via Flip, but that is about it.

David.

Edit. The Dragon is not able to use PDI with the Xmega128a1. I used a JTAGICE-mkII to connect the now JTAG-disabled Xmega via PDI. Restored JTAGEN.
It is a mystery why the Dragon can use PDI with a Xmega32 but not the Xmega128a1. Surely PDI is PDI regardless of the PDI chip. It is an even bigger mystery why both AS5.1 and AS6.0 permit selecting Dragon + PDI for a xmega128a1. AS4 only permits JTAG.

Last Edited: Sun. Dec 2, 2012 - 06:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hallo David,
thanks for your tips but my AVRISP MKII is working fine with studio5.1. Wy not in Studio 6 ??

My AVRISP MKII is conacted to my Xplained-Kit see picture.

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

The only reason I see that could explain 6.0 not working and 5.1 working is that some settings in 5.1 are more conservative.

Tried lowering the JTAG speed etc to stupidly low clocks, just to see if thinks suddenly starts working?
It pays of to actually read that you are using PDI...

Also, have you actually tried to verify using the programming dialog, or are you just doing comparisons side-by-side? (Or on another note, do you get a warning during programming that the verification fails?)

:: Morten

 

(yes, I work for Atmel, yes, I do this in my spare time, now stop sending PMs)

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

Hallo meolsen

I cant adjust the speed for JTAG/SPI in Studio6/5.1.

The problem is a same when i programming over the debugging funktion (F5) or device-programming over tool-menu.

I have test a lot of examples from Studio6 and the problem is now when the file-size is over 0x200, 0x400, 0x600, 0x800 and more.

See the hex-file. This hex-file is a example from studio6 for the Atmel XMEGA-A1 Xplained evaluation kit (ATxmega128A1 microcontroller). When i programming in stdio6 and make a verify-Test, than a error-message is coming at adress 0x1800.

Thanks for your help. Greetings Rolf

Attachment(s): 

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo

This is a programm-code for the XMEGA A1-Xplained-Kit and Studio6. The Code-Size is 1024Byte long without the last line. Programming and verify is ok. When add the last line the code-size is 1026Byte long and a verify-Error is coming.

//***************************************************************************
//
//                          Simple LED-Test
//
//	Kit: ATMEL XMEGA A1-Xplained
//  Programming-Tool: AVRISP MKII
//  Program-Size: 0x0400
//  add the the last line and and verify-Error is comming at adr. 0x0401
//
//***************************************************************************

#include 
#include 
#include 

int main(void)
{
	sysclk_init();
	board_init();
	
	gpio_set_pin_low(LED0_GPIO);
	gpio_set_pin_low(LED1_GPIO);
	gpio_set_pin_low(LED2_GPIO);
	gpio_set_pin_low(LED3_GPIO);
	gpio_set_pin_low(LED4_GPIO);
	gpio_set_pin_low(LED5_GPIO);
	gpio_set_pin_low(LED6_GPIO);
	gpio_set_pin_low(LED7_GPIO);
	gpio_set_pin_high(LED0_GPIO);
	//gpio_set_pin_high(LED1_GPIO);		// add this line and verify-Error is comming at adr. 0x0401 
	
	

	while (1)
	{
		
	}
}

Please testing. Thanks a lot.

Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

I don't have an AVRISP-2.

I attempted to replicate your 'project' by selecting template from "XMEGA-128A1 Xplained" board, and adding "clock" and "delay" modules from the ASF.
This built to 1112 bytes rather than 1024 bytes.

I removed JTAGEN fuse and connected a JTAGICE-mkII via PDI.

This programmed fine via AS6 for both "Start without Debugging" and "Start Debugging and break"
I also tried "avrdude -c jtag2pdi -P usb" and this also programmed and verified fine.

I have no idea why your AVRISP-2 fails with PDI.

1. I presume that you have removed JTAGEN fuse.
2. Does it just fail the verify. i.e. runs ok.
3. Have you tried "avrdude -c avrisp2 -P usb" ?
4. Have you tried "atprogram.exe -t avrispmk2 -i pdi" ?

The ASF does seem to be rather a contortion. Perhaps I should gain some more experience with using it.

PDI and JTAG seem to be mutually exclusive. As soon as you remove JTAGEN, you can only access via PDI. As soon as you restore JTAGEN, you can only access via JTAG.

I don't see any mention of the Dragon + PDI problem in the AVR1924 or AVR1927 app notes.
I would expect most Xmega owners to possessa Dragon / JTAGICE-mkII / JTAGICE-3 ...
OTOH, there must be several who only own AVRISP-2, or don't actually want to do hardware debugging.

David.

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

Hello David
I just got an email from Atmel support:

"Hallo Rolf
We were able to reproduce the issue at our end. It seems to be dependent on the tool and hex size and independent of the Operating System used. We have logged a bug for the same.
But the issue seems not to be present on JTAGICEmkII, JTAGICE3 and AVR Dragon.
Sorry for the inconvenience caused.

Best Regards,
Atmel Technical Support Team"

Now i work with Atmel Studio 5.1 Its work fine with my tools and windows8. And I am waiting for a udate of Studio6.

Thank for your great helbs.

Greetings Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

I suggest that you persevere with Studio 6.
The only 'problem' appears to be the "Start without Debugging" or the Programmer dialog.

You can just add avrdude.exe or atprogram.exe to your Tools menu. e.g.

avrdude -c avrisp2 -P usb -p ATxmega128A1 -U flash:w:"$(ProjectDir)Debug\$(ProjectFileName)".hex:i

I would be very surprised if the command line programs had the same problem.

Atmel will solve the AS6 'problem'. They will not solve all the AS5.1 problems.

David.

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

Hallo David

Thanks for your Tip, but it does not work. One error message is coming: "avrdude.exe: usbdev_open(): did not find any USB device "usb"

I dont now ? My AVRISP MKII is installed and the driver is ready.

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

To use avrdude and Atmel tools with AVRISPmkII you need to start with no USB driver support whatsoever. Then install "Jungo" (which is part of the AS6 install) and that installs the driver Atmel use in AS6 to talk to the AVRISpmkII. After that google "libusb" and download the installer but during the installation make the selection to install the "filter driver" rather than the full driver. To avrdude this looks like normal libsub but it's actually just a layer that sits on top of the Jungo driver that's already installed.

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

Hallo clawson

Thanks for your great tip with drivers. I still have a little problem in studio6.

This is the massage from studio6 when i burn with avrdude:

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x1e974c
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: reading input file "D:\Download and Data\Download\AVR\Projekte\Dimming01\Dimming01\Debug\Dimming01.cproj.hex"
avrdude.exe: can't open input file D:\Download and Data\Download\AVR\Projekte\Dimming01\Dimming01\Debug\Dimming01.cproj.hex: No such file or directory
avrdude.exe: read from file 'D:\Download and Data\Download\AVR\Projekte\Dimming01\Dimming01\Debug\Dimming01.cproj.hex' failed
avrdude.exe done. Thank you."

Whats the problem ?

This are arguments for avrdude: avrdude -c avrisp2 -P usb -p ATxmega128A1 -U flash:w:"$(ProjectDir)Debug\$(ProjectFileName)".hex:i

Thanks for your helb :)

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Sorry. My mistake. There is no simple way to get the Project 'basename' from AS6.

If you have the Project Properties in the Editor Window, you can use the ItemFileName

avrdude -c avrisp2 -P usb -p ATxmega128A1 -U flash:w:"$(ProjectDir)Debug\$(ItemFileName)".hex:i

Alternatively you write a small .BAT file that contains the avrdude arguments. The batch file can strip off the file extension. Then you only need pass the "$(ProjectDir)Debug\$(ProjectFileName)" argument. e.g.

avrdudebat.BAT:

avrdude -c avrisp2 -P usb -p ATxmega128A1 -U flash:w:"%~p1%~n1".hex:i

Another method is to use a Post-Build avrdude command instead. You have got more $macros that you can use from inside your project than from the Tools menu.

David.

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

Hallo David

I have found a simple way to work now. i have renamed the "main.c" to example1.c before debugging and it works now.

The arguments for AVRDude is:

avrdude -c avrisp2 -P usb -p ATxmega128A1 -U flash:w:"$(ProjectDir)Debug\$(ItemFileName)".hex:i 

Thank a lot for your help. Greetings Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo David

I have made a bat-File vor avrdude. Its running fine. A small problem were the blank in file names. Now avrdude its working fine without problems. Thanks.

Greetings Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

So is the PDI 'feature' only a problem with Studio 6 ?

i.e. does avrdude.exe and atprogram.exe work ok ?

Yes, you need to add quotes round "filenames containing spaces"
Windows' CMD.EXE is a bit of an abortion.
A Unix shell like bash is far better for running external programs.

David.

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

Hallo

I have new problems with avr-studio6 and avrdude.

often does the error message:
avrdude: stk500v2_command(): error in CMD_XPROG: Collision
avrdude: stk600_xprog_program_enable(): XPRG_CMD_ENTER_PROGMODE failed
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500v2_command(): error in CMD_XPROG: Failed
avrdude: stk600_xprog_program_disable(): XPRG_CMD_LEAVE_PROGMODE failed

avrdude done. Thank you.

what can I do ?

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hello Rolf,

I also encountered the problem with cutting of data during the programming with AVR-ISP mkII. It seems, that the bug is only present with the current build 6.0.1996 of AtmelStudio6, with the previous build 6.0.1882 there is no problem with the programming. I will post this message on mikrocontroller.net too.

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

Hallo TravelRec

Ok, thank for your information. I work now with AVRDUDE and ATMEL Studio6 SP2 Build 1996. I hope, Atmel make an update until February before the "embedded word2013" in germany.

best greeting Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo

ATMEL Studio 6.1 has the same problem with usb-driver for avrisp mk2. I have completely uninstalled studio6.0 and usb-driver. thereafter installed full new studio6.1 with driver. When i starting a new project in studio6.1 and i want programming with my avrisp mk2 its comming a usb-error!

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hi Rolf,

Can you please check that the firmware version of your AVRISP-MKII is up to date? You can ensure it's up to date inside Atmel Studio 6.1 by clicking "View->Available AVR Tools", then right-clicking your AVRISP-MKII and selecting "Upgrade".

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

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

Hallo

The problem is solved. I have uninstalled Studio6.1 and ATMEL USB-Driver and reboot my PC. Therafther installed Studio6.1 again and now programming my avrisp mk2 is ok.

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hallo abcminiuser

Thanks for your tips. Afther installed studio6.1 i did an update for avrisp mk2.

Greetings from germany Rolf

Windows 10 Home 64Bit, ASUS M4A89GTD-PRO/USB3, AMD Phenom II X6 1055T, Ram 2x 4GB, SSD Samsung EVO840 250GB, SATA HD 2.0TB, NVIDIA GeForce GTX 750

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

Hello,

I also have a problem with the avrispmk2 and 6.0.1996. With avrone my atprogram bat file works fine with avrispmk2 not, both ofcourse with PDI interface.
I had hope trhat 6.1 should solve this but as you Rolf mentioned it is not.

Her is my batfile

C:\Users\Leif\SOFTWARE\APP\Programing>atprogram -t avrispmk2 -i pdi -d atxmega256a3 program -c --verify -fl -f "xboot_2_002.hex"

Programming and verification completed successfully.

C:\Users\Leif\SOFTWARE\APP\Programing>atprogram -t avrispmk2 -i pdi -d atxmega256a3 program --verify -fl -f "Tracker_1201.hex"
Verification of prog FAILED. Expected 58, was FF (at address 0x11000).
An error occured executing a command (program):
Verification of FAILED

C:\Users\Leif\SOFTWARE\APP\Programing>atprogram -t avrispmk2 -i pdi -d atxmega256a3 program --verify -ee -f "Tracker_1201_factory
_default_eep.hex"
Programming and verification completed successfully.

C:\Users\Leif\SOFTWARE\APP\Programing>atprogram -t avrispmk2 -i pdi -d atxmega256a3 write -fs --values ff88bf00f3ea
Write completed successfully.

C:\Users\Leif\SOFTWARE\APP\Programing>pause
Trykk en tast for å fortsette...

Any suggestions?

Br Leif G

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

opps, i did not see the latest post, well then I will try 6.1.

Br Leif G

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

It worked in my setup to puh,
Thanks,

Br Leif G