hello,=20
=20
> But apparently you need something different. You state using=20
> __sdcc_gsinit_startup is not possible. Why?=20=20
=20
because __sdcc_gsinit_startup isn't accessible, imo.=20
the following for instance doesn't work:=20
=20
_asm=20
.area aitseg (abs)=20=20
.org 0x8000=20=20
_ait:=20=20
.dw #APP_MAGIC // magic number of application=20=20
.dw #__sdcc_gsinit_startup //start address of itself=20
_endasm;=20
=20
( "?ASlinkWarningUndefined Global 'sdcc_gsinit_startup' referenced by=20
module 'xyz'" , just for the details)=20
=20
> Normally SDCC=20
> generates "ljmp __sdcc_gsinit_startup" as the very first instruction=20
> which under normal conditions would end up at address 0, the reset=20
> vector. If the bootloader jumps to this address it should work just=20
fine.=20
=20
Maybe i didn't understand all of this correctly .. I guess this can't=20
work. The reset vector is used by the mcu to jump to programs. if the=20
start address of the application is stored there, the bootloader will be=20
ignored perfectly. So at reset vector the address of the bootloader=20
needs to rermain. Until now i've no idea how to compile the application=20
without usage of the reset vector. For now, the flash programmer simply=20
ignores the appropriate srecord in the application s19file, not good,=20
but it works.=20
=20
> But if you use interrupts then how to tell the bootloader about that?=20
=20
Until know i don't care about interrupts (with the exc of the reset=20
vector). It's possible to rewrite interrupts while flashing the=20
application, but perhaps interrupts can be avoided. Imo there's no real=20
need using them in this case.=20
=20
> And how do you want to put the start address at the known address?=20
> code unsigned int at KNOWN_ADDRESS app_start =3D APP_START;=20
> will not do it. SDCC will ignore the initializer. You could use a=20
special=20
> named const segment and tell the linker where to put it. Or maybe=20
> using srecord is easier.=20
=20
still know this .. circumstances. see the asmline above.=20
=20
bye joerg=20
=20
>=20=20
> > hello,=20
> >=20
> > thx for helping me. the bootloader i've been told 'to port' with=20
sdcc=20
> > uses a fixed bootloader and moveable applications. it means that at=20
a=20
> > known address in flash (for both parts) the start address of=20
> > application is stored. so the application may be stored anywhere,=20
the=20
> > bootloader doesn't care about that. while flashing the application,=20
> > it's start address "simply" needs to be stored at that address=20
> > mentioned above (alredy have bothered you with that problem before).=20
> >=20
> > i'm quite sure the proposed solution below works. but imo it assumes=20
> > that the bootloader directly knows the application, so moving the=20
> > application requires changing the bootloader too. maybe another=20
> > solution is to use a variable in the makefile specifying an address,=20
> > and use it in both codeloc and a compiler macro. perhaps this=20
> > works, i'll give it a try anyway.=20
> >=20
> > bye joerg=20
> >=20
> >  Original Message =20
> > From: "Maarten Brock" <sourceforge.brock@...>=20
> > To: sdccuser@...=20
> > Subject: Re: [Sdccuser] startup address of program at compile time=20
> > Date: Thu, 08 Dec 2005 23:16:54 +0100=20
> >=20
> > >=20
> > > Hi Joerg,=20
> > >=20
> > > Here's what I do:=20
> > > Move the whole application to a higher address, f.e. 0x2000 with=20
=20
> > > codeloc=20
> > > Put the bootloader at 0x0000 and have all interrupts redirected to=20
> > > 0x20..=20
> > >=20
> > > The bootloader knows the application starts at 0x2000 and uses no=20
> > > interrupts. The hard part was to redirect the interrupts. For the=20
solution,=20
> > > see below, to be included in main.c of the bootloader. The penalty=20
is a=20
> > > slightly larger interrupt latency.=20
> > >=20
> > > static void asmdummy(void) _naked=20
> > > {=20
> > > _asm=20
> > > _ApplicationStartup =3D 0x2000=20
> > > _isr0 =3D _ApplicationStartup + 0x0003=20
> > > _isr1 =3D _ApplicationStartup + 0x000B=20
> > > Etc...=20
> > > _endasm;=20
> > > }=20
> > >=20
> > > void isr0 (void) interrupt 0;=20
> > > void isr1 (void) interrupt 1;=20
> > > Etc...=20
> > >=20
> > > Hope this helps,=20
> > > Maarten=20
> > >=20
> > > > hello,=20
> > > > is the startup address of a program somehow accessible while=20
> > > > compiling with sdcc? i would like to use this address to store=20
it=20
> > > > somewhere, in order for another program (e.g. a bootloader) to=20
> > > > call this code. using __sdcc_gsinit_startup is not possible,=20
> > > > __sdcc_external_startup couldn't work, maybe there are other=20
> > > > possibilities? i've already red the doc (of course) and looked=20
> > > > through the sourceforge forum. (if i've missed something, i'm=20
> > > > sorry)=20
> > > >=20
> > > > thx a lot,=20
> > > > bye joerg=20
> > > >=20
> > > >=20
> > > > =20
> > > > ___________________________________________=20
> > > > Graffiti.net free email @ http://www.graffiti.net=20
> > > > Play 100s of games for FREE! http://games.graffiti.net/=20
> > > >=20
> > > >=20
> > > > Powered By Outblaze=20
> > > >=20
> > > >=20
> > > > =20
> > > > This SF.net email is sponsored by: Splunk Inc. Do you grep=20=20
> > through log files=20
> > > > for problems? Stop! Download the new AJAX search engine that=20
makes=20
> > > > searching your log files as easy as surfing the web. DOWNLOAD=20
SPLUNK!=20
> > > > http://ads.osdn.com/?ad_idv37&alloc_id 865&op=C0ick=20
> > > > _______________________________________________=20
> > > > Sdccuser mailing list=20
> > > > Sdccuser@...=20
> > > > https://lists.sourceforge.net/lists/listinfo/sdccuser=20
> > > >=20
> > > >=20
> > >=20
> > >=20
> > >=20
> > >=20
> > >=20
> > > =20
> > > This SF.net email is sponsored by: Splunk Inc. Do you grep=20=20
> > through log files=20
> > > for problems? Stop! Download the new AJAX search engine that=20
makes=20
> > > searching your log files as easy as surfing the web. DOWNLOAD=20
SPLUNK!=20
> > > http://ads.osdn.com/?ad_idv37&alloc_id 865&op=3Dclick=20
> > > _______________________________________________=20
> > > Sdccuser mailing list=20
> > > Sdccuser@...=20
> > > https://lists.sourceforge.net/lists/listinfo/sdccuser=20
> >=20
> >=20
> > =20
> > ___________________________________________=20
> > Graffiti.net free email @ http://www.graffiti.net=20
> > Play 100s of games for FREE! http://games.graffiti.net/=20
> >=20
> >=20
> > Powered By Outblaze=20
> >=20
> >=20
> > =20
> > This SF.net email is sponsored by: Splunk Inc. Do you grep through=20
log files=20
> > for problems? Stop! Download the new AJAX search engine that makes=20
> > searching your log files as easy as surfing the web. DOWNLOAD=20
SPLUNK!=20
> > http://ads.osdn.com/?ad_idv37&alloc_id 865&op=C0ick=20
> > _______________________________________________=20
> > Sdccuser mailing list=20
> > Sdccuser@...=20
> > https://lists.sourceforge.net/lists/listinfo/sdccuser=20
> >=20
> >=20
>=20=20
>=20=20
>=20=20
>=20=20
>=20=20
> =20
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log=20
files=20
> for problems? Stop! Download the new AJAX search engine that makes=20
> searching your log files as easy as surfing the web. DOWNLOAD=20
SPLUNK!=20
> http://ads.osdn.com/?ad_idv37&alloc_id=16865&op=3Dclick=20
> _______________________________________________=20
> Sdccuser mailing list=20
> Sdccuser@...=20
> https://lists.sourceforge.net/lists/listinfo/sdccuser=20
=20
=20
___________________________________________
Graffiti.net free email @ http://www.graffiti.net
Play 100s of games for FREE! http://games.graffiti.net/
Powered By Outblaze
