Programming: avrdude and AVR ONE!

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

Hi!
I would like to know if it's possible to use avrdude in Windows to program with an AVR ONE!. The target device is an AVR 8-bit (ex: m324p, m128, etc).
Does anyone know about it or where can I get such information?

Thanks!

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

Why wouldn't you use the Atmel supplied command line tool?

(or if you want interactive operation, AVR Studio)

C:\Program Files\Atmel\AVR Tools\AVRONE>avrone -?
avrone.exe v1.1.1 Copyright (C) Atmel Corporation 2008-2009
Usage: avrone.exe [commands] [options]
Commands:
 -h, -?         Print this help.
 -he            Print exit codes.
 -e[c|e|a|b|u]  Chip erase (-e, -ec). Additional XMEGA commands: erase EEPROM
                (-ee), erase BOOT section (-eb), erase APP section (-ea),
                erase user signature (-eu).
 -f  Write high/low fuse bytes (fuse bytes 1/0 on XMEGA devices).
                The LSB of fusebytes will be written to the low fuse byte, and
                the MSB will be written to the high fuse byte.
 -id            Detect interface. If a JTAG daisy chain is detected,
                instructions on how to set the -D option is printed.
 -j         Read JTAG ID string. If an optional ID is specified, the
                program will terminate if the read ID differs.
 -l   Set the lock byte to the specified value.
 -p[a|f|e|b|u]  Program ALL memories (-pa), FLASH (-pf), EEPROM (-pe), both
                FLASH and EEPROM (-pb) or user signature (-pu). Requires input
                files specified with the -ia (ALL), -if (FLASH), -ie (EEPROM)
                and/or -iu (user signature) options.
 -q             Read all fuse bytes.
 -r[f|e|b|u|p]  Read FLASH (-rf), EEPROM (-re), both (-rb) or user signature
                (-ru) memories. Requires output files specified with the -of
                (FLASH), -oe (EEPROM), -ou (user signature) and/or -op
                (production signature) options.
 -s             Read signature bytes.
 -t             Run emulator self test.
 -u[b|a|e]      Read CRC of BOOT section (-ub), APP section (-ua), or the whole
                flash (-ue).
 -v[a|f|e|b|u]  Verify ALL memories (-va), FLASH (-vf), EEPROM (-ve), both
                FLASH and EEPROM (-vb) or user signature (-vu). Requires input
                files specified with the -ia (ALL), -if (FLASH), -ie (EEPROM)
                and/or -iu (user signature) options.
 -y             Read lock byte.
 -C[b|a|e] 
                Verify CRC of BOOT section (-Cb), APP section (-Ca), or the
                whole flash (-Ce). If  is not supplied, it will be
                calculated from the input file (specified with -if or -ia).
 -E   Write extended fuse byte (fuse byte 2 on XMEGA devices).
 -F  Verify high/low fuse bytes. The LSB of fusebytes will be
                compared to the low fuse byte, and the MSB will be compared
                to the high fuse byte.
 -L   Verify the lock byte.
 -G   Verify the extended fuse byte against the given value.
 -O 
Read oscillator calibration byte. Address is location of byte as specified in the device's data sheet. -S[f|e]
Write oscillator calibration byte read with -O or -Z to given location in FLASH (-Sf) or EEPROM (-Se). -W Disable debugWIRE interface, enabling ISP mode. Only available for debugWIRE devices. -XE Write XMEGA fuse bytes 4 and 5. The LSB of fusebytes will be written to byte 4, and the MSB will be written to byte 5. -XV Verify XMEGA fuse bytes 4 and 5. The LSB of fusebytes will be compared to byte 4, and the MSB will be compared to byte 5. -Y Perform the oscillator calibration sequence. See appnote AVR053 for more information. -Z
Load value from address in EEPROM prior to erasing the device. This value can be written to FLASH or EEPROM again with the -S[f|e] command. Options: -ae , Specify address range for reading EEPROM memory. Default is entire memory. -af , Specify address range for reading FLASH memory. Default is entire memory. -c Specify serial number of emulator to connect to. -d [required] Specify the type of device. -ia Specify input file (ELF) for programming ALL memories. -ie Specify input file for programming EEPROM memory. -if Specify input file for programming FLASH memory. -iu Specify input file for programming user signature. -m[i|j|p] Choose programming mode: ISP (-mi), JTAG (-mj) (default) or PDI (-mp). -oe Specify output file for reading EEPROM memory. -of Specify output file for reading FLASH memory. -ou Specify output file for reading user signature. -op Specify output file for reading production signature. -z No progress indicator. Useful when redirecting output to file. -D Set daisy chain settings. Only available in JTAG mode. -D Set the device's position in the daisy chain. Daisy chain settings will be configured automatically. Only available in JTAG mode. -I Specify ISP frequency (Hz). Only available for ISP mode. -J Specify device speed (Hz). Only available for JTAG and PDI mode. -R Apply external reset while programming. Only available in JTAG mode. Example usage: avrone.exe -d ATxmega128a1 -e -pf -if c:\tmp\test.hex

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

Thanks Clawson,
That's an option, but I am using the libusb-win32 drivers, which are not compatible with Jungo drivers, that are the ones used by AVRStudio and avrone command line utility, right?

Even if it's possible, I'd like to use avrdude, since I might need to use it in linux. Is it possible to use avrdude with avrone?

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

> Is it possible to use avrdude with avrone?

So far not. I didn't see a publically available protocol description,
nor would there have been someone dropping me one onto the doorstep
so I could actually try using it. ;-)

