SDK

Hi,

I have a question about SDK.
Why not a single example build out of the box in SDK.
As a beginner to learn about nRF devices, if i have to face all these weird issues in all examples then how i will be able to understand the code.

First, waste a lot of time to fix issues then test the codes.

Why it is like that?

I am using Segger studio and latest SDK>

Can someone guide me what i am missing here?

Thanks

Parents
  • I setup VS and Connect SDK by following the course at academy.
    I am facing these issues in a simple blinky example

    #include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (C:\nordic\myApps\blinky_pwm\src\main.c).
    cannot open source file "syscall_list.h" (dependency of "C:\Users\ALIKH\.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64\bin\zephyr\kernel.h")
    cannot open source file "devicetree_generated.h" (dependency of "C:\Users\ALIKH\.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64\bin\zephyr\device.h")
    cannot open source file "syscalls/pwm.h" (dependency of "C:\Users\ALIKH\.vscode\extensions\ms-vscode.cpptools-1.20.5-win32-x64\bin\zephyr\drivers\pwm.h")
    The PWM drivers must be enabled by CONFIG_PWM to be included in the build

  • Hi,

    Segger Studio and the latest nRF Connect SDK are not compatible so you will have to go through https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/ as you say to to see how to get started with nRF Connect SDK in VS Code.

    alleekhaan said:
    I am facing these issues in a simple blinky example

    Could you verify what release of the SDK you're using? And is the sample from the same SDK or is it from the Academy course github repo? In general you should also include the full build log as there may be items you've missed when only pasting a snippet.

    Kind regards,
    Andreas

  • Hi  
    Thanks for clarification.
    I have following ends goals
    1: Read analog pins and test if it is working(UART or RTT)
    2: I2C sensor interfacing and test it's working(UART or RTT)


    I started Visual studio using this tutorial from Nordic
    https://www.youtube.com/playlist?list=PLx_tBuQ_KSqEt7NK-H7Lu78lT2OijwIMl

    Here is the picture of versions

    When i compile simply blinky example. This is what i got errors on log screen


    [{
    	"resource": "/c:/nordic/myApps/blinky/src/main.c",
    	"owner": "C/C++: IntelliSense",
    	"code": "1696",
    	"severity": 8,
    	"message": "#include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (C:\\nordic\\myApps\\blinky\\src\\main.c).",
    	"source": "C/C++",
    	"startLineNumber": 8,
    	"startColumn": 1,
    	"endLineNumber": 8,
    	"endColumn": 27
    },{
    	"resource": "/c:/nordic/myApps/blinky/src/main.c",
    	"owner": "C/C++: IntelliSense",
    	"code": "1696",
    	"severity": 8,
    	"message": "cannot open source file \"syscall_list.h\" (dependency of \"C:\\Users\\ALIKH\\.vscode\\extensions\\ms-vscode.cpptools-1.20.5-win32-x64\\bin\\zephyr\\kernel.h\")",
    	"source": "C/C++",
    	"startLineNumber": 8,
    	"startColumn": 1,
    	"endLineNumber": 8,
    	"endColumn": 27
    },{
    	"resource": "/c:/nordic/myApps/blinky/src/main.c",
    	"owner": "C/C++: IntelliSense",
    	"code": "1696",
    	"severity": 8,
    	"message": "cannot open source file \"devicetree_generated.h\" (dependency of \"C:\\Users\\ALIKH\\.vscode\\extensions\\ms-vscode.cpptools-1.20.5-win32-x64\\bin\\zephyr\\drivers\\gpio.h\")",
    	"source": "C/C++",
    	"startLineNumber": 9,
    	"startColumn": 1,
    	"endLineNumber": 9,
    	"endColumn": 33
    },{
    	"resource": "/c:/nordic/myApps/blinky/src/main.c",
    	"owner": "Kconfig options",
    	"code": "missing_kconfig_param",
    	"severity": 4,
    	"message": "The GPIO drivers must be enabled by CONFIG_GPIO to be included in the build",
    	"startLineNumber": 9,
    	"startColumn": 1,
    	"endLineNumber": 9,
    	"endColumn": 34
    }]


    Then i moved to SEGGER studio to do the same blinky example test.

    I was able there to do blinky test on nRF52DVK after fixing some issues already discussed on threads.

    Now the reason, creating this thread to know why there are so many issues in both platforms.

    Why nothing works out of the box? What I am missing(Sorry to being nobe here)

    I simply want to perform these tests
    1: Read analog pins and test if it is working(UART or RTT)
    2: I2C sensor interfacing and test it's working(UART or RTT)

    So i can later design my own custom board.

    Thanks

  • Hi,

    alleekhaan said:
    Why nothing works out of the box? What I am missing(Sorry to being nobe here)

    No worries, it's a bit much when you're starting out.

    I see that you have a mismatch in between your toolchain and your SDK version :

       

    You should always ensure that you've selected the toolchain that corresponds to the SDK you're using, which is what I believe is causing the issues. For more details this should be explained in the fundamentals course on the academy pages you referred to at the start of the case

    Could you try to make sure that you match the SDK and toolchain versions? it's always best to use a stable release than a "CS" or "RC" (release candidate).

    You should use 2.6.1, but if should look like this when it is matching (the sample in the picture uses 2.4.1):

    Kind regards,
    Andreas

  • Hi  
    I installed same SDK and i am still getting same error.

    It's  seems like it is not founding headers directories

    #include <zephyr/kernel.h>
    #include <zephyr/drivers/gpio.h>
     
    [{
    	"resource": "/c:/nordic/myApps/blinky_2/src/main.c",
    	"owner": "Kconfig options",
    	"code": "missing_kconfig_param",
    	"severity": 4,
    	"message": "The GPIO drivers must be enabled by CONFIG_GPIO to be included in the build",
    	"startLineNumber": 8,
    	"startColumn": 1,
    	"endLineNumber": 8,
    	"endColumn": 34
    }]
  • Hi,

    How are you building this sample? I tried reproducing it by setting up a clean NCS v2.6.1 instance and building the blinky sample. It worked both in terminal and in the VS Code extension

    Command prompt opened through nRF Connect Terminal:

     Directory of C:\Nordic\SDKs\ncs\v2.6.1\zephyr\samples\basic\blinky
    
    08.07.2024  12:13    <DIR>          .
    08.07.2024  12:13    <DIR>          ..
    08.07.2024  12:13               195 CMakeLists.txt
    08.07.2024  12:13                15 prj.conf
    08.07.2024  12:13             2 736 README.rst
    08.07.2024  12:13               259 sample.yaml
    08.07.2024  12:13    <DIR>          src
                   4 File(s)          3 205 bytes
                   3 Dir(s)  105 279 221 760 bytes free
    
    C:\Nordic\SDKs\ncs\v2.6.1\zephyr\samples\basic\blinky>west build -b nrf52840dk_nrf52840
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.6.20240304.889616714482 for building. (C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/cmake)
    -- Found Python3: C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/opt/bin/python.exe (found suitable version "3.9.13", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/.cache
    -- Zephyr version: 3.5.99 (C:/Nordic/SDKs/ncs/v2.6.1/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf52840dk_nrf52840
    -- Found host-tools: zephyr 0.16.5 (C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.5 (C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/opt/zephyr-sdk)
    -- Found Dtc: C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build/zephyr/dts.cmake
    Parsing C:/Nordic/SDKs/ncs/v2.6.1/zephyr/Kconfig
    Loaded configuration 'C:/Nordic/SDKs/ncs/v2.6.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
    Merged configuration 'C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/prj.conf'
    Configuration saved to 'C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build/zephyr/.config'
    Kconfig header saved to 'C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build/zephyr/include/generated/autoconf.h'
    -- Found GnuLd: c:/nordic/sdks/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: C:/Nordic/SDKs/ncs/toolchains/cf2149caf2/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/Nordic/SDKs/ncs/v2.6.1/zephyr/samples/basic/blinky/build
    ←[92m-- west build: building application
    [2/139] Generating include/generated/version.h
    -- Zephyr version: 3.5.99 (C:/Nordic/SDKs/ncs/v2.6.1/zephyr), build: v3.5.99-ncs1-1
    [139/139] Linking C executable zephyr\zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       21880 B         1 MB      2.09%
                 RAM:        7552 B       256 KB      2.88%
            IDT_LIST:          0 GB        32 KB      0.00%

    VS Code extension (shows the same, successfull log):

    Are you using West to build your sample or something else?

    Kind regards,
    Andreas

  • Hi  

    I simply open a sample example. I also found these popup messages.

    I might missing some configuration steps in VS.
    Can you give some hints about it?

Reply Children
  • Hi, 

    Not sure what this audio file is, I'm assuming it should've been a video file?

    It looks like there is still something wrong with the setup from the configuration steps. The best way to resolve this is unfortunately to start over:

    Could you do the following:

    1. Uninstall and Remove VS Code
    2. Uninstall and Remove nRF Command Line Tools
    3. Uninstall and remove Segger J-Link 
    4. Follow the steps in https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-1-nrf-connect-sdk-introduction/topic/exercise-1-1/ to detail

    You might have to uninstall all your VS Code extensions as well if they are saved in the persistent VS Code appdata.

    Alternatively could you do this steps from a fresh/clean windows machine?

    Let me know how this.

    Kind regards,
    Andreas

Related