David W. Schultz <david.schultz <at> earthlink.net> writes:
> 
> I plan on adding a bootloader to my current project but haven't quite
> reached that stage yet. But I have given it some thought and I think my
> plan is a bit different from yours.
> 
> My plan is to link two stand alone programs. I have to do this
> eventually as the point is to be able to load the main program without
> using JTAG. The first is the bootloader and nothing special needs to be
> done while building it.

Your approach is quite interesting, but harder to apply for my situation. Our 
bootloader must replace the current program with another one from a specific 
memory location. I will put the bootloader code at 0x3100, put the main .text 
area at 0x5100 for example and then, when the new program is copied and ready 
to 
run, simply jump to 0x5100 and execute the main code from there. It just seems 
like the simpler option for now. 

> The second is the main program. The only thing special I will need to do
> to it is to make sure that the code starts at a higher address. I can
> think of two ways of doing that: tell the linker (I think there is a
> flag for this), or lie about the processor. (ie. claim that I am using a
> device with less flash)

If I understand correctly, I think you can use a custom linker file and in the 
MEMORY section of the file (not sure if that's how it's called) you can 
instruct 
the linker to start the 'rom' at a certain address. Default for my 
microcontroller was 0x3100.
 
> The bootloader will manage the process of loading the main program. One
> special thing it will do is when it writes the vectors replace the reset
> vector with the start point for the boot loader. This way I can have the
> boot loader  run at reset but have all the other vectors behave as usual
> for the main program. The main program should have no idea that it was
> started by the bootloader. I hope.
> 
> As usual, plans will change to reflect reality. 
> 





------------------------------------------------------------------------------
BlackBerry&reg; DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to