Upgrading to NCS V2.2.0

I'm in the process of upgrading my NCS from V2.0.0 to V2.2.0, but am noticing that many of my #include's from code that built OK on v2.0.0 aren't being found in v2.2.0.

I'm guessing there is some setting I need to add/change to make things work, but I've no idea where to start looking.

The following shows some of the includes I've had to modify to get things to build correctly.  Is this strictly necessary?  Or can I address all of this with a suitable inclusion/change in my CMakeLists.txt file

<zephyr.h> change to <zephyr/kernel.h>
<sys/printk.h> change to <zephyr/sys/printk.h>
<device.h> change to <zephyr/device.h>
<drivers/i2c.h>  change to <zephyr/drivers/i2c.h>
<bluetooth/gatt.h> change to <zephyr/bluetooth/gatt.h>
<bluetooth/uuid.h> change to <zephyr/bluetooth/uuid.h>
<bluetooth/bluetooth.h> change to <zephyr/bluetooth/bluetooth.h>
<bluetooth/hci.h> change to <zephyr/bluetooth/hci.h>
<bluetooth/conn.h> change to <zephyr/bluetooth/conn.h>

This is my CMakeLists.txt file as it stands currently:

# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(LSR-MAX)

# Source Files
FILE(GLOB app_sources src/*.c src/*.h)
target_sources(app PRIVATE ${app_sources})
zephyr_include_directories(src)

#zephyr_library_include_directories(${ZEPHYR_BASE}/samples/bluetooth)
zephyr_library_include_directories(${ZEPHYR_BASE})

Thanks,

Mike

Parents
  • Hi Mike,

    The samples we have in our SDK have the includes added properly to the build structure and when building manually or using Visual Studio Code you find that all samples builds properly. But if you have structured your project differently or building it in a different way or pulled in some other dependencies into the project to add new features, then it is normal that we need to add those dependencies into the CMakeLists.txt file. 

    So, your changes in the CMakeLists.txt file should have been pulled by the KConfig inclusion of those modules you tried to pull in your proj.conf file. Can you attach your project here so that I can quickly check if you pulled in your new dependencies in the right way into the proj.conf?

Reply
  • Hi Mike,

    The samples we have in our SDK have the includes added properly to the build structure and when building manually or using Visual Studio Code you find that all samples builds properly. But if you have structured your project differently or building it in a different way or pulled in some other dependencies into the project to add new features, then it is normal that we need to add those dependencies into the CMakeLists.txt file. 

    So, your changes in the CMakeLists.txt file should have been pulled by the KConfig inclusion of those modules you tried to pull in your proj.conf file. Can you attach your project here so that I can quickly check if you pulled in your new dependencies in the right way into the proj.conf?

Children
Related