I use function pointer to bypass direct addressing.
Fred

--------------------------------------------
Frederic Beaulieu, M.Sc.
Research and Development
NewTrax Technologies Inc.
http://www.newtraxtech.com/


-----Original Message-----
From: mspgcc-users-ad...@lists.sourceforge.net
[mailto:mspgcc-users-ad...@lists.sourceforge.net] On Behalf Of Dale
Cunningham
Sent: Friday, June 17, 2005 5:05 PM
To: mspgcc-users@lists.sourceforge.net
Subject: Re: [Mspgcc-users] bootstrap code

N. Coesel wrote:
> At 04:53 17-06-05 -0400, you wrote:
> 
>>I'm trying to write a bootstrap routine in C that will reside in flash

>>and be copied to RAM for execution.  Can anyone give me some helpful 
>>hints on how to do that?
> 
> 
> In an earlier discussion the method of copying a routine was
discussed.

That should be the easy part.  I wasn't worried about that, but I'll 
check the archives just in case I'm missing something.

>>I've searched the docs for any reference to relocatable code (there
will 
>>be some subroutines, also in RAM) or preprocessor commands that might
be 
>>able to specify that this code will be running at a particular address

>>(in this case within the RAM) and haven't been able to find anything 
>>that relates to this problem.
> 
> 
> Why would you copy more than one subroutine in RAM? The only thing you
will
> want in RAM is the code that actually programs the flash. The amount
of
> memory doesn't allow for allocating large fixed buffers for this.

This BSL also needs to decrypt the data to be written to flash and 
handle some handshaking with the PC.  The decryption routine might be 
erased at some point during the flash programming even if I only erase 
the segment about to be written.  That wouldn't be good.  And, part of 
the decryption algorhythm makes multiple calls to a subroutine, so that 
inlining that code would increase the size - this might not be a 
problem.  I'm using an msp430x449 with 2k of RAM, so I think I'll have 
plenty of space for code and a communications buffer.

So far, looking at the assembler output, it seems that calls are my only

problem - they use direct addressing.  So, I can just "fix" these few 
lines in the assembler or try indirect calls in C or just inline
everything.

Dale Cunningham


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.7/20 - Release Date: 6/16/2005
 

-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.7.7/20 - Release Date: 6/16/2005
 


Reply via email to