Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

Re: Executing code in boot page from application page

Re: Executing code in boot page from application page

2008-04-09 by Don Kinzer

--- In AVR-Chat@yahoogroups.com, Lee <lde99881@...> wrote:
> Yes RAMPZ is used in the ATMEga128 and I have
> previously tried setting that before "call"ing
The RAMPZ register is only used for the elpm instruction.  The EIND 
register is used for eicall/eijmp instructions, both are available 
only on devices with more thatn 128K bytes of Flash.  I don't 
remember if you said which device you're using but if it has more 
than 128K bytes of flash you'll need to use eicall to call your 
bootloader dispatch table entries.

> I used "call" rather then jmp, because I need to
> return to the application program.
I suspected so.  However, I was referring to the instructions that 
you placed in your jump table.  If you don't plan to lock the boot 
section to make it unreadble from the application section, you can 
use a table of addresses in the bootloader.  If you do plan to lock 
the boot section, you'll need to make a table of jumps in the 
bootloader.

I use this technique in my applications and it works flawlessly.  
There have been several threads on AVR Freaks on this topic, some 
including example code.

Don Kinzer
ZBasic Microcontrollers
http://www.zbasic.net

Re: Executing code in boot page from application page

2008-04-09 by Lee

Hi Dave/Don,
Thanks for input!
Dave-
Yes RAMPZ is used in the ATMEga128 and I have previously tried setting  
that before "call"ing the jump table in the bootpage.
I have also previously tried various Fuse configurations.
Neither gave success?

Don-
I used "call" rather then jmp, because I need to return to the application  
program.  I have also used "icall" after setting Z reg which also fails.  
(definitily not Relative calls)


The simulator also does not want to go to the bootpage. ( but then  
simulators are not always perfect).

I will contimnue to research this problem until I get a definitive answer  
as it seems a neat way to implement lots of utilities in an area that  
would other wise go wasted.

I do not find the ATMega128 data sheet all that clear in this regard.

73/best regards

Lee de Vries



-- 
Using Opera e-mail client

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.