Before asking the question let me please provide some background:
I was reading through a technical article regarding Autosar architecture which suggested a Plug and Play approach for Application layer software components. Basically the article suggested that you can partition the memory into separate components and program /flash only those components that have been modified instead of the entire software image. This will save some reprogramming time during a visit to the dealer. Now since there could be a change in the address of the functions which are getting reprogrammed this would cause issues when these modified functions are called by functions which lie in another partition (section of the memory). The article proposes a solution to this approach by using a jump /indirection table which lies at a fixed address and contains an address of the updated function.
Now let me come to the question part :
I was thinking about this problem not from Autosar architecture but from an embedded engineer perspective and thought although this approach would work it would add to increase in throughput. Another option that I thought could be used is probably function pointers. But then I thought in normal scenario, it is the linker that replaces the function symbol name with its actual address and hence the scenario in which the function A (which lies in unchanged partition) is initialized to function B (which lies in updated partition and probably at different address) will not work.
This finally brings me to my final questions:
- Will the approach of function pointers work? (I think it probably would not.)
- If the answer to the above question is no, can I still use function pointer approach by say keeping all the function pointers at fixed address and using a script and map file to patch the actual address.
I thank all of you who were patient enough to go through such a long question. I wish I could come up with a smaller question.