Skip to content

atxmega128A4U entries in avrdude.conf missing 'wiring' protocol stuff #3

Description

@bombasticbob

basically need to patch the 'avrdude.conf' file that's include with the IDE files.

a typical patch might look like this (just for the xmeg128a4u)

--- /usr/local/etc/avrdude.conf	2017-05-10 19:17:33.000000000 -0700
+++ avrdude.conf	2018-03-04 18:46:31.998213000 -0800
@@ -14010,10 +14010,21 @@
 part parent ".xmega"
     id		= "x128a4u";
     desc	= "ATxmega128A4U";
     signature	= 0x1e 0x97 0x46;
     usbpid	= 0x2fde;
+    has_jtag	= yes;
+    has_pdi 	= yes;
+    nvm_base	= 0x01c0;
+
+# needed for wiring aka stk500v2 protocol
+    reset            = dedicated;
+    pgm_enable       = "1 0 1 0  1 1 0 0    0 1 0 1  0 0 1 1",
+                       "x x x x  x x x x    x x x x  x x x x";
+
+    rampz               = 0x3b; # verified in iox128a1u.h
+
 
     memory "eeprom"
         size		= 0x800;
         offset		= 0x8c0000;
         page_size	= 0x20;
@@ -14044,10 +14055,54 @@
     memory "flash"
         size		= 0x22000;
         offset		= 0x800000;
         page_size	= 0x100;
         readsize	= 0x100;
+# needed for wiring aka stk500v2 protocol
+        paged   = yes;  # this appears to affect how it is read/written with stk500v2
+        num_pages   = 544; # 272;
+        blocksize	= 0x100; # #0x200
+        mode      = 0x41;
+        delay     = 10;
+
+        read_lo         = "  0   0   1   0      0   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        read_hi         = "  0   0   1   0      1   0   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7  a6  a5  a4     a3  a2  a1  a0",
+                          "  o   o   o   o      o   o   o   o";
+
+        loadpage_lo     = "  0   1   0   0      0   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        loadpage_hi     = "  0   1   0   0      1   0   0   0",
+                          "  x   x   x   x      x   x   x   x",
+                          "  x  a6  a5  a4     a3  a2  a1  a0",
+                          "  i   i   i   i      i   i   i   i";
+
+        writepage       = "  0   1   0   0      1   1   0   0",
+                          "a15 a14 a13 a12    a11 a10  a9  a8",
+                          " a7   x   x   x      x   x   x   x",
+                          "  x   x   x   x      x   x   x   x";
+
+        load_ext_addr   = "  0   1   0   0      1   1   0   1",
+                          "  0   0   0   0      0   0   0   0",
+                          "  0   0   0   0      0   0   0 a16",
+                          "  0   0   0   0      0   0   0   0";
+    ;
+
+    memory "signature"
+        size		= 3;
+        offset		= 0x1000090;
+# needed for wiring aka stk500v2 protocol
+        read            = "0  0  1  1   0  0  0  0   x  x  x  x   x  x  x  x",
+                          "x  x  x  x   x  x a1 a0   o  o  o  o   o  o  o  o";
     ;
 
     memory "usersig"
         size		= 0x100;
         offset		= 0x8e0400;

Note that the # of pages depends on the NVRAM size and the correct page size. In some cases, the avrdude.conf file may have the wrong read size and/or page size, in which case, it will be necessary to test it on a real CPU.

As an example, the xmega128a1u had 512 byte pages. The xmeag128a4u has 256 byte pages. In all other ways they're pretty much the same. For all supported CPUs this will need testing.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions