avr-libc-dev
[Top][All Lists]
Advanced

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

Re: [avr-libc-dev] [PATCH] Bootloader buffer size defines


From: E. Weddington
Subject: Re: [avr-libc-dev] [PATCH] Bootloader buffer size defines
Date: Wed, 05 Feb 2003 10:48:09 -0700

On 3 Feb 2003 at 14:41, E. Weddington wrote:

> Attached is a patch which adds bootloader temporary buffer size 
> defines to the io header files. Refer to these posts:
> 
> http://mail.nongnu.org/archive/html/avr-libc-dev/2003-
> 01/msg00007.html
> 
> http://mail.nongnu.org/archive/html/avr-libc-dev/2003-
> 01/msg00008.html
> 
> http://mail.nongnu.org/archive/html/avr-libc-dev/2003-
> 01/msg00012.html
> 

I forgot to mention, that the reason why the bootloader temporary 
buffer sizes are in byte sizes and not the word sizes that Volkmar 
listed, is because of how the AVR writes to the bootloader temporary 
buffer.

The AVR writes a word at a time to the bootloader temp buffer, 
however it addresses the temp buffer a *byte* at a time. For example:

#define ADDRESS         0x1C000UL
...
/* Write data to buffer a word at a time. Note incrementing address 
by 2.
*/
for(unsigned long i = ADDRESS; i < ADDRESS + SPM_PAGESIZE; i += 2)
{
    boot_page_fill(i, (i-ADDRESS) + ((i-ADDRESS+1) << 8));
}

This partial example is from the boot.h file that I'll submit at a 
later time which provides bootloader support functionality. 
boot_page_fill() is from that file as well. This shows how 
SPM_PAGESIZE can be used.

HTH,
Eric




reply via email to

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