SDK v2.5.99-dev1 has many compile errors

Hello,

I am working on a Mac mini, Apple M2 chipset, macOS Sonoma 14.2.1.   I am using Visual Studio Code Version: 1.86.2 (Universal) Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda
Date: 2024-02-13T19:42:13.651Z Electron: 27.2.3 ElectronBuildId: 26908389 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin arm64 23.2.0

I have been developing code on the nRF52840 DK for several months using SDK v2.5.0.   I recently downloaded SDK v2.5.99-dev1

After successfully building with SDK v2.5.0, I remove the build directory, change the active SDK to 2.5.99-dev1, create a new Build configuration (the same way I did for v2.5.0 SDK), and then build.   I get many compile errors like this:

../../../../../../../opt/nordic/ncs/v2.5.99-dev1/modules/lib/matter/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp: In member function 'CHIP_ERROR chip::app::Clusters::UnitTesting::Structs::TestFabricScoped::DecodableType::Decode(chip::TLV::TLVReader&)':
../../../../../../../opt/nordic/ncs/v2.5.99-dev1/modules/lib/matter/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp:20334:37: error: 'class chip::app::Clusters::detail::StructDecodeIterator' has no member named 'Next'
20334 |         auto __element = __iterator.Next();
      |                                     ^~~~
../../../../../../../opt/nordic/ncs/v2.5.99-dev1/modules/lib/matter/zzz_generated/app-common/app-common/zap-generated/cluster-objects.cpp:20335:18: error: 'holds_alternative' is not a member of 'std'
20335 |         if (std::holds_alternative<CHIP_ERROR>(__element))
      |                  ^~~~~~~~~~~~~~~~~

