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

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

RE: [avr-gcc-list] Problems with bootloader


From: Yannick PODGORSKI
Subject: RE: [avr-gcc-list] Problems with bootloader
Date: Tue, 18 Oct 2005 09:44:02 +0200

Hi,
I suppose you have done this :
 
In Makefile :
DFLAGS = -Wl,-Ttext=0x1E000 to put all code at this @.

With AVRStudio, program the fuses :
BOOTRST = 0 (reset at @ 0x1E000)
BOOTSZ = 00 (4096 words for BLS)

At start of code, program :
MCUCR = (1<<IVCE);
MCUCR = (1<<IVSEL); to put interrupt vector in LBS

You can try :
void pageErase(uint16_t page)
{
    cli();
    eeprom_busy_wait();
    boot_page_erase(page);
    boot_spm_busy_wait();
    sei();
}
 
Or
 
void WritePage(uint16_t page)
{
    cli();
    eeprom_busy_wait();
    boot_page_erase(page);
 
    //fille temporary buffer
    for(uint16_t i=0; i< SPM_PAGESIZE; i+=2){
        boot_page_fill(page + i, i);
    }
    boot_page_write(page);
    boot_spm_busy_wait();
    boot_rww_enable();
    sei();
}
 
Hope that helps.
 
Yannick.
 


De : address@hidden [mailto:address@hidden De la part de Ollinad
Envoyé : lundi 17 octobre 2005 23:43
À : address@hidden
Objet : [avr-gcc-list] Problems with bootloader

Hi people,

I'm trying to write a bootloader for the at90can128 and I'm having problems. The biggest one is that I can't write to the flash, I've tried everything and nothing works. So I gave up and tried to erase a flash page, nothing too...

void pageErase(uint16_t page)
{
    cli();
    boot_spm_busy_wait();
    boot_page_erase(page);
    boot_spm_busy_wait();
    sendChar('F');
    while (1);
}

this is the function I use to erase a page, I'm using the functions from the boot module of the libc.

thanks for your help,

--
Mr. Santos, Danillo Moura  - Computer Science Student - UFSC
Home:            (48) 91347806    (48) 3382755
Parents Town: (13) 97869780    (13) 32372723
reply via email to

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