avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avrdude-dev] [patch #8435] Implementing mEDBG CMSIS-DAP protocol


From: Rainer Müller
Subject: [avrdude-dev] [patch #8435] Implementing mEDBG CMSIS-DAP protocol
Date: Sun, 13 Apr 2014 23:05:06 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:28.0) Gecko/20100101 Firefox/28.0

URL:
  <http://savannah.nongnu.org/patch/?8435>

                 Summary: Implementing mEDBG CMSIS-DAP protocol
                 Project: AVR Downloader/UploaDEr
            Submitted by: raimue
            Submitted on: Sun 13 Apr 2014 11:05:04 PM GMT
                Category: None
                Priority: 5 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

The AVR Xplained Mini <http://www.atmel.com/tools/mega168-xmini.aspx>
implements the mEDBG CMSIS-DAP protocol, which is similar to the EDBG protocol
in the JTAGICE3, but not yet compatible with the current implementation. As
far as I know, the board cannot not yet be ordered from Atmel as time of this
writing, but I got one as a free giveaway at Embedded World this year.

I am attaching the listing from lsusb for the board, which has the
vendor/product ID 03eb:2145. The most important difference in this mEDBG
protocol compared to the EDBG in JTAGICE3 seems to be the packet size. While
the JTAGICE3 uses 512-byte, this device only supports 64-byte packets.

As a proof of concept only, I modified avrdude until I got the board working
up to the point to read the target device signature successfully. Programming
does not work yet, as I ran into packet fragmentation which is not yet
implemented for EDBG. I am attaching a patch with these proof-of-concept
changes. I guess the constant USBDEV_MAX_XFER_3 needs to be
programmer-specific in the future...

The biggest problem was encountered with the usbdev_send() function. In its
current form, it always appends a zero-length packet after each payload.
However, I tracked it down that exactly this causes problems with the Xplained
Mini. When I analyzed the USB communication in wireshark, the zero-length
packet seems to trigger another reply from the programmer which is unexpected.
So I modified the code not to do this anymore.

At least I tested that applying the change in usbdev_send() alone still works
with a JTAGICE3 with firmware 3.18 and also an AVRISP mkII with firmware 1.17.
Maybe anyone with more knowledge can comment how this should be handled.



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Sun 13 Apr 2014 11:05:04 PM GMT  Name: lsusb-xplained-mini.txt  Size:
5kB   By: raimue

<http://savannah.nongnu.org/patch/download.php?file_id=31165>
-------------------------------------------------------
Date: Sun 13 Apr 2014 11:05:04 PM GMT  Name: avr-xplained-mini-poc.patch 
Size: 2kB   By: raimue

<http://savannah.nongnu.org/patch/download.php?file_id=31166>

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?8435>

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]