Parents
  • Hi,

    I will look into this

    However the build error state that the Clusters and structs have changed since you last compiled it. Have you examined the changes from 2.5.99-dev1 and v2.5.0 w.r.t this aspect?

    Is your application custom or is it based on a sample found in the SDK? If so, which sample? Do you see the same thing if you try to take a sample from NCS v2.5.0 and compile it in the 2.5.99-dev tag?

    Kind regards,
    Andreas

  • Andreas,

    Thanks for the reply.  I will look at the release notes for version 2.5.99-dev1 branch and see there are any indications for the issue I am seeing.

    The code that I am building is based on the nrf/samples/matter/template sample code.

    Any other thoughts?

    Best Regards,
    Gene

  • Hello again,

    I was able to perform the following experiment with the v2.6.0 SDK:

    1.  WELCOME -> Create a new application -> Copy a sample -> Matter Template

    2. Add Build Configuration
        Board = nrf52840dk_nrf52840
        Configuration = prj.conf
        Add Devicetree overlays:  boards/nrf52840dk_nrf52840.overlay

    3. Build Configuration

    I seem to get the same failure as last time:

    -- Zephyr version: 3.5.99 (/opt/nordic/ncs/v2.6.0-rc1/zephyr), build: v3.5.99-ncs1-rc1
    [173/173] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       26618 B        28 KB     92.84%
                 RAM:         18 KB       256 KB      7.03%
            IDT_LIST:          0 GB        32 KB      0.00%
    [11/732] Generating new Factory Data...
    FAILED: zephyr/factory_data.json /Users/puzl/nrf/template_1/build/zephyr/factory_data.json
    cd /Users/puzl/nrf/template_1/build/modules/connectedhomeip && /opt/nordic/ncs/toolchains/580e4ef81c/opt/[email protected]/bin/python3.9 /opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py --sn 11223344556677889900 --date 2022-01-01 --vendor_id 65521 --product_id 32768 --vendor_name Nordic\ Semiconductor\ ASA --product_name not-specified --hw_ver 0 --hw_ver_str prerelease --dac_cert /opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/credentials/development/attestation/Matter-Development-DAC-FFF1-8000-Cert.der --dac_key /opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/credentials/development/attestation/Matter-Development-DAC-FFF1-8000-Key.der --pai_cert /opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/credentials/development/attestation/Matter-Development-PAI-FFF1-noPID-Cert.der --spake2_it 1000 --spake2_salt U1BBS0UyUCBLZXkgU2FsdA== --discriminator 0xF00 --passcode 20202021 --include_passcode --overwrite --product_finish other --generate_onboarding --enable_key 00112233445566778899AABBCCDDEEFF -o /Users/puzl/nrf/template_1/build/zephyr/factory_data.json -s /opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/nrfconnect_factory_data.schema
    [INFO] Generating SPAKE2+ Verifier...
    Traceback (most recent call last):
      File "/opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py", line 577, in <module>
        main()
      File "/opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py", line 573, in main
        generator.generate_json()
      File "/opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py", line 277, in generate_json
        spake_2_verifier = self._generate_spake2_verifier()
      File "/opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/nrfconnect/generate_nrfconnect_chip_factory_data.py", line 380, in _generate_spake2_verifier
        return generate_verifier(self._args.passcode, self._args.spake2_salt, self._args.spake2_it)
      File "/opt/nordic/ncs/v2.6.0-rc1/modules/lib/matter/scripts/tools/spake2p/spake2p.py", line 51, in generate_verifier
        return w0.to_bytes(NIST256p.baselen, byteorder='big') + L.to_bytes('uncompressed')
    AttributeError: 'Point' object has no attribute 'to_bytes'

    Any further thoughts?

    Thanks,
    Gene

  • I have a similar issue:

    [22:08:04] nRF Command Line Tools 10.24.0 are up to date
    [22:08:09] =========== Toolchain validation report for nRF Connect SDK Toolchain v2.6.0 ===========
    Package Using the nRF Connect SDK v2.6.0 at /home/kammutierspule/ncs/v2.6.0
    Clock3 dtc is outdated. Found 1.5.0, but 1.5.1-1 is required by the SDK.
  • Hi Gene,

    Gene Roylance said:
    2. Add Build Configuration
        Board = nrf52840dk_nrf52840
        Configuration = prj.conf
        Add Devicetree overlays:  boards/nrf52840dk_nrf52840.overlay

    In step 2: You don't need to specify the configuration and the device tree overlay. If you use "System default", then the build system will use the prj.conf that exists in the source folder. Next it will look at the board you've selected, and if it is a board file that is supported in the SDK out of the box, it will use the default board files located in https://github.com/nrfconnect/sdk-zephyr/tree/main/boards/arm/, for instance the nRF52840DK

    After it has found this board, it will use this to configure the board and next look for any overlay files within your project. The build system will always use <your_board>.overlay if it exists. In this case it does exist within boards/nrf52840dk.nrf52840.overlay, so it will automatically be included.

    This is explained in greater detail under the Configuration and building pages in our documentation as well as in our academy pages, more specifically in the first 3 lessons in https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/ 

    When you at a later point in time might get to adding a custom board to your projects, we also have documentation for this. Lesson 3 in the intermediate course also shows how to do this: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/ 

    The following configuration resulted in a successful build with no warnings on my end (Windows 10, NCS 2.6.0, Toolchain v2.6.0):

    Let me know if you are successful with building the Matter template sample with a similar build configuration as showed in the image above

    Kind regards,
    Andreas

  • Hi kammutierspule, 

    Could you please create a new case and raise your question there with more details.

    Kind regards,
    Andreas

  • Hi Andreas,

    I am replying to you on behalf of Gene R. as he is away for a few days. I did an experiment with my MacBook (M1) migrated to the Nordic v.2.6.0 toolchain/SDK and I was able to successfully import the Nordic template sample and successfully build it. I wanted to give you that feedback.

    When Gene gets back we'll take a fresh look at his machine setup and then start migrating our PuzL Labs Matter app (similar to the older v2.5.2 template app). We'll glance at the following links along the way:

    Nordic v2.6.0 Release Notes:
     
    Nordic v2.6.0 Migration Quide:
    Thanks much,
    Steve K, PuzL Labs, LLC
