diff --git a/src/avr.c b/src/avr.c index 0b173f788..ed0963d0c 100644 --- a/src/avr.c +++ b/src/avr.c @@ -1528,7 +1528,7 @@ memtable_t avr_mem_order[100] = { {"bootrow", MEM_BOOTROW | MEM_USER_TYPE}, {"usersig", MEM_USERROW | MEM_USER_TYPE}, {"userrow", MEM_USERROW | MEM_USER_TYPE}, - {"data", MEM_SRAM}, + {"sram", MEM_SRAM}, {"io", MEM_IO}, {"sib", MEM_SIB | MEM_READONLY}, }; diff --git a/src/avrdude.conf.in b/src/avrdude.conf.in index ad6965fb7..f12273a88 100644 --- a/src/avrdude.conf.in +++ b/src/avrdude.conf.in @@ -3114,6 +3114,11 @@ part # t11 size = 1; ; + memory "sram" + size = 32; + offset = 0x60; + ; + memory "io" size = 64; ; @@ -3226,6 +3231,11 @@ part # t12 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 32; + offset = 0x60; + ; + memory "io" size = 64; ; @@ -3378,6 +3388,11 @@ part # t13 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 64; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -3523,6 +3538,11 @@ part # t15 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 32; + offset = 0x60; + ; + memory "io" size = 64; ; @@ -3725,6 +3745,11 @@ part # 1200 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 32; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -3822,6 +3847,11 @@ part # 4414 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 256; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -3915,6 +3945,11 @@ part # 2313 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 128; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4009,6 +4044,11 @@ part # 2333 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 128; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4108,6 +4148,11 @@ part # 2343 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 128; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4275,6 +4320,11 @@ part # 8515 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 512; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4371,6 +4421,11 @@ part # 8535 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 512; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4416,6 +4471,10 @@ part parent "8535" # 4434 memory "lock" max_write_delay = 20000; ; + + memory "sram" + size = 256; + ; ; #------------------------------------------------------------ @@ -4516,6 +4575,11 @@ part # m103 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 4000; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -4664,6 +4728,11 @@ part # m64 read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -4834,6 +4903,11 @@ part # m128 read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -4998,6 +5072,11 @@ part # c128 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -5140,6 +5219,11 @@ part # c64 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -5282,6 +5366,11 @@ part # c32 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -5424,6 +5513,11 @@ part # m16 read = "0011.1000--000x.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -5598,6 +5692,11 @@ part # m324p read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -5645,6 +5744,10 @@ part parent "m324p" # m164p size = 0x4000; num_pages = 128; ; + + memory "sram" + size = 1024; + ; ; #------------------------------------------------------------ @@ -5919,6 +6022,11 @@ part # m644 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -6144,6 +6252,11 @@ part # m1284 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 0x4000; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -6334,6 +6447,11 @@ part # m162 read = "0011.1000--00xx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -6459,6 +6577,11 @@ part # m163 size = 1; read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + + memory "sram" + size = 1024; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -6607,6 +6730,11 @@ part # m169 size = 1; read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + + memory "sram" + size = 1024; + offset = 0x100; + ; ; #------------------------------------------------------------ @@ -6876,6 +7004,11 @@ part # m329 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -7152,6 +7285,11 @@ part # m649 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -7373,6 +7511,11 @@ part # m32 read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -7483,6 +7626,11 @@ part # m161 size = 3; read = "0011.0000--xxxx.xxxx--xxxx.xxaa--oooo.oooo"; ; + + memory "sram" + size = 1024; + offset = 0x60; + ; ; #------------------------------------------------------------ @@ -7640,6 +7788,11 @@ part # m8 read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -7795,6 +7948,11 @@ part # m8515 read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -7928,6 +8086,11 @@ part # m8535 read = "0011.1000--00xx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8059,6 +8222,11 @@ part # t26 read = "0011.1000--xxxx.xxxx--0000.00aa--oooo.oooo"; ; + memory "sram" + size = 128; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8206,6 +8374,11 @@ part # t261 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 128; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8379,6 +8552,11 @@ part # t461 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 256; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8548,6 +8726,11 @@ part # t861 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8639,6 +8822,11 @@ part # t28 size = 1; ; + memory "sram" + size = 32; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -8796,6 +8984,11 @@ part # m48 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -9045,6 +9238,11 @@ part # m88 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -9298,6 +9496,11 @@ part # m168 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -9541,6 +9744,11 @@ part # t828 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -9704,6 +9912,11 @@ part # t87 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -9857,6 +10070,11 @@ part # t167 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -10008,6 +10226,11 @@ part # t48 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 256; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -10159,6 +10382,11 @@ part # t88 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -10309,6 +10537,11 @@ part # m328 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -10516,6 +10749,11 @@ part # m64m1 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -10558,6 +10796,10 @@ part parent "m64m1" # m32m1 loadpage_hi = "0100.1000--0000.0000--00aa.aaaa--iiii.iiii"; writepage = "0100.1100--00aa.aaaa--aa00.0000--xxxx.xxxx"; ; + + memory "sram" + size = 2048; + ; ; #------------------------------------------------------------ @@ -10587,6 +10829,10 @@ part parent "m32m1" # m16m1 read_hi = "0010.1000--000a.aaaa--aaaa.aaaa--oooo.oooo"; writepage = "0100.1100--000a.aaaa--aa00.0000--xxxx.xxxx"; ; + + memory "sram" + size = 1024; + ; ; #------------------------------------------------------------ @@ -11002,6 +11248,11 @@ part # m16hva read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -11159,6 +11410,11 @@ part # m16hvb read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -11205,6 +11461,10 @@ part parent "m16hvb" # m32hvb read_hi = "0010.1000--00aa.aaaa--aaaa.aaaa--oooo.oooo"; writepage = "0100.1100--00aa.aaaa--aa00.0000--xxxx.xxxx"; ; + + memory "sram" + size = 2048; + ; ; #------------------------------------------------------------ @@ -11349,6 +11609,11 @@ part # m64hve2 read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -11528,6 +11793,11 @@ part # t2313 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 128; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -11704,6 +11974,11 @@ part # t4313 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 256; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -11849,6 +12124,11 @@ part # pwm1 read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -11994,6 +12274,11 @@ part # pwm2 size = 1; read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + + memory "sram" + size = 512; + offset = 0x100; + ; ; #------------------------------------------------------------ @@ -12219,6 +12504,11 @@ part # pwm161 read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -12251,6 +12541,10 @@ part parent "pwm161" # pwm81 loadpage_hi = "0100.1000--0000.0000--000a.aaaa--iiii.iiii"; writepage = "0100.1100--0000.aaaa--aaa0.0000--xxxx.xxxx"; ; + + memory "sram" + size = 256; + ; ; #------------------------------------------------------------ @@ -12279,6 +12573,10 @@ part parent "pwm3b" # pwm316 loadpage_hi = "0100.1000--00xx.xxxx--xxaa.aaaa--iiii.iiii"; writepage = "0100.1100--00aa.aaaa--aaxx.xxxx--xxxx.xxxx"; ; + + memory "sram" + size = 1024; + ; ; #------------------------------------------------------------ @@ -12476,6 +12774,11 @@ part # t25 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 128; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -12641,6 +12944,11 @@ part # t45 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 256; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -12803,6 +13111,11 @@ part # t85 read = "0011.1000--000x.xxxx--0000.000a--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -12950,6 +13263,11 @@ part # m640 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 8192; + offset = 0x200; + ; + memory "io" size = 480; offset = 0x20; @@ -13096,6 +13414,11 @@ part # m1280 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 8192; + offset = 0x200; + ; + memory "io" size = 480; offset = 0x20; @@ -13266,6 +13589,11 @@ part # m2560 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 8192; + offset = 0x200; + ; + memory "io" size = 480; offset = 0x20; @@ -13355,6 +13683,10 @@ part parent "m2561" # m128rfa1 min_write_delay = 4500; max_write_delay = 4500; ; + + memory "sram" + size = 0x4000; + ; ; #------------------------------------------------------------ @@ -13413,6 +13745,10 @@ part parent "m128rfa1" # m256rfr2 blocksize = 256; readsize = 256; ; + + memory "sram" + size = 0x8000; + ; ; #------------------------------------------------------------ @@ -13440,6 +13776,10 @@ part parent "m256rfr2" # m128rfr2 num_pages = 512; load_ext_addr = NULL; ; + + memory "sram" + size = 0x4000; + ; ; #------------------------------------------------------------ @@ -13471,6 +13811,10 @@ part parent "m128rfr2" # m64rfr2 read_hi = "0010.1000--0aaa.aaaa--aaaa.aaaa--oooo.oooo"; writepage = "0100.1100--0aaa.aaaa--axxx.xxxx--xxxx.xxxx"; ; + + memory "sram" + size = 8192; + ; ; #------------------------------------------------------------ @@ -13671,6 +14015,11 @@ part # t24 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 128; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -13856,6 +14205,11 @@ part # t44 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 256; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -14040,6 +14394,11 @@ part # t84 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x60; + ; + memory "io" size = 64; offset = 0x20; @@ -14111,6 +14470,10 @@ part parent "t44" # t441 write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; ; + memory "sram" + offset = 0x100; + ; + memory "io" size = 224; ; @@ -14157,6 +14520,10 @@ part parent "t84" # t841 write = "1010.1100--1010.0100--xxxx.xxxx--iiii.iiii"; ; + memory "sram" + offset = 0x100; + ; + memory "io" size = 224; ; @@ -14304,7 +14671,12 @@ part # t43u read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; - memory "io" + memory "sram" + size = 256; + offset = 0x60; + ; + + memory "io" size = 64; offset = 0x20; ; @@ -14448,6 +14820,11 @@ part # m16u4 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1280; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -14594,6 +14971,11 @@ part # m32u4 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2560; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -14738,6 +15120,11 @@ part # usb646 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -14900,6 +15287,11 @@ part # usb1286 read = "0011.1000--xxxx.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 8192; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15065,6 +15457,11 @@ part # usb162 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15211,6 +15608,11 @@ part # usb82 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15358,6 +15760,11 @@ part # m32u2 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15505,6 +15912,11 @@ part # m16u2 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15652,6 +16064,11 @@ part # m8u2 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 512; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -15803,6 +16220,11 @@ part # m165p read = "0011.1000--0000.0000--xxxx.xxxx--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -16007,6 +16429,11 @@ part # m325 read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -16212,6 +16639,11 @@ part # m645 read = "0011.1000--0000.0000--0000.0000--oooo.oooo"; ; + memory "sram" + size = 4096; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -16430,9 +16862,8 @@ part # .xmega offset = 0x1000090; ; - memory "data" - # SRAM, only used to supply the offset - offset = 0x1000000; + memory "sram" + offset = 0x2000; ; memory "io" @@ -16552,6 +16983,10 @@ part parent ".xmega-a" # x16a4u offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 2048; + ; ; #------------------------------------------------------------ @@ -16713,6 +17148,10 @@ part parent ".xmega-a" # x32a4u offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 4096; + ; ; #------------------------------------------------------------ @@ -16875,6 +17314,10 @@ part parent ".xmega-a" # x64a4u offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 4096; + ; ; #------------------------------------------------------------ @@ -17286,6 +17729,10 @@ part parent ".xmega" # x128c3 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 8192; + ; ; #------------------------------------------------------------ @@ -17548,6 +17995,10 @@ part parent ".xmega" # x128a4 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 8192; + ; ; #------------------------------------------------------------ @@ -17622,6 +18073,10 @@ part parent ".xmega-a" # x128a4u offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 8192; + ; ; #------------------------------------------------------------ @@ -17700,6 +18155,10 @@ part parent ".xmega" # x128b1 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 8192; + ; ; #------------------------------------------------------------ @@ -17788,6 +18247,10 @@ part parent ".xmega" # x192c3 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 0x4000; + ; ; #------------------------------------------------------------ @@ -18020,6 +18483,10 @@ part parent ".xmega" # x256c3 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 0x4000; + ; ; #------------------------------------------------------------ @@ -18363,6 +18830,10 @@ part parent ".xmega" # x384c3 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 0x8000; + ; ; #------------------------------------------------------------ @@ -18457,6 +18928,10 @@ part parent ".xmega-e" # x8e5 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 1024; + ; ; #------------------------------------------------------------ @@ -18533,6 +19008,10 @@ part parent ".xmega-e" # x16e5 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 2048; + ; ; #------------------------------------------------------------ @@ -18609,6 +19088,10 @@ part parent ".xmega-e" # x32e5 offset = 0x8e0400; readsize = 256; ; + + memory "sram" + size = 4096; + ; ; #------------------------------------------------------------ @@ -18795,6 +19278,11 @@ part # t1634 read = "0011.1000--000x.xxxx--0000.0000--oooo.oooo"; ; + memory "sram" + size = 1024; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -18853,6 +19341,11 @@ part # .reduced_core_tiny page_size = 16; offset = 0x3f80; ; + + memory "sram" + size = 32; + offset = 0x40; + ; ; #------------------------------------------------------------ @@ -18975,6 +19468,10 @@ part parent ".reduced_core_tiny" # t20 n_word_writes = 2; ; + memory "sram" + size = 128; + ; + memory "io" size = 64; ; @@ -19011,6 +19508,10 @@ part parent ".reduced_core_tiny" # t40 n_word_writes = 4; ; + memory "sram" + size = 256; + ; + memory "io" size = 64; ; @@ -19181,6 +19682,11 @@ part # m406 size = 3; ; + memory "sram" + size = 2048; + offset = 0x100; + ; + memory "io" size = 224; offset = 0x20; @@ -19354,11 +19860,6 @@ part # .avr8x readsize = 1; ; - memory "data" - # SRAM, only used to supply the offset - offset = 0x1000000; - ; - memory "io" size = 4352; readsize = 1; @@ -19464,6 +19965,11 @@ part parent ".avr8x_tiny" # t202 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 128; + offset = 0x3f80; + ; ; #------------------------------------------------------------ @@ -19510,6 +20016,11 @@ part parent ".avr8x_tiny" # t204 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 128; + offset = 0x3f80; + ; ; #------------------------------------------------------------ @@ -19556,6 +20067,11 @@ part parent ".avr8x_tiny" # t402 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -19602,6 +20118,11 @@ part parent ".avr8x_tiny" # t404 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -19650,6 +20171,11 @@ part parent ".avr8x_tiny" # t406 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -19685,6 +20211,11 @@ part parent ".avr8x_tiny" # t804 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -19724,6 +20255,11 @@ part parent ".avr8x_tiny" # t806 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -19760,6 +20296,11 @@ part parent ".avr8x_tiny" # t807 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -19795,6 +20336,11 @@ part parent ".avr8x_tiny" # t1604 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -19834,6 +20380,11 @@ part parent ".avr8x_tiny" # t1606 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -19870,6 +20421,11 @@ part parent ".avr8x_tiny" # t1607 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -19916,6 +20472,11 @@ part parent ".avr8x_tiny" # t212 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 128; + offset = 0x3f80; + ; ; #------------------------------------------------------------ @@ -19962,6 +20523,11 @@ part parent ".avr8x_tiny" # t214 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 128; + offset = 0x3f80; + ; ; #------------------------------------------------------------ @@ -20008,6 +20574,11 @@ part parent ".avr8x_tiny" # t412 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -20054,6 +20625,11 @@ part parent ".avr8x_tiny" # t414 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -20102,6 +20678,11 @@ part parent ".avr8x_tiny" # t416 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -20166,6 +20747,11 @@ part parent ".avr8x_tiny" # t417 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 256; + offset = 0x3f00; + ; ; #------------------------------------------------------------ @@ -20213,6 +20799,11 @@ part parent ".avr8x_tiny" # t814 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20264,6 +20855,11 @@ part parent ".avr8x_tiny" # t816 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20311,6 +20907,11 @@ part parent ".avr8x_tiny" # t817 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20357,6 +20958,11 @@ part parent ".avr8x_tiny" # t1614 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20405,6 +21011,11 @@ part parent ".avr8x_tiny" # t1616 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20451,6 +21062,11 @@ part parent ".avr8x_tiny" # t1617 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20502,6 +21118,11 @@ part parent ".avr8x_tiny" # t3216 size = 64; page_size = 64; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20562,6 +21183,11 @@ part parent ".avr8x_tiny" # t424 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20610,6 +21236,11 @@ part parent ".avr8x_tiny" # t426 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20650,6 +21281,11 @@ part parent ".avr8x_tiny" # t427 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 512; + offset = 0x3e00; + ; ; #------------------------------------------------------------ @@ -20694,6 +21330,11 @@ part parent ".avr8x_tiny" # t824 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -20742,6 +21383,11 @@ part parent ".avr8x_tiny" # t826 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -20782,6 +21428,11 @@ part parent ".avr8x_tiny" # t827 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -20826,6 +21477,11 @@ part parent ".avr8x_tiny" # t1624 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20874,6 +21530,11 @@ part parent ".avr8x_tiny" # t1626 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20914,6 +21575,11 @@ part parent ".avr8x_tiny" # t1627 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -20958,6 +21624,11 @@ part parent ".avr8x_tiny" # t3224 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 3072; + offset = 0x3400; + ; ; #------------------------------------------------------------ @@ -21006,6 +21677,11 @@ part parent ".avr8x_tiny" # t3226 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 3072; + offset = 0x3400; + ; ; #------------------------------------------------------------ @@ -21046,6 +21722,11 @@ part parent ".avr8x_tiny" # t3227 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 3072; + offset = 0x3400; + ; ; #------------------------------------------------------------ @@ -21093,6 +21774,11 @@ part parent ".avr8x_tiny" # m808 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -21136,6 +21822,11 @@ part parent ".avr8x_tiny" # m809 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 1024; + offset = 0x3c00; + ; ; #------------------------------------------------------------ @@ -21183,6 +21874,11 @@ part parent ".avr8x_tiny" # m1608 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -21226,6 +21922,11 @@ part parent ".avr8x_tiny" # m1609 memory "lock" initval = 0xc5; ; + + memory "sram" + size = 2048; + offset = 0x3800; + ; ; #------------------------------------------------------------ @@ -21275,6 +21976,11 @@ part parent ".avr8x_mega" # m3208 page_size = 128; readsize = 128; ; + + memory "sram" + size = 4096; + offset = 0x3000; + ; ; #------------------------------------------------------------ @@ -21320,6 +22026,11 @@ part parent ".avr8x_mega" # m3209 page_size = 128; readsize = 128; ; + + memory "sram" + size = 4096; + offset = 0x3000; + ; ; #------------------------------------------------------------ @@ -21369,6 +22080,11 @@ part parent ".avr8x_mega" # m4808 page_size = 128; readsize = 128; ; + + memory "sram" + size = 6144; + offset = 0x2800; + ; ; #------------------------------------------------------------ @@ -21415,6 +22131,11 @@ part parent ".avr8x_mega" # m4809 page_size = 128; readsize = 128; ; + + memory "sram" + size = 6144; + offset = 0x2800; + ; ; #------------------------------------------------------------ @@ -21574,11 +22295,6 @@ part # .avrdx alias "userrow"; ; - memory "data" - # SRAM, only used to supply the offset - offset = 0x1000000; - ; - memory "io" size = 4160; readsize = 1; @@ -21635,6 +22351,11 @@ part parent ".avrdx" # avr32da28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -21680,6 +22401,11 @@ part parent ".avrdx" # avr32da32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -21725,6 +22451,11 @@ part parent ".avrdx" # avr32da48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -21772,6 +22503,11 @@ part parent ".avrdx" # avr64da28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -21817,6 +22553,11 @@ part parent ".avrdx" # avr64da32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -21862,6 +22603,11 @@ part parent ".avrdx" # avr64da48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -21907,6 +22653,11 @@ part parent ".avrdx" # avr64da64 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -21954,6 +22705,11 @@ part parent ".avrdx" # avr128da28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -21999,6 +22755,11 @@ part parent ".avrdx" # avr128da32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22044,6 +22805,11 @@ part parent ".avrdx" # avr128da48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22089,6 +22855,11 @@ part parent ".avrdx" # avr128da64 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22130,6 +22901,11 @@ part parent ".avrdx" # avr32db28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22169,6 +22945,11 @@ part parent ".avrdx" # avr32db32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22208,6 +22989,11 @@ part parent ".avrdx" # avr32db48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22249,6 +23035,11 @@ part parent ".avrdx" # avr64db28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22288,6 +23079,11 @@ part parent ".avrdx" # avr64db32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22327,6 +23123,11 @@ part parent ".avrdx" # avr64db48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22366,6 +23167,11 @@ part parent ".avrdx" # avr64db64 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22407,6 +23213,11 @@ part parent ".avrdx" # avr128db28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22446,6 +23257,11 @@ part parent ".avrdx" # avr128db32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22485,6 +23301,11 @@ part parent ".avrdx" # avr128db48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22524,6 +23345,11 @@ part parent ".avrdx" # avr128db64 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 0x4000; + offset = 0x4000; + ; ; #------------------------------------------------------------ @@ -22562,6 +23388,11 @@ part parent ".avrdx" # avr16dd14 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -22601,6 +23432,11 @@ part parent ".avrdx" # avr16dd20 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -22642,6 +23478,11 @@ part parent ".avrdx" # avr16dd28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -22681,6 +23522,11 @@ part parent ".avrdx" # avr16dd32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -22719,6 +23565,11 @@ part parent ".avrdx" # avr32dd14 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22758,6 +23609,11 @@ part parent ".avrdx" # avr32dd20 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22799,6 +23655,11 @@ part parent ".avrdx" # avr32dd28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22838,6 +23699,11 @@ part parent ".avrdx" # avr32dd32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -22876,6 +23742,11 @@ part parent ".avrdx" # avr64dd14 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22914,6 +23785,11 @@ part parent ".avrdx" # avr64dd20 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22955,6 +23831,11 @@ part parent ".avrdx" # avr64dd28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -22994,6 +23875,11 @@ part parent ".avrdx" # avr64dd32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 8192; + offset = 0x6000; + ; ; #------------------------------------------------------------ @@ -23168,6 +24054,11 @@ part parent ".avrex" # avr16ea28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -23199,6 +24090,11 @@ part parent ".avrex" # avr16ea32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -23230,6 +24126,11 @@ part parent ".avrex" # avr16ea48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ @@ -23261,6 +24162,11 @@ part parent ".avrex" # avr32ea28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -23292,6 +24198,11 @@ part parent ".avrex" # avr32ea32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -23323,6 +24234,11 @@ part parent ".avrex" # avr32ea48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 4096; + offset = 0x7000; + ; ; #------------------------------------------------------------ @@ -23357,6 +24273,11 @@ part parent ".avrex" # avr64ea28 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 6144; + offset = 0x6800; + ; ; #------------------------------------------------------------ @@ -23391,6 +24312,11 @@ part parent ".avrex" # avr64ea32 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 6144; + offset = 0x6800; + ; ; #------------------------------------------------------------ @@ -23425,6 +24351,11 @@ part parent ".avrex" # avr64ea48 memory "lock" initval = 0x5cc5c55c; ; + + memory "sram" + size = 6144; + offset = 0x6800; + ; ; #------------------------------------------------------------ @@ -23495,6 +24426,11 @@ part parent ".avrex" # avr16eb14 memory "userrow" offset = 0x1200; ; + + memory "sram" + size = 2048; + offset = 0x7800; + ; ; #------------------------------------------------------------ diff --git a/src/avrpart.c b/src/avrpart.c index f1cb04122..815f03605 100644 --- a/src/avrpart.c +++ b/src/avrpart.c @@ -512,10 +512,7 @@ AVRMEM *avr_locate_mem_by_type(const AVRPART *p, memtype_t type) { // Return offset of memory data unsigned int avr_data_offset(const AVRPART *p) { - AVRMEM *data = avr_locate_data(p); - if(!data) - pmsg_warning("cannot locate data memory; is avrdude.conf up to date?\n"); - return data? data->offset: 0; + return p->prog_modes & (PM_PDI | PM_UPDI)? 0x1000000: 0; } AVRMEM_ALIAS *avr_find_memalias(const AVRPART *p, const AVRMEM *m_orig) { diff --git a/src/fileio.c b/src/fileio.c index 47f54a8f0..888cf5e45 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -771,8 +771,8 @@ static int elf_mem_limits(const AVRMEM *mem, const AVRPART *p, *lowbound = 0; *highbound = 0x7Fffff; // Max 8 MiB *fileoff = 0; - } else if (mem_is_data(mem)) { // SRAM for XMEGAs - *lowbound = 0x802000; + } else if (mem_is_sram(mem)) { // SRAM + *lowbound = 0x800000 + mem->offset; *highbound = 0x80ffff; *fileoff = 0; } else if (mem_is_eeprom(mem)) { diff --git a/src/jtag3.c b/src/jtag3.c index ee69fb94e..2e41d5682 100644 --- a/src/jtag3.c +++ b/src/jtag3.c @@ -1212,10 +1212,10 @@ static int jtag3_initialize(const PROGRAMMER *pgm, const AVRPART *p) { u32_to_b4(xd.nvm_user_sig_offset, m->offset); } else if (mem_is_sigrow(m)) { u32_to_b4(xd.nvm_prod_sig_offset, m->offset); - } else if (mem_is_data(m)) { - u32_to_b4(xd.nvm_data_offset, m->offset); } } + if(p->prog_modes & (PM_PDI | PM_UPDI)) + u32_to_b4(xd.nvm_data_offset, DATA_OFFSET); if (jtag3_setparm(pgm, SCOPE_AVR, 2, PARM3_DEVICEDESC, (unsigned char *)&xd, sizeof xd) < 0) return -1; diff --git a/src/jtag3_private.h b/src/jtag3_private.h index f5c276d77..44b3b14ee 100644 --- a/src/jtag3_private.h +++ b/src/jtag3_private.h @@ -379,6 +379,7 @@ #define TPI_NVMCMD_ADDRESS 0x33 #define TPI_NVMCSR_ADDRESS 0x32 +#define DATA_OFFSET 0x1000000 #if !defined(JTAG3_PRIVATE_EXPORTED) diff --git a/src/jtagmkII.c b/src/jtagmkII.c index 643149104..bef2c71ce 100644 --- a/src/jtagmkII.c +++ b/src/jtagmkII.c @@ -987,10 +987,10 @@ static void jtagmkII_set_xmega_params(const PROGRAMMER *pgm, const AVRPART *p) { } else if (mem_is_sigrow(m)) { u32_to_b4(sendbuf.dd.nvm_prod_sig_offset, m->offset); pmsg_notice2("prod_sig_offset addr 0x%05x\n", m->offset); - } else if (mem_is_data(m)) { - u32_to_b4(sendbuf.dd.nvm_data_offset, m->offset); } } + if(p->prog_modes & (PM_PDI | PM_UPDI)) + u32_to_b4(sendbuf.dd.nvm_data_offset, DATA_OFFSET); pmsg_notice2("%s() sending set Xmega params command: ", __func__); jtagmkII_send(pgm, (unsigned char *)&sendbuf, sizeof sendbuf); diff --git a/src/jtagmkII_private.h b/src/jtagmkII_private.h index bc91bc7f9..f567ce73b 100644 --- a/src/jtagmkII_private.h +++ b/src/jtagmkII_private.h @@ -321,6 +321,8 @@ #define AVR32_SET4RUNNING 0x0008 //#define AVR32_RESET_COMMON (AVR32_RESET_READ | AVR32_RESET_WRITE | AVR32_RESET_CHIP_ERASE ) +#define DATA_OFFSET 0x1000000 + typedef enum { RTS_MODE_DEFAULT, diff --git a/src/libavrdude.h b/src/libavrdude.h index 4657736d8..2df9ada27 100644 --- a/src/libavrdude.h +++ b/src/libavrdude.h @@ -360,7 +360,7 @@ typedef struct { #define MEM_OSC20ERR (1<<19) // osc20err #define MEM_BOOTROW (1<<20) // bootrow #define MEM_USERROW (1<<21) // userrow usersig -#define MEM_SRAM (1<<22) // data +#define MEM_SRAM (1<<22) // sram #define MEM_IO (1<<23) // io #define MEM_SIB (1<<24) // sib @@ -393,7 +393,7 @@ typedef struct { #define avr_locate_bootrow(p) avr_locate_mem_by_type((p), MEM_BOOTROW) #define avr_locate_usersig(p) avr_locate_mem_by_type((p), MEM_USERROW) #define avr_locate_userrow(p) avr_locate_mem_by_type((p), MEM_USERROW) -#define avr_locate_data(p) avr_locate_mem_by_type((p), MEM_SRAM) +#define avr_locate_sram(p) avr_locate_mem_by_type((p), MEM_SRAM) #define avr_locate_io(p) avr_locate_mem_by_type((p), MEM_IO) #define avr_locate_sib(p) avr_locate_mem_by_type((p), MEM_SIB) @@ -441,7 +441,7 @@ typedef struct { #define mem_is_osc20err(mem) (!!((mem)->type & MEM_OSC20ERR)) #define mem_is_bootrow(mem) (!!((mem)->type & MEM_BOOTROW)) #define mem_is_userrow(mem) (!!((mem)->type & MEM_USERROW)) -#define mem_is_data(mem) (!!((mem)->type & MEM_SRAM)) +#define mem_is_sram(mem) (!!((mem)->type & MEM_SRAM)) #define mem_is_io(mem) (!!((mem)->type & MEM_IO)) #define mem_is_sib(mem) (!!((mem)->type & MEM_SIB))