Am trying to debug the bootloader:
Using AS 6.2 to a ATMega328p (Arduino) via Atmel Dragon.
Basically, the program flash just shows erased (0xff), even after the writing procedure (asm).
However the flash has been overwritten, since starting the program again shows the flash written correctly.
Have got no optimisations, and the -mrelax flag disabled.
Have set the BL size to 2048W, since with optimisation off it builds >2K, and set .text=0x3800 in the Linker-Memory-FlashSegment.
Slightly off topic:
Also noticed that if -nostartfiles present (as is default with the above bootloader), then debugwire will start and break - but no variables can be evaluated in the Watch window - just get 'Unable to evaluate the expression. Invalid pointer'. Taking off -nostartfiles fixes that.