Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting Thread and Zigbee SDK #63

Open
KKoovalsky opened this issue Aug 9, 2020 · 2 comments
Open

Supporting Thread and Zigbee SDK #63

KKoovalsky opened this issue Aug 9, 2020 · 2 comments

Comments

@KKoovalsky
Copy link

Hello!

From that what I can see the Thread and Zigbee SDK has similar directory structure as the nRF SDK, but some of the components are missing and some of components are present only in the former.

The contributing guide explains how to support a new library to use within the "normal" SDK. Most probably to use another SDK some extra steps should be made or the existing steps should be made in another way. I could even try to contribute to support the Thread and Zigbee SDK, but I need support from the authors to take a look at the current project structure and say whether the normal approach is fine or no.

To support the Thread and Zigbee SDK we would need most probably to make some changes in the definition of the cache variables.

What do you think about that?

@Cierpliwy
Copy link
Contributor

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.

@datnguyen263
Copy link

have the problem solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants