Description
Description of defect
I am unable to build a library from mbed-os
to link against when using a custom mbed_app.json
because the mbed_config.h
produced with the --library
option differs from a normally built application. This causes the application to fail to boot.
Additional Background
I have a project which produces multiple binary applications from a single codebase. I have been using the compiler --source
option to change which files are selected by mbed-os. For example (where folders foo
and bar
contain different main.cpp
files):
mbed compile --app-config mbed_app.json --source foo --source mbed-os
buildsfoo
mbed compile --app-config mbed_app.json --source bar --source mbed-os
buildsbar
However, this takes a long time due to the rebuild of mbed-os
library for each application. I would like to use the provided --library
option to build mbed-os
once then link my two applications aginst it. Similar to:
mbed compile --app-config mbed_app.json --source mbed-os --build BUILD/mbed-os --library --no-archive
builds thembed-os
librarymbed compile --app-config mbed_app.json --source foo --source BUILD/mbed-os --build BUILD/foo
buildsfoo
mbed compile --app-config mbed_app.json --source bar --source BUILD/mbed-os --build BUILD/bar
buildsbar
This process works but produces binaries that do not execute. Upon digging the resulting mbed_config.h
for step 1 vs steps 2 and 3 differ. Digging into the tools folder it appears that build.py
does not respect the app-config
CLI parameter.
Is this workflow expected to work, is there a better workflow that should be followed?
Target(s) affected by this defect ?
NUCLEO_F767ZI
Toolchain(s) (name and version) displaying this defect ?
GCC_ARM, 9-2019-q4-major, 9.2.1 20191025
What version of Mbed-os are you using (tag or sha) ?
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
mbed-cli, 1.10.2
How is this defect reproduced ?
- Create a fresh project.
- Create / edit the
mbed_app.json
configuration to change a parameter (platform.stdio-baud-rate
for example). - Build
mbed-os
usingmbed compile --app-config mbed_app.json --source mbed-os --build BUILD/mbed-os --library --no-archive
- Build app1 using
mbed compile --app-config mbed_app.json --source foo --source BUILD/mbed-os --build BUILD/foo
- The application does not execute correctly.