[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

View: New views
16 Messages — Rating Filter:   Alert me  

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


URL:
  <http://savannah.nongnu.org/bugs/?27254>

                 Summary: Cannot program ATXMega with AVRDUDE using AVR911
AVROSP mode
                 Project: AVR Downloader/UploaDEr
            Submitted by: priyend
            Submitted on: Fri 14 Aug 2009 21:45:29 GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
         Originator Name: Priyend
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Hi.

I am able to program my ATXMega128A1 using the AVROSP command line programmer
tool from Atmel but cannot program the same device using the AVRDUDE
programmer.

I am using ver 5.6 of AVRDUDE.

Erasing the chip using AVRDUDE works properly.

It seems that AVRDUDE is sending the incorrect number of bytes for a 512
block size from the log attached.

Best regards
Priyend



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Fri 14 Aug 2009 21:45:29 GMT  Name: log.txt  Size: 11kB   By: priyend

<http://savannah.nongnu.org/bugs/download.php?file_id=18571>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #1, bug #27254 (project avrdude):

Hi,

the number of transmitted bytes is ok, avrdude sends:
B [42] . [02].[00]              F [46]  ; which means
[B]lock [02][00]=0x0200 Bytes  [F] = Flash Memory

the number of bytes transferred after this is 512
(starts with 0x0c, last Byte is 0xbf (whould you please check with the
original hexfile?)

So the communication seems OK so far and avrdude is waiting for the
response.

Are you able to trace the real traffic on com8? Portmon or "serial port
Monitor" available?

HTH,
Klaus



    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #2, bug #27254 (project avrdude):

another Question,

which Baudrate did you use for the Test with AVROSP? also 115200?

May be your USB-serial Adapter has not enough buffer for 115200 and 512
Bytes.

Klaus


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #3, bug #27254 (project avrdude):

Hi Klaus

Many thanks for the reply.
Sorry for my late response.

1. I am not always using a USB serial adapter, but the built in COM port on
my desktop motherboard (COM1) does the same thing. It has more than enough
buffering for 115200.
2. I am using the AVROSP at 115200 baudrate and it works perfectly fine.
3. The bytes are correct, it start with 0x0c and does end with 0xbf after 512
bytes.

Do you think that AVRDUDE's timing might be a problem, it may be waiting for
a response and the micro might have already sent it through but AVRDUDE may
have missed the response?

I have attached the flash file (hex and bin versions) I am using.

Best regards
Priyend

(file #18605, file #18606)
    _______________________________________________________

Additional Item Attachment:

File name: flash.hex                      Size:16 KB
File name: FLASH.BIN                      Size:5 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #4, bug #27254 (project avrdude):

Hi Klaus

I did a test and reduced the baud rate to 57600bps and AVRDUDE now works
without problems.
When I set it back to 115200bps, then I get an error.

It seems that AVRDUDE can't keep up with processing at 115200 bps.

Best regards
Priyend

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #5, bug #27254 (project avrdude):

Hardly an AVRDUDE thing, rather of your OS and/or the driver
involved.

Note that AVRDUDE has always been using 115200 Bd to talk to
an STK500 without any issues (this baud rate is hardwired
into the STK500 firmware).

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #6, bug #27254 (project avrdude):

Well then I am very confused.

If it is my hardware or o/s then why does AVROSP work without problems but
AVRDUDE doesn't?

I would have expected both tools to fail because it the problem is beyond
their control.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #7, bug #27254 (project avrdude):

Hi All

Well I "spoke" too soon.
The AVRDUDE tool is also unstable at 57600 bps.
It works at that baud rate about 80% of the time.

Best regards
Priyend

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #8, bug #27254 (project avrdude):

Hi Priyend,

I just "ported" the Bootloader to a Mega16 (no Xmega so far) and "simulated"
the programming. (throwing away the read bytes instead of writing to flash).

Everything works as expected with V24 direct connect (com1, Motherboard) and
with a USB(2) to serial adapter at 115200 baud. I did several tests with no
problems.

So one thing I could think is a "loose connection", which sometimes occours,
just when testing avrdude. I know, sounds unlikely, but it sounds more
unlikely to have a general avrdude transmission problem.

I also used avrdude 5.6 see log attached.
Verification failed, as I did not write anything in real.

At the End is the first part transmitting of your testfile.

Have you tried to slower down to 19200 for example to verify if the problem
occours?

HTH,
Klaus





(file #18610)
    _______________________________________________________

Additional Item Attachment:

File name: avrdude-log.txt                Size:11 KB


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #9, bug #27254 (project avrdude):

again me,

I checked avrdude together with a high CPU load (running cpuburn with 100%
CPU utilisation) I could see drastically slowing down the terminal output
(avrdude -v -v -v -v) but did not loose synchronisation. So the load of the
CPU seems not to have impact.

Cu,
Klaus


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #10, bug #27254 (project avrdude):

Hi Klaus

I will try different clock speeds and see what happens.

When I drop to below 57600bps, then all works fine with AVRDUDE.
At 57600bps problems start and I get failures around 80% of the time.
At 115200 no programming can be done.
The CPU clock is 2MHz. I will try 32MHz and see if there is a difference.

One thing to note is that I am using the App note AVR1605 which is supposed
to be the same as AVR911 but ported to work for the XMega. I wonder if there
were problems with the porting from AVR911 to AVR1605. I will check it out and
provide feedback as well.

Best regards
Priyend

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #11, bug #27254 (project avrdude):

Hi Priyend,

AVR1065 was the software that I used for my tests, but I did the Baudrate
selection by my own (and used a ATMega16 instead) with a baudrate chrystal
(7,3728 MHz). And sure, this is the right bootloader software for avr911.

This Baudrate calc:
http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=993


shows the different Register settings and the resulting errors for the
selected baudrate and chrystal. May be a good idea to double check with your
configuration.

Good luck,
Klaus


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

Re: [bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Bob Paddock-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> This Baudrate calc:
> http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=993

In Atmel Application Note 1307 there is an Excel file showing the
XMega baud rate settings:

http://www.atmel.com/dyn/resources/prod_documents/AVR1307.zip

Baudrate_Calaculations.xls


_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

Re: [bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by www.mikrocontroller-projekte.de :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Bob,

thanks for the hint, but unfortunately this xls from Atmel is not
compatible with openoffice (uses Macros)
The one from avrfreaks works.

Klaus

Bob Paddock schrieb:

>> This Baudrate calc:
>> http://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=993
>>    
>
> In Atmel Application Note 1307 there is an Excel file showing the
> XMega baud rate settings:
>
> http://www.atmel.com/dyn/resources/prod_documents/AVR1307.zip
>
> Baudrate_Calaculations.xls
>
>
> _______________________________________________
> avrdude-dev mailing list
> avrdude-dev@...
> http://lists.nongnu.org/mailman/listinfo/avrdude-dev
>  



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #12, bug #27254 (project avrdude):

Hi Klaus

I have just completed tests with the clock set to 32MHz and to 11059200 Hz
external clock and the same problem occurs; AVROSP works @115200bps while
AVRDUDE does not!

Configuration for baud rate is correct. I am able to transfer 1MByte of data
with no errors.

I wonder if AVRDUDE uses a customised serial port driver of its own and that
may the issue.

By the way I am using M$ Window$ as my OS. I have not tested the issue with
Linux to see if it exists in Linux. I will have to test that at some point
when I get a chance.

Best regards
Priyend

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev

[bug #27254] Cannot program ATXMega with AVRDUDE using AVR911 AVROSP mode

by Mario Castelán Castro-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Follow-up Comment #13, bug #27254 (project avrdude):

> I wonder if AVRDUDE uses a customised serial port
> driver of its own and that may the issue.

AVRDUDE uses whatever your operating system refers to as "com8".
It just opens the port, and uses it, it doesn't have the
slightest idea about the underlying hardware or OS driver.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/bugs/?27254>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/



_______________________________________________
avrdude-dev mailing list
avrdude-dev@...
http://lists.nongnu.org/mailman/listinfo/avrdude-dev