We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
add a project target using the "components, environment and books" menu, "project target" tab. then you can add any files you need to a specific target.
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.