Temporary call Atmel bootloader

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
Hi,

I'm using a AT89C51ED2.  Sometimes the application needs to start the Atmel
ISP bootloader, e.g. to enable re-programming the flash.  Normally this is
done by the following API procedure:

    void __api_start_bootloader (void)
    {
        __api_wr_BSB (0xFF);
        __api_wr_SBV (0xFC);
        // stop application peripherals
        T2CON=0x00;
        TL2=0x00;
        TH2=0x00;
        BDRCON=0x00;
        TCON=0x00;
        SCON = 0x00;
        TMOD = 0x00;
        PCON = 0x00;
        TCON = 0x00;
        EA = 0;
        MAP_BOOT;
        __API_JMP_BOOTLOADER();
    }

The problem ist the writing of 0xFF to BSB, because it inhibits the start of
my application on the next reboot.  I'm looking for a way of starting the
bootloader without the need of modifying the BSB.  Simply commenting out the
"__api_wr_BSB()" line is not possible, because then the bootloader
immediately returns to the application.

Any idea?

Jürgen



Re: Temporary call Atmel bootloader
Juergen Loh schrieb:

Quoted text here. Click to load it

What is the address defined for __API_JMP_BOOTLOADER?

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
We've slightly trimmed the long signature. Click to see the full one.
Re: Temporary call Atmel bootloader
Hi Tilmann,


Quoted text here. Click to load it

#define __API_JMP_BOOTLOADER (*((const void(code*)(void)) 0xF800 ))

Jürgen



Re: Temporary call Atmel bootloader
Juergen Loh schrieb:

Quoted text here. Click to load it

I think the entry point for the boot loader is FC00h.
At least it always was for the RD2, and AFAIK the loader is the same.

But then, unless you jump to the soft boot entry at FC03h (which
checks BSB and SBV), the boot loader should immediately start
(with the automatic baud rate detection).

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
We've slightly trimmed the long signature. Click to see the full one.
Re: Temporary call Atmel bootloader
Hallo Tilmann,

sorry for my late reply.  I had to stay in bed with fever for some days.
:-(

Quoted text here. Click to load it

The ED2 data sheet says that the boot loader's address is from F800 to FFFF.
And the boot process diagram says that the boot ROM is started at F800 at
startup.

Quoted text here. Click to load it

Yes the boot loader starts, but it immediately returns to the application
program at 0000 if BSB is 00.

Is there any documentation of the boot loader's entry points like FC03 as
you mentioned?

Tschüs,
    Jürgen




Re: Temporary call Atmel bootloader
Juergen Loh schrieb:

Quoted text here. Click to load it

Another thought: what if ENBOOT (in AUXR1) is not set, unless you have
set the BSB?

--
Dipl.-Ing. Tilmann Reh
Autometer GmbH Siegen - Elektronik nach Maß.
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline