GithubHelp home page GithubHelp logo

Comments (2)

Cierpliwy avatar Cierpliwy commented on July 3, 2024

I think there are a lot of changes required to support different SDK packages. I'm sure that a similar directory structure makes it doable with some effort. Let's look at a few places to get a grasp of a job to be done.

1. JSON definitions

I think that the core of the project are JSON definitions located at ./ci/libraries/ folder. You can check schema inside ./ci/scripts/python/nrf5_cmake/library_description.py file. The most important property is sdk_version:

"nrf5_ble_gq": {
    "documentation": "BLE GATT Queue library",
    "variant": "object",
    "sdk_version": {
      "from": "16.0.0"
    },
    "sources": [
      "components/ble/nrf_ble_gq/nrf_ble_gq.c"
    ],
    ...

It assumes that library definition applies to all nRF SDKs with a version above 16.0.0. If it's missing then it's assumed that there are no SDK requirements. Support for Zigbee will require us to:

  • Add new SDK versioning with a possibility to specify that library is not supported at all (missing zigbee_sdk_version or sdk_version version prop?):
"nrf5_ble_gq": {
    "documentation": "BLE GATT Queue library",
    "variant": "object",
    "sdk_version": {
      "from": "16.0.0"
    },
    "zigbee_sdk_version": {
      "from": "4.1.0"
    },
  • Add cache variable so that we can detect what kind of SDK is used.
  • Specify how patches are applied across SDKs:
    Probably patch will be applied based on the knowledge if zigbee_sdk_version/sdk_version property is present or not.
...
"patches": [
      {
        "operation": "add",
        "sdk_version": {
          "from": "16.0.0"
        },
        "zigbee_sdk_version": {
           "from": "4.1.0"
        },
        "dependencies": {
          "public": [
            "nrf5_ble_gq"
          ]
        }
      }
    ]

2. Python scripts

All changes to the JSON schema should be propagated in all Python scripts, which currently assume that there is only one SDK available.

3. Templates

We should propagate SDK versioning to the templates and modify generated conditionals:

Instead of:

if(NRF5_SDK_VERSION VERSION_EQUAL 16.0.0)
  target_link_libraries(nrf5_ble_db_discovery PUBLIC
    nrf5_ble_gq
  )
endif()

we will end up with something like:

if((USES_NRF5_SDK and NRF5_SDK_VERSION VERSION_EQUAL 16.0.0) or ((USES_ZIGBEE_NRF5_SDK and NRF5_ZIGBEE_SDK_VERSION VERSION_EQUAL 4.1.0)))
  target_link_libraries(nrf5_ble_db_discovery PUBLIC
    nrf5_ble_gq
  )
endif()

4. SDK validation

We need to maintain separate validation checks for Zigbee SDK. Currently they are described in the ./cmake/nrf5_helpers.cmake file.

5. CI setup

We need to adjust all scripts used by a CI and compile & tests all libaries/examples used in the new SDK.

from cmake-nrf5x.

datnguyen263 avatar datnguyen263 commented on July 3, 2024

have the problem solved?

from cmake-nrf5x.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.