When I apply an Extra CMake build argument when creating a build configuration, it only takes effect on the first build, but none after that.
For example, I have added this code to my CMakeLists.txt file:
If I define JLINK_FLASH_BUILD in the Extra CMake Arguments part of the "Create Build Configuration", I can see that the image is built with the --confirm flag as expected. However, in an MCUboot based image with two partitions, the secondary image is NOT confirmed. The build log shows that the --confirm option is not set for the secondary image.
In addition, if I run a build from the command line, the same issue shows up. The secondary image is NOT confirmed, when it is expected to be so.
The overall issue is that in VS code, if I re-run a build where I expect the primary boot image to be confirmed with the --confirm flag, even the primary image is not confirmed.
This is easily reproduced by simply adding the above code to your CMakeLists.txt file, creating a build configuration and adding the extra CMake argument of "-DJLINK_FLASH_BUI
LD=TRUE". The initial image generated will be confirmed and boot properly. Subsequent builds of the same configuration will not be bootable.
This is using NCS v2.5.1.