Closed lrozema closed 10 years ago
Can you try replacing push %B0 with push r24 and then deleting the mov %B0,r24? I will commit this smaller change if it works.
Yeah sure, that will work, squeezing out an extra few clocks. I can test this in two days when I'm back at the device.
I'm actually more worried about code size than clocks as xboot has to fit into 4k of code space. There are some parts of xboot that can probably use a lot more optimization, though.
I have tested the suggested change, it works fine. The code is now: asm volatile ( "call get_char" "\n\t" "push r24" "\n\t" "call get_char" "\n\t" "pop %B0" "\n\t" "mov %A0,r24" "\n\t" : "=r" (result) : );
Alright, I just committed the fix. Thanks!
When building XBoot for X16A4 on Mac OS X using AVR-GCC 4.6.2 from CrossPack 20130212 the r25 register used by get_2bytes assembler method is corrupted by the get_char method. When I add push %B0 and pop %B0 around the second get_char inside get_2bytes then the bootloader starts to work.