[Top][All Lists]

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

Re: [avr-libc-dev] boot.h

From: Volkmar Dierkes
Subject: Re: [avr-libc-dev] boot.h
Date: Tue, 7 Jan 2003 21:12:15 +0100
User-agent: 40tude_Dialog/ Hamster/


it seems that you only reply to me and not to the mailing list. 
Therefore I included the whole one together with my comment, because 
you asked Jörg and Ted for their opinion.

On Mon, 06 Jan 2003 11:24:37 -0700, E. Weddington wrote:

> On 23 Dec 2002 at 0:45, Volkmar Dierkes wrote:
>> On Tue, 17 Dec 2002 15:57:16 -0700, E. Weddington wrote:
>>> What I'm proposing is a *low-level* API that right now a user has to
>>> write themselves, more of a boot loader *support* API:
>>> boot_page_fill(address, data)       // Fill the temporary page write
>>> buffer boot_page_erase(address)     // Erase page
>>> boot_page_write(address)            // Write page boot_mem_read(address)    
>>>         //
>>> Read memory byte boot_rww_enable()                  // Enable RWW section
>>> boot_lock_bits_set(__lock_bits) // Set lock bits
>>> boot_spm_interrupt_enable() // Enable SPM interrupt
>>> boot_spm_interrupt_disable()        // Disable SPM interrupt
>>> is_boot_spm_interrupt()             // Check if SPM interrupt enabled
>>> boot_rww_busy()                             // Check if RWW section is busy
>>> boot_spm_busy()                             // Check if SPM is busy 
>>> boot_spm_busy_wait()            //
>>> Wait while SPM is busy
>>> This doesn't provide a whole bootloader; that is up to the
>>> programmer to write. But it does provide the *tools* for a
>>> programmer to write one. This API pretty much corresponds to the
>>> Boot Loader Support section in all the AVR data sheets. Right now
>>> avrlibc does not provide any such functions.
>> I agree with your proposal. I think I got a copy of your avr-boot.h in
>> an indirect way ;-) I found a small bug because your are testing it on
>> a mega128 and at the moment I try to get it working with a mega8.
>> Look in __boot_mem_read_normal__, change
>>             : "=r" ((unsigned char)__result),  \
>> into
>>             : "=r" ((unsigned char)__result)   \
>> I deleted the comma at the end.
> Thanks for catching that! Now corrected. That's what I get for cut 
> and paste. ;-)
>> But I have also a question. There are some differences in the 
>> mega's: Especially the pagesize is different. Is there a possibility
>> to include such things in the iomxxx.h (or whereever)?
> I didn't know the pagesize differed between processors.

Here is a list (taken from the datasheets):

ATmega128  128 words
ATmega16    64 words
ATmega161   64 words
ATmega162   64 words
ATmega163   64 words
ATmega169   64 words
ATmega32    64 words
ATmega323   64 words
ATmega64   128 words
ATmega8     32 words
ATmega8515  32 words
ATmega8535  32 words

ATmega103 has no bootloader support.

> IMO, the io headers would be the place to do that.
> Joerg, Ted, do you have an opinion on this?
> Eric


reply via email to

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