avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Bootloader question


From: Bernard Fouché
Subject: Re: [avr-gcc-list] Bootloader question
Date: Fri, 14 Dec 2007 14:28:20 +0100
User-agent: Thunderbird 2.0.0.9 (Windows/20071031)

Scott Morken wrote:
Hi

I have an application that jumps to the bootloader using this function (it's a slightly modified avr109 bootloader made by atmel): void (*funcptr)( void ) = (void *)0x3800; // Set up function pointer to the bootloader start.

I call it when a command is sent over the serial port, making this code run:
UART_SendByte('B');
wdt_disable();//disable watchdog
cli();//disable all interrupts
for(counter = 0; counter<20000; counter ++)
{
   asm("NOP");
}
                      funcptr();//goto bootloader
You call your bootloader like a function, so the MCU is not re-initialized: pending interrupts may be fired if ever the booloader call sei(), the stack may be near its end, etc. Why not do your timing loop, but with the watchdog still enabled? That would make the MCU restarts and go to the bootloader if the fuses are set correctly (I'm used to 64/128/1280 pieces, I dunno about the 168 bootloading requirements)

 Bernard




reply via email to

[Prev in Thread] Current Thread [Next in Thread]