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

static link in object file

hi,
i would like to write a bootloader placed
in lower part of flash.

the bootloader uses some tcpnet functions
to upload from the network the application.

the application will be copied in higher
part of the flash and executed independently.

i want both the bootloader and the applcation
to use their local copies of tcpnet and not to share them.

how do i instruct the linker to place any
call to tcpnet in separate areas?

regards, marco.

Parents
  • If you build two targets, you will get two hex files.

    Easiest way is to open the hex file for the boot-loader and remove the last line. Then concatenate the application hex after the boot-loader hex.

    Now, you'll have a single hex file containing both the boot loader and the application.

    And since you used two separate targets (with non-intersecting memory blocks) your combined hex file will not contain any intersections. In short: You will know that the boot loader will not share any variables or functions with your application.

    People quite often try to do everything in a single build and just try to get the scatter file to move the boot loader part into one address range and the rest into another. But if you build as a single target, then the compiler will link in common code or variables - such as help code for division, stack overflow checking or similar.

Reply
  • If you build two targets, you will get two hex files.

    Easiest way is to open the hex file for the boot-loader and remove the last line. Then concatenate the application hex after the boot-loader hex.

    Now, you'll have a single hex file containing both the boot loader and the application.

    And since you used two separate targets (with non-intersecting memory blocks) your combined hex file will not contain any intersections. In short: You will know that the boot loader will not share any variables or functions with your application.

    People quite often try to do everything in a single build and just try to get the scatter file to move the boot loader part into one address range and the rest into another. But if you build as a single target, then the compiler will link in common code or variables - such as help code for division, stack overflow checking or similar.

Children
No data