Migration from SDK v2.7.0 to v2.8.0 (and v2.9.0) failing

We have a project that includes a custom board definition and out of tree driver with folder structure as follows:

.
├── boards
└── my_project
    ├── CMakeLists.txt
    ├── build_r01
    ├── drivers
    │   ├── display
    │   │   ├── ssd1322.c
    │   │   ├── ssd1322_regs.h
    │   │   └── zephyr
    │   │       ├── CMakeLists.txt
    │   │       ├── Kconfig
    │   │       ├── Kconfig.ssd1322
    │   │       └── module.yml
    │   └── brand
    │       ├── device.c
    │       ├── device.h
    │       └── zephyr
    │           ├── CMakeLists.txt
    │           ├── Kconfig
    │           ├── Kconfig.dcb1m
    │           └── module.yml
    ├── dts
    │   └── bindings
    │       ├── display
    │       │   └── solomon,ssd1322fb.yaml
    │       └── brand
    │           └── brand-device.yaml
    ├── prj.conf
    └── src
        ├── file1.c
        ├── file2.c
        ├── file3.c
        ├── inc
        │   ├── file1.h
        │   ├── file2.h
        │   ├── file3.h
        ├── main.c
 

Our project builds successfully with SDK v2.7.0 and toolchain v2.7.0

Upgrading the toolchain so we have SDK v2.7.0 and toolchain v2.9.0 works fine.

 

Upgrading the SDK so we have SDK v2.9.0 and toolchain v2.9.0 fails to build the application.

We see this at the end of the build output in the terminal:

CMake Warning at /opt/nordic/ncs/v2.9.0/zephyr/CMakeLists.txt:952 (message):
  No SOURCES given to Zephyr library: drivers__display

  Excluding target from build.


-- Configuring done
-- Generating done
-- Build files have been written to: /my_project/build_r01/my_project
-- Configuring incomplete, errors occurred!
See also "/my_project/build_r01/CMakeFiles/CMakeOutput.log".
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/toolchains/b8efef2ad5/bin/cmake -DWEST_PYTHON=/opt/nordic/ncs/toolchains/b8efef2ad5/opt/[email protected]/bin/python3.12 -B/my_project/build_r01 -GNinja -DBOARD=my_board_r01 -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/ -S/opt/nordic/ncs/v2.9.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/my_project

As can be seen, the drivers in the src folder (which are referenced from the board definition) are not being found.

If we roll the SDK back to v2.7.0 the same project builds ok again so this is definitely a difference between v2.7.0 and what follows.

Please note we also tried with v2.8.0 with the same result as v2.9.0 so wherever I have mentioned v2.9.0 I also tried the same with v2.8.0

So, the breaking change seems to have occurred between v2.7.0 and v2.8.0 and the breaking change remains in v2.9.0 

Parents
  • Hi,

    Can you show your build commands when using different NCS versions?

    Have you tried to use --no-sysbuild option when building with west in NCS v2.8.0 and v2.9.0? Do you see any difference in the result?

    Best regards,
    Dejan

  • I have tried --no-sysbuild and the build still fails in anything later than v2.8.x and v2.9.x

    Generated Build Commands Shown Below...


    Toolchain: v2.9.1

    SDK: v2.7.0

    Status: OK

    Build Command:

    west build --build-dir /Users/me/Code/MyCompany/Firmware/Nordic/my_project/build_r01 /Users/me/Code/MyCompany/Firmware/Nordic/my_project --pristine --board MyCompany_ka0052_r01 -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/me/Code/MyCompany/Firmware/Nordic


    Toolchain: v2.9.1

    SDK: v2.9.1

    Status: FAILS

    Build Command:

    west build --build-dir /Users/me/Code/MyCompany/Firmware/Nordic/my_project/build_r01 /Users/me/Code/MyCompany/Firmware/Nordic/my_project --pristine --board MyCompany_ka0052_r01 --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/me/Code/MyCompany/Firmware/Nordic


    Toolchain: v2.9.1

    SDK: v2.9.1 (NO SYSBUILD)

    Status: FAILS

    Build Command:

    west build --build-dir /Users/me/Code/MyCompany/Firmware/Nordic/my_project/build_r01 /Users/me/Code/MyCompany/Firmware/Nordic/my_project --pristine --board MyCompany_ka0052_r01 --no-sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DBOARD_ROOT=/Users/me/Code/MyCompany/Firmware/Nordic

  • Also, with sdk v2.9.1 (no sysbuild) I get a CMakeError.log file.

    For some reason this system fails when I upload it but its content is:

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x34): undefined reference to `_exit'
    collect2: error: ld returned 1 exit status
    
    
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-g++ 
    Build flags: 
    Id flags:  
    
    The output was:
    1
    /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld: /opt/nordic/ncs/toolchains/b8efef2ad5/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/lib/libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x34): undefined reference to `_exit'
    collect2: error: ld returned 1 exit status
    
    
    

  • Hi,

    Have you kept the same CMakeLists.txt file both in NCS both v2.7.0 and v2.9.1?

    There is no drivers/proprietary/ folder in your directory structure, but it is used in your CmakeLists.txt as ${CMAKE_CURRENT_SOURCE_DIR}/drivers/proprietary. Can you elaborate on this?

    Have you tried to include 

    # Include the directory containing the header file
    zephyr_include_directories(${driver_SOURCE_DIR})

    in your CMakeLists.txt?

    Best regards,
    Dejan

  • I confirm that `CMakeLists.txt` is identical for both v2.7.0 and v2.9.1. They are the same project so no files are changing. The only thing I change is the Build Configuration using the VS Code interface.

    Because this is a public forum there are some details I am renaming before I send the logs... my apologies, in the directory tree structure I have a path `brand` it is this that is called `proprietary` in the logs. The folder exists and the folder structure is identical for v2.7.0 and v2.9.1 all I am changing is the Build Configuration using the VS Code interface.

    I have zephyr_include_directories in each Driver's CMakeLists.txt file. Example attached.

    I also added the following line to the main project'sCMakeLists.txt file but it did not fix / change anything.

    zephyr_include_directories(drivers/display drivers/brand)

    if(CONFIG_DISPLAY)
      # Add .h files to the set of global include paths.
      zephyr_include_directories(..)
    
      zephyr_library_amend()
      zephyr_library_sources_ifdef(CONFIG_SSD1322		../ssd1322.c)
    endif()

  • Hi,

    Can you make a minimal sample which would demonstrate this behavior so that I can try to reproduce this issue on nrf52840-dk?

    Best regards,
    Dejan

  • Hey Alex,

    I had a similar error to this today because in my own custom "flash.c" and "flash.h" I had defined the module logging prefix as "flash". With `LOG_MODULE_REGISTER(flash);`

    This apparently conflicts with a similar definition in zephyr /workdir/zephyr/drivers/flash/flash_util.c.

    When I changed it, the error was resolved.

    Hope this helps you.

    Clayton

Reply Children
No Data
Related