9 years, 8 months ago.

How to execute another .bin file inside currently running bin file..?

Hi im wondering how can we do this...

inside while loop().. { execute(led_flash_bin.bin); execute(led_flash_2_bin.bin); } ..

how to execute an external .bin file or .elf file so that we can clearly saperate all of the functionalities... In the above problem alredy main .bin file is executing and it will call for another .bin file to do some work and it should move on..

It is like building a dynamic executable application for the mbed platform..( EX : Application.exe file windows...)

I would like to have something similar to this functionality. You might call this "partial download", where you don't download the whole program, only the code that changed. The code would be separate modules that are scheduled to execute at fixed intervals with different priorities. Of course you then need a mechanism for these modules to exchange data as input and output. The main program compiled bin file loads the external modules to be executed as interpreted code (not compiled), and perhaps this scripted code comes from an FTP server or is sent by a PC.

Perhaps a dynamic IAP that loads the scripted code into Flash memory like this: https://developer.mbed.org/users/Sissors/code/FreescaleIAP/

This Command Interpreter Library might be interesting: https://developer.mbed.org/forum/mbed/topic/1990/?page=1#comment-10386

Perhaps RPC is an option, but not really dynamic code injection: https://developer.mbed.org/cookbook/Interfacing-Using-RPC

This question talks about a scripting language: https://developer.mbed.org/questions/5449/Scripting-language/

This code uses LUA which might be an option: https://developer.mbed.org/forum/platform-38-FRDM-K64F-community/topic/5373/

Perhaps we need a scripting language interpreter or an interpreted language shell like: http://bitlash.net/

posted by -deleted- 17 Mar 2015

1 Answer

9 years, 8 months ago.

This is not possible, and in general you don't want that either. Just use seperate files in your project for seperate functionality.

Accepted Answer

Dear Erik ,,

Thanks for your quick reply..Im trying to do some tinkering in mbed so i just had a thought like as mentioned above..So since that is not possible, Can we call a function which is in another bin file or any other elf file or something like that.. so that dynamic execution of functions are possible..or else is there any other or loading functions dynamically into mbed os which is stored in the external file system..

posted by Naganand V 10 Mar 2015

While in theory it is possible to load a function from an external file system, it would be hard to create this function and hard to design this to work. I really would advice you not to do this, and solve your problem in another way.

posted by Erik - 10 Mar 2015