Great, thank you. I'll be trying this out as a bootloader but also using it to understand the source. Your code is MUCH easier to read than the standard because of all the conditional assembly for other processors. A couple of questions:
1) Near the start of "main" you comment:
/* C zero initialises all global variables. However, that requires */
/* These definitions are NOT zero initialised, but that doesn't matter */
/* This allows us to drop the zero init code, saving us memory */
Is "C zero" something that you've removed? - I don't see it anywhere.
2) Later you have a conditional assembly sequence:
// The compiler normally generates sts instructions for setting
// up I/O space registers. But that takes 6 bytes per register.
// This code can do it in 2, with an overhead of 20 bytes.
// This starts to pay off when initialising 6 or more registers
__asm__ volatile (
[addr5]"i"(_SFR_MEM_ADDR(UBRR0L)), [val5]"i"((F_CPU + BAUD_RATE * 4L) / (BAUD_RATE * 8L) - 1)
// Set up Timer 1 for timeout counter
TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
UCSR0A = _BV(U2X0); //Double speed mode USART0
I take it the #else block is used and not the #if 0?
3) does the "adaboot mod" jump directly to the app on power on or unless reset is pressed?
4) How long will the loader wait before giving up and running the app anyway if there's no host input and how is that controlled? Similarly, how does the loader know the input is done?
Thanks again for a highly readable module and i hope you don't mind the questions.