Reply Children
  • Hi Steve,

    Thank you for the update and letting me know that you were able to compile the sample in NCS v2.6.0.

    Please let me know if you have any other questions related to this topic when Gene gets back and feel free to open any new cases with questions regarding migration of your firmware from 2.5.2 to 2.6.0. 

    Kind regards,
    Andreas

  • Andreas,

    I went through the Release Notes and the Migration Guide but saw nothing that would explain the Factory Data generation error that I have been seeing.   So, I tried updating a Linux version of the VSCode and nRF Connect system to v2.6.0 and that was able to build the Matter Template sample without any errors.

    I decided to go back to my Mac system and remove the Toolchain and SDK and try to install it again.  Unfortunately, I removed the toolchain directory with a terminal command instead of using the Uninstall or Toolchain Manager Remove function.  I cannot manage to get the v2.6.0 toolchain to install using commands in either the Toolchain Manager or the Visual Studio Code's NRF CONNECT extension.  Is there a way to force the re-installation of the v2.6.0 toolchain tools?

    Thanks,
    Gene

  • Andreas,

    I was looking over my last reply and realized that I neglected to report an important result.  I did try the configuration that you suggested on March 21st before I tried the experiments on my Linux computer and trying to re-install v2.6.0 on my Mac.  The configuration that you suggested did not make any difference in the build.  I still had the Factory Data generation failure that I reported on March 20th.

    Best Regards,
    Gene

  • Greetings all,

    I have a couple of updates.  First of all, I was able to restore my deleted toolchain and SDK file by doing the following (restore the directory from the download file):

    1.  cd /opt/nordic/ncs/toolchains
    2. cp ../downloads/ncs-toolchain-aarch64-macos-580e4ef81c.tar.gz .
    3. gunzip ncs-toolchain-aarch64-macos-580e4ef81c.tar.gz
    4. mkdir 580e4ef81c
    5. cd 580e4ef81c
    6. tar -xvf ../ncs-toolchain-aarch64-macos-580e4ef81c.tar

    I then opened up the "nRF Connect for Desktop v4.4.1" and then opened the Toolchain Manager v1.3.1 and then under the "nRF Connect SDK v2.6.0", I selected the optional action of "Remove".

    After I correctly uninstalled the v2.6.0 toolchain and SDK, I tried to re-install the SDK in Visual Studio Code app using this process:

    a.  click the NRF CONNECT extension tab
    b.  ran WELCOME -> Manage toolchains -> Install Toolchain -> nRF Connect Toolchain v2.6.0
    c.  selected WELCOME -> Manage toolchains -> Set Active Toolchain -> nRF Connect SDF Toolchain v2.6.0
    d.  ran WELCOME -> Manage SDKs -> Install SDK -> v2.6.0
    e.  selected WELCOME ->  Manage SDKs -> Set Active SDK -> nRF Connect SDK v2.6.0

    I also tried the following updates:

    1.  Downloaded and installed nRF Command Line Tools version 10.24.0
    2.  Ran the "West update" link in the build notification box

    However, even with all these steps, building the Matter Template sample still fails at the Factory Data generate operation as before.

    On the other hand, I was able to create a new application -- copying from the OpenThread CLI sample and it builds, flashes, and runs on the DK board as expected.

    Best Regards,
    Gene

  • Hi Gene

    Apologies for the long response time due to the Easter Holidays period. Thank you for the description. Lets try to close some doors and narrow down what may cause this as it works on my end. What I suspect is that it could be caused by either of these items

    1. Do you have anything in the VS Code workspace? Sometimes the Toolchain and SDK version that is actually used are inherited from projects in the workspace rather than the applications you've loaded into the extension as seen in the image below (which I've forced to showcase this) 



    2. When you perform the new build, do you remove the previous build folder?
    3. Could you open the command palette in VS Code and generate support information for the build that faults and upload it here?


    4. Is the template sample something that you copied from elsewhere or is it the pristine sample (unmodified sample) from the unmodified SDK v2.6.0?

    I find it hard to narrow it down anything further than this when its not reproducable from my end unfortunately, but hopefully this might allow us to see something! 

    Kind regards,
    Andreas

Related