This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/AM3358: Jump into external binary / shared library-like calls

Genius 5820 points
Part Number: AM3358


Tool/software: TI C/C++ Compiler

Hi,

I already posted a similar but less detailed question in StarterWare forum but the more I think about it the more it seems to be a compiler thingy for me.

I want to extend my barem-metal application by some kind of rudimentary shared library function.  This is what I think how it could work:

  • the main application loads a second application to a fixed address in RAM
  • this second application provides some functions ad fixed addresses
  • now the main application from time to time jumps to one of these addresses which return after they have done whatever

My questions here:

  • is this possible in such a way?
  • if yes: how can I allocate RAM at a fixed address or how else should I load the second application to a fixed address?
  • how can I compile this second application in a way where some functions are located at predefined adresses/address offsets? Some tricks with a linker command file?

Thanks!

  • There are no features in the TI ARM compiler which directly support your use case.  It might be possible to hack something together.  But I dislike the lack of robustness which usually accompanies such attempts.

    I have a rather different idea to suggest.  Reading your other post in the Starterware forum is what sparked this idea. How about you make your code a library that is called by your customer?  Everything is supplied in a static object code library, except for a small amount of C/C++ code which shows how to use your library in a simple default manner.  It would be straightforward for your customer to add their own code, and form a final executable.

    Thanks and regards,

    -George