I have a board with an ATMEGA88 chip which has a bootloader at address 0x1800 and a firmware at address 0x0000. Both have access to USB. The bootloader can write a new firmware but now I need to write a new bootloader.
Sure, this is no problem when using the AVR programmer but is it also possible to do this via USB? My idea was flashing a special firmware via the old bootloader which then can write a new bootloader. Is that possible? If yes, how?
My current tries were not successfull. All commands (boot_page_erase, boot_page_fill and boot_page_write) are executed successfully the same way as the bootloader is doing it (only difference is that it starts writing at index 0x1800 and not 0x0000) but when I restart the device then the old bootloader is still there so nothing was really written to the flash.