From: Olivier Matz Date: Wed, 20 May 2015 21:35:48 +0000 (+0200) Subject: imuboard: fix call to bootloader X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=db9208bf063c3c2b0a01f42db3df9436c5016438;p=fpv.git imuboard: fix call to bootloader --- diff --git a/imuboard/main.c b/imuboard/main.c index 5410074..7de8acb 100644 --- a/imuboard/main.c +++ b/imuboard/main.c @@ -28,6 +28,9 @@ /* fuses: * avrdude -p atmega1284p -P usb -c avrispmkii -U lfuse:w:0xff:m -U hfuse:w:0x91:m -U efuse:w:0xff:m * -> it failed but I answered y, then make reset and it was ok + * + * with bootloader: + * avrdude -p atmega1284p -P usb -c avrispmkii -U lfuse:w:0xff:m -U hfuse:w:0x90:m -U efuse:w:0xff:m */ #include @@ -72,7 +75,7 @@ volatile uint32_t global_ms; void bootloader(void) { -#define BOOTLOADER_ADDR 0x3f000 +#define BOOTLOADER_ADDR 0x1e000 if (pgm_read_byte_far(BOOTLOADER_ADDR) == 0xff) { printf_P(PSTR("Bootloader is not present\r\n")); return; @@ -91,10 +94,10 @@ void bootloader(void) ACSR = 0; ADCSRA = 0; - /* XXX */ - /* __asm__ __volatile__ ("ldi r31,0xf8\n"); */ - /* __asm__ __volatile__ ("ldi r30,0x00\n"); */ - /* __asm__ __volatile__ ("eijmp\n"); */ + __asm__ __volatile__ ("ldi r30,0x00\n"); + __asm__ __volatile__ ("ldi r31,0xf0\n"); + //__asm__ __volatile__ ("eijmp\n"); + __asm__ __volatile__ ("ijmp\n"); } /* return time in milliseconds on unsigned 16 bits */