[Top][All Lists]

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

Re: [avr-gcc-list] Bootloader question

From: Scott Morken
Subject: Re: [avr-gcc-list] Bootloader question
Date: Fri, 14 Dec 2007 11:10:16 -0800
User-agent: Thunderbird (Windows/20071031)

I have tried not disabling the watchdog, and it does go to the bootloader. But when I do this the bootloader rapidly resets over and over and does not make it into its command loop, even if I disable the wdt early in the bootloader code.


Bernard Fouché wrote:
Scott Morken wrote:

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:
wdt_disable();//disable watchdog
cli();//disable all interrupts
for(counter = 0; counter<20000; counter ++)
                      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)


reply via email to

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