----- Original Message -----
Sent: Wednesday, February 23, 2005 4:21
PM
Subject: Re: [avr-gcc-list] switch from
application to bootloader section
How do you flash your ATMEGA ?
Are you sure that is really flash in both
sections ?
If you set BOOTRST, the CPU resets to app
section.
You said :"my bootloader program size is 512
byte, so I located in smallest bootloader section (Address
1E00h)".
It's ok.
You switch to boot section with a
jump :
asm
volatile("jmp 0x1E00");
At start of boot code, program :
MCUCR = (1<<IVCE);
MCUCR =
(1<<IVSEL); to put interrupt vector in LBS
At end of boot code,
before jump to app section :
MCUCR = (1<<IVCE);
MCUCR
= (0<<IVSEL); to put interrupt vector in appli section
Try to use only a app program first to be sure
that works without a boot program and with BOOTRST=1.
After make another little program and test
it on app section to be sure that is worked.
Flash your ATMEGA with 2 program don't forget
to move interrupt vector with MCUCR and make jump.
Your app code must work and look what
happens.
Hope that helps.
----- Original Message -----
Sent: Wednesday, February 23, 2005
10:01 AM
Subject: Re: [avr-gcc-list] switch
from application to bootloader section
when switch to boot section , the program
doesn't execute the program in app section anymore. But looks like the
program doesn't execute the boot section either.
I set BOOTRST (programmed) and I didn't use
watchdog.
Andi
----- Original Message -----
Sent: Wednesday, February 23, 2005
3:38 PM
Subject: Re: [avr-gcc-list] switch
from application to bootloader section
yes, we could.
My last mail is not enough :
----------------------
Don't you make the opposite ?
to switch app section to boot section
is:
//....
cli();
GICR = (1<<IVCE);
GICR = (1<<IVSEL);
void (*function)(void) =
0x1E000
function();
Anyone know how to switch interupt vector
from bootloader section to application section ?
I Try :
//...
cli();
GICR = (1<<IVCE);
GICR = (0<<IVCE);
// try this
void (*function)(void) =
0x0000
function();
//...
Can you give more details :
- what happen ?
- the CPU resets ? Do you disable watch dog
?
----- Original Message -----
Sent: Tuesday, February 22, 2005
2:30 AM
Subject: Re: [avr-gcc-list]
switch from application to bootloader section
I make two different
program, application and bootloader for ATMEGA8
I compile both separately. My bootloader
program size is 512 byte, so I located in smallest bootloader
section (Address 1E00h).
I want my program some time switch from
bootloader section to application section and vice versa.
The bootloader program have a function to
reprogram the flash (app section only, coz I I block spm command for
boot section).
Could You help me ?
Andi
----- Original Message -----
Sent: Monday, February 21, 2005
6:10 PM
Subject: Re: [avr-gcc-list]
switch from application to bootloader section
Don't you make the opposite
?
to switch app section to boot section
is:
//....
cli();
GICR = (1<<IVCE);
GICR = (1<<IVSEL);
void (*function)(void) =
0x1E000
function();
Anyone know how to switch interupt
vector from bootloader section to application section ?
I Try :
//...
cli();
GICR = (1<<IVCE);
GICR =
(0<<IVCE);
// try
this
void (*function)(void) =
0x0000
function();
//...
Can you give more details :
- what happen ?
Do you disable watch dog
?
----- Original Message -----
Sent: Monday, February 21,
2005 10:23 AM
Subject: [avr-gcc-list]
switch from application to bootloader section
I know to switch app section to boot
section is:
//....
cli();
GICR = (1<<IVCE);
GICR = (1<<IVSEL);
void (*function)(void) =
0x0000
function();
Anyone know how to switch interupt
vector from bootloader section to application section
?
I Try :
//...
cli();
GICR = (1<<IVCE);
GICR = 0;
void (*function)(void) =
0x1E000
function();
//...
but didn't work.
Andi
_______________________________________________
AVR-GCC-list
mailing
list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
_______________________________________________
AVR-GCC-list
mailing
list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list