We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi All,
CPU: STM32F10x cortex-m3. Keil compiler.
I wonder if anyone can point me in the right direction?
What I need to do is build a system that is made up of a core with modules that will be plugged in at a later point in time. I.E. the core will be compiled and run able, the product will then be configured for it specific variation by placing modules in memory for it to use. The modules will not be dynamic loaded, apart from at initial boot up where these modules will be resolved and hooked in.
The core will consist of the RL-RTX os, some basic house keeping tasks and base functionality that is able to hook into the added modules.
I guess in GNU/linux Id be using insmod or in windows a DLL, SMX by micro devices has dynamic load module facility which I think is a bit more than I need.
Any ideas how to do this?
Regards, DaveE
You need to, or you want to?
You need position-independent code for the modules.
But you will quickly run into troubles with the dynamic linking. Getting a plugin to find a function in the main application or getting the core to find an exported function in the module. If the number of functions in each direction is limited and of fixed format, then you can use pre-created pointer tables. If not, then you will quickly have to learn to read elf data, or map files.
A big problem is where a module would store own global variables, unless all functions in the module takes a pointer to a raw memory block and then typecasts it into a pointer to a struct.
In the end, it is just a question about how much time you are willing to spend on the concept. If you don't know how to do it, then you will also have to factor in the time it would take to learn how to do it.
Thanks, you have confirmed the problems that were on my mind.
need or want, I want(ed) to do it because I need to find a way of controlling variants of a product without having all variants either built in or requiring a build and link stage with the core using #defines to control the variations.
I also needed to find a way of changing langauges without rebuilding or raw hacking of the binary image. I can see however that a vector table to a fixed area would work for the language strings though.
Thanks again