AnsweredAssumed Answered

Sharing functions between two pieces of code

Question asked by jdcowpland on Jul 7, 2015
Latest reply on Jul 7, 2015 by Clive One
My subject doesn't quite describe what I'm trying to do, but not quite sure how else to explain:

I have a bootloader stored at the start of flash in my STM32f415 (flash location 0x08000000), and my main application is stored further down the line (0x08010000). They both make use of several identical functions, and until now have I have just copied and pasted my C functions into each code base. What I'm now wondering though, is if I were to put these functions into a library file, could I store them at let's say 0x080A0000, and reference the library location to both files, thus saving me the space of including the library in both files? I've been looking into linker scripts and it looks like it might be right way to go (correct me if I'm wrong!) but I'm not quite sure how to implement it.

Any help or suggestions or pointers in the right direction would be greatly appreciated!

Outcomes