Handle different MBED_APP_* flags #122
-
In our setup, still using the old mbed-cmake, we usually work on our dev boards or prototypes. In this case, we can plug our STLink to flash our code directly. When doing full system tests, we need to send the update through BLE and have the product update itself using MCUBoot. Currently, if working on the dev board, we need to completely clean the project before building for OTA update as the When building for OTA update, we have: set(MBED_APP_FLAGS
-DMBED_APP_START=0x08041000
-DMBED_APP_SIZE=0x17E000
) Is it possible with mbed-ce to build both at the same time? We don't mind having to add 2 targets, Doing so would allow us to have |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Unfortunately, this isn't really possible, because those are global #defines -- any source file in Mbed could potentially use them, so if they change, the entire OS has to be rebuilt. What you could do, however, is make two CMake build dirs, and build both in parallel with different values of these defined. This could be done via the command line, or through CLion's ability to have multiple build dirs active at the same time. |
Beta Was this translation helpful? Give feedback.
-
ah of course! I don't know why I did not think about that earlier, it's exactly what we do for unit tests. Thanks for the feedback :) |
Beta Was this translation helpful? Give feedback.
-
@multiplemonomials I ended up doing what you said, using a different build directory to build our os with the flags enabled in parallel of the rest and then merge both the bootloader and the os. As we are using Make on top of CMake to call our different scripts, I was able to use other targets as dependencies so now it's as easy as For those interested: |
Beta Was this translation helpful? Give feedback.
Unfortunately, this isn't really possible, because those are global #defines -- any source file in Mbed could potentially use them, so if they change, the entire OS has to be rebuilt.
What you could do, however, is make two CMake build dirs, and build both in parallel with different values of these defined. This could be done via the command line, or through CLion's ability to have multiple build dirs active at the same time.