Where is mbed_app.json located?

Hi,

I use Mbed studio 1.3.1 with mbed-os 6 (win10 64bit).

I want to modify my application configuration in mbed_app.json file to override the parameter target.printf_lib with the value std. But I don’t understand where is this file located in my project. Where should this file be located?

Hi Mikhail,

Ideally, mbed_app.json file should be located in the root folder of your program. You can find a good example of that file in this repository: GitHub - ARMmbed/mbed-os-example-pelion: Mbed OS example for Pelion Device Management

Thanks,
Arek - Mbed Studio team

1 Like

Do I need to create this file manually? If I create an empty project or a project with an example (blink in MBED OS6) it will be created without this file.

Hi Mikhail,

At the moment you need to create it manually. The official Blinky example (GitHub - ARMmbed/mbed-os-example-blinky: Blinky example for Mbed OS 6.0) does not contain this file in the repository. That’s why you do not see it when creating a new Blinky program.
We are considering adding a generator wizard and special viewer for this file in Studio in the future.

Thanks,
Arek - Mbed Studio team

2 Likes

Once I create the mbed_app.json file and include it in the root folder of my program, do I also need to include it in main.cpp with an include statement?

Hello,

nope it is not required and it is not possible.
The .json files are here for configuration of the MbedOS and these settings are converted to preprocessor macros (mbed_config.h in build folder of your project) during MbedOS build phase. That also means how you change these settings in a .json file, then whole MbedOS must be recompiled.

BR, Jan

1 Like