Blame | Last modification | View Log | SVN | RSS feed
1 .file "flash.c"2 .arch atmega1683 __SREG__ = 0x3f4 __SP_H__ = 0x3e5 __SP_L__ = 0x3d6 __tmp_reg__ = 07 __zero_reg__ = 18 .global __do_copy_data9 .global __do_clear_bss11 .text12 .Ltext0:89 .section .bootloader,"ax",@progbits91 .global flash_flush_buffer93 flash_flush_buffer:1:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** #include <avr/interrupt.h>2:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** #include <avr/boot.h>3:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** #include <avr/pgmspace.h>4:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** #include <avr/wdt.h>5:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** #include <flash.h>6:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****7:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** static uint16_t flash_prev_addr;8:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** static uint8_t flash_buffer_dirty = 0;9:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** static uint8_t* flash_pagebuf;10:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****11:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** void flash_flush_buffer() {95 .LM0:96 /* prologue: frame size=0 */97 /* prologue end (size=0) */12:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint8_t sreg;13:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint16_t word;14:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint8_t i;15:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint16_t* buf = (uint16_t*)flash_pagebuf; // Access buffer on a word basis.99 .LM1:100 0000 4091 0000 lds r20,flash_pagebuf101 0004 5091 0000 lds r21,(flash_pagebuf)+116:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****17:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** if (!flash_buffer_dirty) return; // Nothing to flush.103 .LM2:104 0008 8091 0000 lds r24,flash_buffer_dirty105 000c 8823 tst r24106 000e 09F4 brne .+2107 0010 30C0 rjmp .L12109 .LM3:110 0012 20E0 ldi r18,lo8(0)111 0014 30E0 ldi r19,hi8(0)112 0016 61E0 ldi r22,lo8(1)113 0018 DA01 movw r26,r20114 .L4:18:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****19:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Copy the sram buffer to the temporary page buffer.20:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** for (i = 0; i < SPM_PAGESIZE/2; i++) {21:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** word = buf[i];22:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_fill(i*2, word); // Absolute addressing is not neccessary.116 .LM4:117 001a 8D91 ld r24,X+118 001c 9D91 ld r25,X+119 /* #APP */120 001e 0C01 movw r0, r24121 0020 F901 movw r30, r18122 0022 6093 5700 sts 87, r22123 0026 E895 spm124 0028 1124 clr r1125126 /* #NOAPP */127 002a 2E5F subi r18,lo8(-(2))128 002c 3F4F sbci r19,hi8(-(2))130 .LM5:131 002e 2038 cpi r18,128132 0030 3105 cpc r19,__zero_reg__133 0032 99F7 brne .L423:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }24:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****25:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Disable interrupts.26:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** sreg = SREG;135 .LM6:136 0034 9FB7 in r25,95-0x2027:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** cli();138 .LM7:139 /* #APP */140 0036 F894 cli141 /* #NOAPP */142 .L6:28:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****29:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** eeprom_busy_wait(); // Make sure any eeprom access has finished.144 .LM8:145 0038 F999 sbic 63-0x20,1146 003a FECF rjmp .L630:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****31:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_erase(flash_prev_addr);148 .LM9:149 003c 2091 0000 lds r18,flash_prev_addr150 0040 3091 0000 lds r19,(flash_prev_addr)+1151 0044 83E0 ldi r24,lo8(3)152 /* #APP */153 0046 F901 movw r30, r18154 0048 8093 5700 sts 87, r24155 004c E895 spm156157 /* #NOAPP */158 .L8:32:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_spm_busy_wait(); // Wait until the memory is erased.160 .LM10:161 004e 07B6 in __tmp_reg__,87-0x20162 0050 00FC sbrc __tmp_reg__,0163 0052 FDCF rjmp .L833:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****34:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_write(flash_prev_addr); // Store buffer in flash page.165 .LM11:166 0054 85E0 ldi r24,lo8(5)167 /* #APP */168 0056 F901 movw r30, r18169 0058 8093 5700 sts 87, r24170 005c E895 spm171172 /* #NOAPP */173 .L10:35:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_spm_busy_wait(); // Wait until the memory is written.175 .LM12:176 005e 07B6 in __tmp_reg__,87-0x20177 0060 00FC sbrc __tmp_reg__,0178 0062 FDCF rjmp .L1036:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****37:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_buffer_dirty = 0;180 .LM13:181 0064 1092 0000 sts flash_buffer_dirty,__zero_reg__38:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****39:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Reenable RWW-section again so we can return to BIOS after flashing.40:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_rww_enable ();183 .LM14:184 0068 81E1 ldi r24,lo8(17)185 /* #APP */186 006a 8093 5700 sts 87, r24187 006e E895 spm18841:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****42:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Re-enable interrupts (if they were ever enabled).43:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** SREG = sreg;190 .LM15:191 /* #NOAPP */192 0070 9FBF out 95-0x20,r25193 .L12:194 0072 0895 ret195 /* epilogue: frame size=0 */196 /* epilogue: noreturn */197 /* epilogue end (size=0) */198 /* function flash_flush_buffer size 76 (76) */204 .Lscope0:205 .text208 .global flash_load_buffer210 flash_load_buffer:44:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }45:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****46:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** void flash_load_buffer(uint16_t addr) {212 .LM16:213 /* prologue: frame size=0 */214 /* prologue end (size=0) */47:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint8_t i;48:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint8_t byte;49:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint16_t page = (addr / SPM_PAGESIZE) * SPM_PAGESIZE;216 .LM17:217 0000 8078 andi r24,lo8(-128)50:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****51:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Load current flash page contents into sram page buffer to implement52:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // flash read-modify-writes with word granularity.53:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** for (i = 0; i < SPM_PAGESIZE; i++) {54:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** byte = pgm_read_byte(page + i);55:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_pagebuf[i] = byte;219 .LM18:220 0002 4091 0000 lds r20,flash_pagebuf221 0006 5091 0000 lds r21,(flash_pagebuf)+1222 000a 20E0 ldi r18,lo8(0)223 000c 30E0 ldi r19,hi8(0)224 .L22:225 .LBB2:227 .LM19:228 000e A22F mov r26,r18229 0010 BB27 clr r27230 0012 FC01 movw r30,r24231 0014 EA0F add r30,r26232 0016 FB1F adc r31,r27233 /* #APP */234 0018 E491 lpm r30, Z235236 /* #NOAPP */237 .LBE2:239 .LM20:240 001a A40F add r26,r20241 001c B51F adc r27,r21242 001e EC93 st X,r30243 0020 2F5F subi r18,lo8(-(1))244 0022 3F4F sbci r19,hi8(-(1))246 .LM21:247 0024 2038 cpi r18,128248 0026 3105 cpc r19,__zero_reg__249 0028 91F7 brne .L22250 /* epilogue: frame size=0 */251 002a 0895 ret252 /* epilogue end (size=1) */253 /* function flash_load_buffer size 26 (25) */261 .Lscope1:262 .section .bootloader266 .global flash_write_word268 flash_write_word:56:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }57:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }58:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****59:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** void flash_write_word(uint16_t addr, uint16_t word) {270 .LM22:271 /* prologue: frame size=0 */272 0074 EF92 push r14273 0076 FF92 push r15274 0078 0F93 push r16275 007a 1F93 push r17276 007c CF93 push r28277 007e DF93 push r29278 /* prologue end (size=6) */279 0080 EC01 movw r28,r24280 0082 7B01 movw r14,r2260:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint16_t* buf = (uint16_t*)flash_pagebuf; // Access buffer on a word basis.282 .LM23:283 0084 0091 0000 lds r16,flash_pagebuf284 0088 1091 0000 lds r17,(flash_pagebuf)+161:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****62:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // Check if page address has changed since last write63:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** if ((addr / SPM_PAGESIZE) != (flash_prev_addr / SPM_PAGESIZE)) {286 .LM24:287 008c 9C01 movw r18,r24288 008e 220F lsl r18289 0090 232F mov r18,r19290 0092 221F rol r18291 0094 330B sbc r19,r19292 0096 3195 neg r19293 0098 8091 0000 lds r24,flash_prev_addr294 009c 9091 0000 lds r25,(flash_prev_addr)+1295 00a0 880F lsl r24296 00a2 892F mov r24,r25297 00a4 881F rol r24298 00a6 990B sbc r25,r25299 00a8 9195 neg r25300 00aa 2817 cp r18,r24301 00ac 3907 cpc r19,r25302 00ae 29F0 breq .L2864:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_flush_buffer(); // Flash buffer contents to previous page304 .LM25:305 00b0 0E94 0000 call flash_flush_buffer65:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_load_buffer(addr); // Read new page contents into buffer307 .LM26:308 00b4 CE01 movw r24,r28309 00b6 0E94 0000 call flash_load_buffer310 .L28:66:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }67:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****68:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** buf[(addr % SPM_PAGESIZE)/2] = word;312 .LM27:313 00ba FE01 movw r30,r28314 00bc EE77 andi r30,lo8(126)315 00be F070 andi r31,hi8(126)316 00c0 E00F add r30,r16317 00c2 F11F adc r31,r17318 00c4 F182 std Z+1,r15319 00c6 E082 st Z,r1469:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_prev_addr = addr;321 .LM28:322 00c8 D093 0000 sts (flash_prev_addr)+1,r29323 00cc C093 0000 sts flash_prev_addr,r2870:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_buffer_dirty = 1;325 .LM29:326 00d0 81E0 ldi r24,lo8(1)327 00d2 8093 0000 sts flash_buffer_dirty,r24328 /* epilogue: frame size=0 */329 00d6 DF91 pop r29330 00d8 CF91 pop r28331 00da 1F91 pop r17332 00dc 0F91 pop r16333 00de FF90 pop r15334 00e0 EF90 pop r14335 00e2 0895 ret336 /* epilogue end (size=7) */337 /* function flash_write_word size 56 (43) */339 .Lscope2:342 .global flash_init344 flash_init:71:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }72:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****73:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** void flash_init(uint8_t* buf) {346 .LM30:347 /* prologue: frame size=0 */348 /* prologue end (size=0) */74:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // 0xffff is never in any page that can be written on devices with <= 64K flash,75:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** // so the first flash_write_word will always trigger a buffer load.76:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_prev_addr = 0xffff;350 .LM31:351 00e4 2FEF ldi r18,lo8(-1)352 00e6 3FEF ldi r19,hi8(-1)353 00e8 3093 0000 sts (flash_prev_addr)+1,r19354 00ec 2093 0000 sts flash_prev_addr,r1877:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_pagebuf = buf;356 .LM32:357 00f0 9093 0000 sts (flash_pagebuf)+1,r25358 00f4 8093 0000 sts flash_pagebuf,r2478:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** flash_buffer_dirty = 0;360 .LM33:361 00f8 1092 0000 sts flash_buffer_dirty,__zero_reg__362 /* epilogue: frame size=0 */363 00fc 0895 ret364 /* epilogue end (size=1) */365 /* function flash_init size 13 (12) */367 .Lscope3:368 .section .flash_code,"ax",@progbits373 .global flash_copy_data375 flash_copy_data:79:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }80:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****81:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** extern void __flash_code_start; // Start of .flash_code from ld-script82:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****83:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** void flash_copy_data(uint16_t src, uint16_t dst, uint16_t len) {377 .LM34:378 /* prologue: frame size=0 */379 /* prologue end (size=0) */380 0000 DC01 movw r26,r2484:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** uint16_t data;85:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****86:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** cli(); // From this point we're on our own382 .LM35:383 /* #APP */384 0002 F894 cli87:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****88:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** len = (len | (SPM_PAGESIZE - 1)) + 3; // Round len up to a whole page + 2386 .LM36:387 /* #NOAPP */388 0004 4F67 ori r20,lo8(127)389 0006 4D5F subi r20,lo8(-(3))390 0008 5F4F sbci r21,hi8(-(3))391 000a 2EC0 rjmp .L34392 .L35:89:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****90:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** while (len -= 2) {91:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** if (dst >= (uint16_t)&__flash_code_start) break;394 .LM37:395 000c 80E0 ldi r24,hi8(__flash_code_start)396 000e 6030 cpi r22,lo8(__flash_code_start)397 0010 7807 cpc r23,r24398 0012 08F0 brlo .+2399 0014 2DC0 rjmp .L3692:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****93:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** wdt_reset();401 .LM38:402 /* #APP */403 0016 A895 wdr404 /* #NOAPP */405 .LBB3:94:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****95:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** data = pgm_read_word(src); // Read source word407 .LM39:408 0018 FD01 movw r30,r26409 /* #APP */410 001a 8591 lpm r24, Z+411 001c 9491 lpm r25, Z412413 /* #NOAPP */414 .LBE3:96:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_fill(dst, data); // Write word to destination416 .LM40:417 001e 21E0 ldi r18,lo8(1)418 /* #APP */419 0020 0C01 movw r0, r24420 0022 FB01 movw r30, r22421 0024 2093 5700 sts 87, r18422 0028 E895 spm423 002a 1124 clr r142497:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****98:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** if ((dst + 2) % SPM_PAGESIZE == 0) { // If we just wrote the last word of a page426 .LM41:427 /* #NOAPP */428 002c 9B01 movw r18,r22429 002e 2E5F subi r18,lo8(-(2))430 0030 3F4F sbci r19,hi8(-(2))431 0032 C901 movw r24,r18432 0034 8F77 andi r24,lo8(127)433 0036 9070 andi r25,hi8(127)434 0038 892B or r24,r25435 003a A1F4 brne .L3899:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_erase(dst);437 .LM42:438 003c 83E0 ldi r24,lo8(3)439 /* #APP */440 003e FB01 movw r30, r22441 0040 8093 5700 sts 87, r24442 0044 E895 spm443444 /* #NOAPP */445 .L40:100:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_spm_busy_wait(); // Wait until the memory is erased.447 .LM43:448 0046 07B6 in __tmp_reg__,87-0x20449 0048 00FC sbrc __tmp_reg__,0450 004a FDCF rjmp .L40101:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_page_write(dst); // Store buffer in flash page.452 .LM44:453 004c 85E0 ldi r24,lo8(5)454 /* #APP */455 004e FB01 movw r30, r22456 0050 8093 5700 sts 87, r24457 0054 E895 spm458459 /* #NOAPP */460 .L42:102:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_spm_busy_wait(); // Wait until the memory is written.462 .LM45:463 0056 07B6 in __tmp_reg__,87-0x20464 0058 00FC sbrc __tmp_reg__,0465 005a FDCF rjmp .L42103:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** boot_rww_enable();467 .LM46:468 005c 81E1 ldi r24,lo8(17)469 /* #APP */470 005e 8093 5700 sts 87, r24471 0062 E895 spm472473 /* #NOAPP */474 .L38:104:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** }105:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c ****106:/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c **** src += 2;476 .LM47:477 0064 1296 adiw r26,2478 0066 B901 movw r22,r18479 .L34:481 .LM48:482 0068 4250 subi r20,lo8(-(-2))483 006a 5040 sbci r21,hi8(-(-2))484 006c 09F0 breq .+2485 006e CECF rjmp .L35486 .L36:487 .L49:488 0070 FFCF rjmp .L49489 /* epilogue: frame size=0 */490 /* epilogue: noreturn */491 /* epilogue end (size=0) */492 /* function flash_copy_data size 82 (82) */498 .Lscope4:499 .lcomm flash_buffer_dirty,1500 .lcomm flash_prev_addr,2501 .lcomm flash_pagebuf,2505 .text507 .Letext0:508 /* File "/home/linus/HomeAutomation/trunk/EmbeddedSoftware/AVR/avr-lib/bios/flash.c": code 253 = 0DEFINED SYMBOLS*ABS*:00000000 flash.c/tmp/ccYj0Hyz.s:3 *ABS*:0000003f __SREG__/tmp/ccYj0Hyz.s:4 *ABS*:0000003e __SP_H__/tmp/ccYj0Hyz.s:5 *ABS*:0000003d __SP_L__/tmp/ccYj0Hyz.s:6 *ABS*:00000000 __tmp_reg__/tmp/ccYj0Hyz.s:7 *ABS*:00000001 __zero_reg__/tmp/ccYj0Hyz.s:93 .bootloader:00000000 flash_flush_buffer/tmp/ccYj0Hyz.s:500 .bss:00000003 flash_pagebuf.bss:00000000 flash_buffer_dirty/tmp/ccYj0Hyz.s:499 .bss:00000001 flash_prev_addr/tmp/ccYj0Hyz.s:210 .text:00000000 flash_load_buffer/tmp/ccYj0Hyz.s:268 .bootloader:00000074 flash_write_word/tmp/ccYj0Hyz.s:344 .bootloader:000000e4 flash_init/tmp/ccYj0Hyz.s:375 .flash_code:00000000 flash_copy_dataUNDEFINED SYMBOLS__do_copy_data__do_clear_bss__flash_code_start