This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Combining the Bootloader and the Application

Tools: uVision 3, A51, C51, Lx51, C8051F360

I'm new to the bootloader/multiple program coding, and I could use some help. I guess my biggest problem is understanding how everything works.

Please don't flame me for asking - I've been all over the knowledgebase looking at examples.

Some things I have figured out:
*How to move the interrupt vector table in the application.
*How to get the application to start at a higher code address.
*How to route the interrupt vectors in the bootloader to their new table in the application.

First question: How can I tell the compiler/linker not to use the code space in either program?
i.e. limit the code space the bootloader sees 0x0000 to 0x0800, and the same for the application 0x0800 to 0x7BFF. (I know I could make some vacant array to reserve the space, but I wanted to see if it could be done with a directive - define the code address range)

#2) Right now I've got two seperate projects - application and bootloader. What I thought would work is to compile and link the application (with vectors moved and code space reserved for the bootloader) into a absolute object file, then take that file and add it to the linker list in the bootloader project. The result (I was hoping) was the combination of the bootloader and application into a hex file. (maybe this is just not the way things are done - I don't know) The problem is first the compiler is squaking about Mulitple public declairations (MAIN), and second it does not appear to be making a file big enough to be the both of them combined.

How do things like this normally get linked together? (I'm sure I could merge the hex files, but linking them is just more eligant.)

#3) Is it possible to define/label segments with a pragma? The only way I've been able to do it is at the command line of the linker (Lx51) "?CO?BLAH(C:0x????)". It would be nice if I could somehow do a pragma around a block of constants or code and define right there in the C file the name of the segment and where it is supposed to go.

Parents Reply Children
No data