AnsweredAssumed Answered

How to compile code into a library for stm32f4

Question asked by mccarty.michael on Sep 25, 2015
Latest reply on Sep 25, 2015 by Clive One
Hello All,
  Hope you are doing well Clive. Seems like the forums have spam in them ? All those Chinese chars with "university of xxyy" stuff ?

Anyway I've come back with another question. I have code that works well and is easy to use and interface with. I was wondering is there any way I can compile that code into a binary that people can simply link to and give the defines where my functions are ?

Basically I want people to be able to use all the functionality of the code but only through the interfaces that I specify so they are not overwhelmed with the entire code library. Similar to an OS.

I was thinking if I could just compile my code then the user could use their IDE to inject it into a certain location of the flash, then they could simply setup some pointers to where the functions now exist in flash and call them.

Lets say my code ends up at 0x9000 and I have my init function at 0x9100 I could include a header file that does stuff like
int (*functionPtr)(int,int);
functionPtr = 0x9100;

Then they could just call the functionPtr and call my code.

I know this may make a lot more sense to you guys, but to me its new. Anyone know how
I could do this sort of think using Keil ?

I would only have a few functions
HandleCommand(command, value)
AddCallBack(State, Callback)