From db9208bf063c3c2b0a01f42db3df9436c5016438 Mon Sep 17 00:00:00 2001 From: Olivier Matz Date: Wed, 20 May 2015 23:35:48 +0200 Subject: [PATCH] imuboard: fix call to bootloader --- imuboard/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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 */ -- 2.39.5