Hello Pascal,
I tried this approach, of creating a library, but have found a few problems that will make this way of "sharing" the functions not useful for my needs, and would like to share with you, so then maybe we all can reach some solution.
The first issue was that when I build the target bootloader with the library, CodeWarrior generate a code that works for this project, that means, the struct variables of USB stack (CMX) my_address has their address in RAM memory built by the compiler.
But when I do the same with the firmware application, de compiler generate a very few different code, and the difference is in the address of the struct variables in the RAM memory. So, as I include a bootloader.bin in the main application linker, it makes somes functionalities of the USB stack not work properly.
The second issue is that this library I made (with the CMX USB stack and the CMX FAT) is the one responsible for making the linker allocate the functions that handles variables types, like int_to_d.o for example: (from the xMap)
| 0000A4B4 00000000 .text _d_utod (Project_usb_library.lib int_to_d.o | ) |
And so, when I make some changes in the firmware, lets say, add some float variables, the float treatment functions will be added by my USB library, that is inside the "bootloader area", wich should not be changed.
I hope I could express myself, so that you can understand my problem.
Thanks for your support
Felipe