If you install the "filter" driver from the libusb-win32 project,
you can use the Jungo drivers natively, and still use AVRDUDE on top
of it for anything else but the AVRONE.

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Thanks for the info, Joerg!
Now I understand it.

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

Quote:

So far not. I didn't see a publically available protocol description,
nor would there have been someone dropping me one onto the doorstep
so I could actually try using it. ;-)

I thought I'd try to help out today with this, seeing as I'm not charitable enough to send my AVR ONE! to Joerg ;).

I ran it through a sniffing application (USBSnoop) and did a few tests. For some reason however, the AVR ONE! and the host driver seems to send out thousands of empty BULK packets every second. I don't think this is by design - and if it is, it's a crappy design since both parties can just take a NAK to signal no data, and not have to waste the USB bandwidth. I've lent out my JTAG-MKII, or I would have compared it with that.

This makes the logs hard to go through, but so far it looks like it exactly follows the published JTAG-MKII protocol.

- Dean :twisted:

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

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

Well, Dean, as you've got one, maybe you could try whether you can
hack together a patch that treats it just as another incarnation of
the JTAG ICE mkII? If more hackery is required, I certainly trust you
enough to also grant you SVN commit access for AVRDUDE if you like
(but please don't forget updating the documentation files then).

Jörg Wunsch

Please don't send me PMs, use email if you want to approach me personally.

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

Joerg,

Just tried that, and it didn't work - the AVR ONE! ignored the signon command. I won't be deterred however - most likely it needs a special initialization command to load up the correct binary into the FPGA before it will listen to JTAG commands. I'll have another go tomorrow and see if I can figure out how to get it working.

- Dean :twisted:

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

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

Damn. Well, the message format is *similar* to the JTAG-MKII (except it appears to have a 4-byte length, plus no checksum, which is probably due to the lack of a serial channel) but the commands appear to be different.

Here's the log of me connecting to the programmer (all standard enumeration stuff removed) and reading the signature of my USB1287 via JTAG:

1B   Frame Start
XX   Sequence Number LSB
XX   Sequence Number MSB
XX   Payload Length LSB
XX   Payload Length 
XX   Payload Length 
XX   Payload Length MSB
0E   Token
??   DATA
0D   Frame End

=========== SIGN ON ===========
H>D:  1b 00 00 01 00 00 00 0e 01 0d
D>H:  1b 00 00 32 00 00 00 0e 81 02 00 00 0f 04 10 00 74 6d 65 67 61 00 00 00 00 00 00 00 00 00 00 00 02 00 00 00 00 00 00 00 00 03 01 00 00 00 0b eb cb 43 41 56 52 4f 4e 45 21 00 0d 0d

H>D:  1b 01 00 01 00 00 00 0e 52 0d
D>H:  1b 01 00 43 00 00 00 0e 91 61 76 72 33 32 00 00 00 00 00 00 00 00 00 00 00 ec 0b 04 00 00 04 78 6d 65 67 61 00 00 00 00 00 00 00 00 00 00 00 e7 fa 03 00 00 03 74 6d 65 67 61 00 00 00 00 00 00 00 00 00 00 00 8d 15 04 00 00 02 0d

H>D:  1b 02 00 03 00 00 00 0e 03 00 14 0d
D>H:  1b 02 00 02 00 00 00 0e 82 08 0d 0d
      
=========== +++++++ ===========

======= READ SIG (JTAG) =======
H>D:  1b 03 00 02 00 00 00 0e 06 00 0d
D>H:  1b 03 00 01 00 00 00 0e 80 0d

H>D:  1b 04 00 08 00 00 00 0e 02 02 03 04 3f 20 78 09 0d
D>H:  1b 04 00 01 00 00 00 0e 80 0d

H>D:  1b 05 00 23 00 00 00 0e 02 09 00 1f 00 01 00 00 02 00 00 00 00 00 00 fe 00 00 00 01 00 10 08 03 00 00 00 00 31 22 21 1f 20 57 46 0d
D>H:  1b 05 00 01 00 00 00 0e 80 0d

H>D:  1b 06 00 0c 00 00 00 0e 02 02 10 08 00 00 00 00 00 00 00 00 0d
D>H:  1b 06 00 01 00 00 00 0e 80 0d

H>D:  1b 07 00 02 00 00 00 0e 06 07 0d
D>H:  1b 07 00 01 00 00 00 0e 80 0d

H>D:  1b 08 00 03 00 00 00 0e 03 00 00 0d
D>H:  1b 08 00 03 00 00 00 0e 82 00 0d 0d

H>D:  1b 09 00 01 00 00 00 0e 0e 0d
D>H:  1b 09 00 05 00 00 00 0e 86 3f 29 78 09 0d

H>D:  1b 0a 00 01 00 00 00 0e 20 0d
D>H:  1b 0a 00 01 00 00 00 0e 80 0d

H>D:  1b 0b 00 0b 00 00 00 0e 24 b4 03 00 00 00 00 00 00 00 00 0d
D>H:  1b 0b 00 05 00 00 00 0e 83 1e 97 82 80 0d

H>D:  1b 0c 00 01 00 00 00 0e 21 0d
D>H:  1b 0c 00 01 00 00 00 0e 80 0d
======= +++++++++++++++ =======

Trying to decode the commands from the JTAG-MKII protocol document yields invalid commands and garbage. Looks like the command set is different for the AVR ONE.

- Dean :twisted:

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