On 8/25/12 10:35 PM, Parthasaradhi Nayani wrote: > Hello all, > I have a boot loader and an application on a Mega168. As boot loader and > application are two different entities, is there any way the boot loader > can pass a parameter to application code? Would like something like main > (int argc, char *argv[]). Any suggestions please? Thank you.
The problem I see is that the boot loader doesn't necessarily run every time the mcu is started (unless BOOTRST is set). You could define a static variable in SRAM or EEPROM which the bootloader could write some information to, if you wanted a simple way to communicate from the bootloader to the main application, but you'd also have to detect the common case where the bootloader didn't run first and RAM has random or old data in it. (Similarly the bootloader could put some special values in registers; you'd have to modify the startup routine not to clobber them.) You might be better off stepping back and considering whether the problem you are trying to solve really requires communication between the bootloader and the main program at all. _______________________________________________ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org https://lists.nongnu.org/mailman/listinfo/avr-gcc-list