I am in the process of implementing over-the-air updates on a CC2652 microcontroller using the OpenThread stack. As far as I know a bootloader has to be able to operate independently from the application and be as small as possible. But for the bootloader to download the new firmware by itself it will have to implement the OpenThread stack which will add quite a lot to its size.
I was wondering if it is possible to share the OpenThread stack between the two. I have heard it is possible to place the functions of the library in a specific place in memory and to then share the address with the application but I don't know how to do this. How can I assign a specific region in memory to a library and how can I tell two separate applications, the bootloader and the real application, to use this region?