Hi,
I'm struggling with a customized bootloader for an MSP430 FRAM controller. Although I have found several similar threads in this forum that helped me in solving the first issues, I have reached a point where I would appreciate further help from the community.
First, the big picture:
I have two separate CCS6.1 projects, one containing a "bootloader" and one containing "application" code.
At boot time, the bootloader checks application integrity and enters a special firmware update mode, if required. If the bootloader terminates, it branches to the application code. Bootloader and application should be absolutely independent. Therefore each code block should have its own rts-library (if needed).
My problem is now: How could I achive this in CCS?
Scenario 1 (simple, stupid, manual, ignoring interrupt handling for simplicity):
I think I could compile both projects individually, using two individual linker .cmd files for placing the code sections in a way that they are not overlapping.
Afterwards I could merge the output files (TI_TXT) in a text editor by hand.The reset vector should point to the bootloader _c_int00* function. Furthermore the _c_int00* function of the application project has to be placed in a location which is known by the bootloader. Therefore each project has its own runtime support library and its own autoinit functions. The projects are totally independent.
Obviously, manual merging of TI_TXT files is not very elegant, therefore I try to avoid this scenario.
Scenario 2 (unfortunately not working, yet):
I imported both project into one CCS workspace. The linker options of the bootloader project were modified to produce relocatable code (--relocatable). The application project links the compiled "bootloader.out" into the application project and places the bootloader code parts in a memory section defined in the application project's linker cmd file.
Now I have two problems which are bothering me:
- If I set the entry-point to the bootloader's _c_int00 function, the _c_int00 function of the application project will be omitted. At least I can't see it anymore in the application.map file. I need both _c_int00 functions to remain in the project.
- How do I get individual auto init functions (copy tables) for initialization of variables? At BOR-time the bootloader should initialize its own variables using its own autoinit function. After bootloader termination, the application _c_int00 should be called, causing the autoinit of the application being called.
-> Is it possible to tell the linker to merge these two projects in a way that they are totally independent?
-> Is there a better way to accieve my requirements using CCS?
I appreciate any help or suggestions which could help,
Regards,
Marcus