1 week, 1 day ago.

How to change a file like targets.json in online compiler?


I have to modify some parameters in the targets.json file to suite my needs. Therefore I import mbed-os. Import window -> Import from url Problem in the import window: Library "/.../mbed-os.lib" already exists.

I also tried the very same with an mbed 2 project. mbed-dev was succesfully imported, and targets.json modified. However while compiling following error occurs: Error: Library name 'platform' is not unique (defined in '/extras/mbed_a330f0fddbec/TARGET_NRF52_DK/mbed_lib.json' and '/src/mbed-dev/platform/mbed_lib.json')

Any suggestions? Thanks P.

Did you delete the existing mbed-os.lib from your program tree? Also importing from ARMmbed/mbed-os will pull in a released version of Mbed OS. To work on different branches or modify contents, you need to fork this program on Github and import from your user account URL. As for mbed 2, it again seems that you have mbed + mbed-dev in thr program tree

posted by Sam Grove 13 Sep 2017

By removing the original "mbed" node, leaving only the imported "mbed-dev" in place, the program can indeed be successfully compiled. In this way I can modify the contents of any file under "mbed-dev" while being online and recompile it with the new settings. I actually tested this with targets.json, and it works! Much easier than switching to command line tools like CLI. Thank you Sam for pointing this out!

posted by Peter Molnar 13 Sep 2017
Comment on this question

1 Answer

1 week, 1 day ago.

Online compiler has program size limitations and mbed-os codebase is too big to fit and therefore imports as a library only. Mbed CLI is the way to go for what you are trying to achieve.

To post an answer, please log in.