Build configuration stale AGAIN (unrecoverable)

This happens quite often, I simply has to create a new build configuration and in worse cases simply a new application and copy all my sourcefiles over to the new project.

This time I have a little info on what actually happened.

I have been working on this project for the last days, without any problem. Everything is latest version SDK, toolchain, VS code etc.

My project is under git control so I can see what is changed!

 - I did a small mistake when modifying the device tree which is in a seperate boards directory and also in git. This caused the application project to not build because of DTS problem.

 - I immediately fixed the problem but when trying to build my application VS Code terminal kept telling me that a build was already active so I could not start a build. I waited, tried to clean the build configuration and other things for 30 minutes. Unable to get out of the state that the system thought there was an active build in progress. 

 - So finally I exited VS Code and restarted.

 - Now it opens with "The build configuration is stale. Run a prestine build". But this is not possible i get the following:

.... <next message>

For some reason it is impossible to get my project back in working condition.

I can see that there is a CMake warning followed by the error that configuration is incomplete!

There are no changes to my code or makefiles for the project.

This must be something in the build directory (that is excluded from git...) and it happens caused by a build error.

I am reporting this in the hope that Nordic some day will look at the unstable environment issue. This is something that happens way too often and I see others writing about it also. This is propably just an example of what can go wrong. In this case I think that making a new build configuration will solve the problem, but it is not nice. I have projects with many "dead" build configurations and I loose development time, every time it happens.

Parents
  • Hi

    I'm new to nrfConnect and installed V3.0 on a Linux Mint.I'm struggling with the definition of my custom board and the problem description fits my observations. Sometimes I'm just stuck with my board, sometimes even the build vanishes from Nordic extension view of the project (the build directory still exists but project does not show the build anymore).

    One easy way to demonstrate part of the problem:
    a) create a new application from hello world sample
    b) build it for nrf52840DK - everything is fine
    c) add the following lines to prj.conf (yes, we will get errors, this is important)

    CONFIG_GPIO=y
    CONFIG_I2C=y
    CONFIG_SPI=y
    
    
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_CDC_ACM=y
    CONFIG_USB_CDC_ACM_LOG_LEVEL_INF=n
    CONFIG_USB_DEVICE_LOG_LEVEL_INF=n
    
    
    CONFIG_SERIAL=y
    CONFIG_UART_CONSOLE=n
    CONFIG_USB_UART_CONSOLE=n
    CONFIG_SHELL_BACKEND_SERIAL=n
    CONFIG_LOG_BACKEND=n
    
    
    CONFIG_USB_DEVICE_PRODUCT="Heureka CDC ACM sample"
    CONFIG_USB_DEVICE_PID=0x0001
    

    start a "Pristine Build" and we get the expected FATAL ERROR.
    The point is: the spinning icon left of the build stops.

    start a second "Pristine Build" and we get the expected FATAL ERROR again.
    But this time the icon left of the build keeps spinning.

    I start a third "Pristine Build" and in the terminal I get:
    > Another task is currently building this configuration, closing.

    I'm afraid we might have overlapping issues which make it hard to pinpoint the cause.
    But I guess this phenomenon might be part of the problem.

    I can confirm that using the dialog to edit the build configuration helps a lot as does
    - stop VS code
    - remove build directory
    - restart VS code and create a new build

    hope this helps

    Peter

  • Trying to build on v3.0.1 and having similar issues, Have to close down and setup build from scratch to rebuild...
    looking for a solution...

  • Hi,

    Which operating system do you use?

    Which versions of VS Code and nRF Connect for VS Code extension do you use?

    Best regards,
    Dejan

  • I am using nrf Connect 2025.5.152 (but this is very new and I have not seen the problem yet in this one).

    VS code is 1.100.2

  • The problem is trivial to reproduce: Just kill the build process early during initial or pristine build. 

    Result is a build dir thats completely unusable in VS code (and won't even be detected when you restart the IDE).

    Fix is surprisingly difficult to figure out as it requires west command line usage - which a dev normally does not need to touch much. I had trouble finding the button that opens a terminal where "west" is  recognized as a command...

    I recommend adding a chapter in the documentation about this (or adding a link if one exists and I just missed it). 

    Or even better: Add some more error handling to the code that detects and handles build folders. 

  • Hi,

    Turbo J said:

    I recommend adding a chapter in the documentation about this (or adding a link if one exists and I just missed it). 

    Or even better: Add some more error handling to the code that detects and handles build folders. 

    I have forwarded your recommendation internally. For now, only option to recover from situations like this is to delete build folder manually.

    Thomas said:
    I am using nrf Connect 2025.5.152 (but this is very new and I have not seen the problem yet in this one).

    Do I understand correctly that your problem is not present anymore with this version of extension?

    Best regards,
    Dejan

  • As far as I know, the problem is still there.

Reply Children
  • Hi  ,

    dejans said:
    Thomas said:
    I am using nrf Connect 2025.5.152 (but this is very new and I have not seen the problem yet in this one).

    Do I understand correctly that your problem is not present anymore with this version of extension?

    Thomas said:
    As far as I know, the problem is still there.
    I immediately fixed the problem but when trying to build my application VS Code terminal kept telling me that a build was already active so I could not start a build. I waited, tried to clean the build configuration and other things for 30 minutes. Unable to get out of the state that the system thought there was an active build in progress. 

    What exactly did you modify and how did you immediately fix the problem? Can you please describe the problem in more detail? Can you provide exact steps with screenshots so that I can try to reproduce your exact issue?

    Best regards,
    Dejan

  • Lets say it was a syntax error in the DTS file. So create a syntax error in a DTS file for the board. Make a prestine build, the build will fail. And the build will be STALE. If you fix you syntax error in the board DTS the problem should be fixed, but the build is no longer available.

    But as Turbo J is writing, it should be easy to reproduce, just kill the build process early. 

  • Create a project from scratch based on hello_world.

    Selected nrf9151dk/nrf9151dk as board.

    Build the project.

    Now add a devicetree overlay called error.dts. Put some garbage in the file.

    In the build configuration select Generate and Build and close the view.

    Now you get a build error: 

    -- Configuring incomplete, errors occurred!
    See also "D:/Workspaces/hello_world_5/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'D:\ncs\toolchains\0b393f9e1b\opt\bin\cmake.EXE' -DWEST_PYTHON=D:/ncs/toolchains/0b393f9e1b/opt/bin/python.exe '-Bd:\Workspaces\hello_world_5\build' -GNinja -DBOARD=nrf9151dk/nrf9151/ns -DDTC_OVERLAY_FILE=error.dts -DBOARD_ROOT=d:/nrfboards '-SD:\ncs\v3.0.2\zephyr\share\sysbuild' '-DAPP_DIR:PATH=d:\Workspaces\hello_world_5'

    * The terminal process terminated with exit code: 1.
    * Terminal will be reused by tasks, press any key to close it.

    The build configuration is gone:


    This is of course not how it happens normally, it would be a real board DTS and it would be a real project.

    You are unable to get the build configuration back, and will have to create a new one.

Related