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

    Fullscreen
    1
    2
    3
    4
    5
    #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
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • 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  
    I downloaded latest Segger studio and latest verions of SDK nRF5_SDK_17.1.0_ddde560
    I am using SDK sample but not any GitHub repo. As you said they are not compatible. I agreed but i also downloaded VS and nRF connect in VS. Their blinky example also has problem. Actually, i opened this thread related to VS and nRF connect but not segger studio. I mistakenly mentioned Segger studio in first message.
    Although, i worked on Segger studio and make it work a blinky examples after some research and fixing bugs


  • I was able to compile this example by deleting SEGGER_RTT_Syscalls_SES.c: file from the project(read in another threads)

    Now i want to understand, what this example is supposed to do after reading Analog channel?

    Will it print something on some terminal or what?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    Author : Abdelali Boussetta @rmptxf
    Description : This saadc example uses one channel (AIN1 (P0.3)), samples at 100ms (10 samples) = get result each (1 second).
    It uses 14Bit as a resolution.
    */
    #include <stdbool.h>
    #include <stdint.h>
    #include <stdio.h>
    #include <string.h>
    #include "nrf.h"
    #include "nrf_drv_saadc.h"
    #include "nrf_drv_ppi.h"
    #include "nrf_drv_timer.h"
    #include "boards.h"
    #include "app_error.h"
    #include "nrf_delay.h"
    #include "app_util_platform.h"
    #include "nrf_pwr_mgmt.h"
    #include "nrf_log.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • I was able to compile this example by deleting SEGGER_RTT_Syscalls_SES.c: file from the project(read in another threads)

    Now i want to understand, what this example is supposed to do after reading Analog channel?

    Will it print something on some terminal or what?

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /*
    Author : Abdelali Boussetta @rmptxf
    Description : This saadc example uses one channel (AIN1 (P0.3)), samples at 100ms (10 samples) = get result each (1 second).
    It uses 14Bit as a resolution.
    */
    #include <stdbool.h>
    #include <stdint.h>
    #include <stdio.h>
    #include <string.h>
    #include "nrf.h"
    #include "nrf_drv_saadc.h"
    #include "nrf_drv_ppi.h"
    #include "nrf_drv_timer.h"
    #include "boards.h"
    #include "app_error.h"
    #include "nrf_delay.h"
    #include "app_util_platform.h"
    #include "nrf_pwr_mgmt.h"
    #include "nrf_log.h"
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children
  • Hi,

    You need to be a bit more clear here. Are you using nRF Connect SDK or nRF5 connect SDK?  "SDK" is not and means "Software Development Kit". The names of the respective SDK's are either "nRF 5" SDK or "nRF Connect" SDK so to find the proper resources that you need to follow you need to always specify.  

    Your comment here 

    alleekhaan said:
    I setup VS and Connect SDK by following the course at academy.

    implies nRF Connect SDK. All of the other previous comments are ambigious (except for your latest comment)

    What SDK do you want to use? nRF5 or nRF Connect? What's your end goal? 

    alleekhaan said:
    I agreed but i also downloaded VS and nRF connect in VS. Their blinky example also has problem. Actually, i opened this thread related to VS and nRF connect but not segger studio.

    Could you post the build log here and state what version of nRF Connect you were using?

    alleekhaan said:
    I mistakenly mentioned Segger studio in first message.
    Although, i worked on Segger studio and make it work a blinky examples after some research and fixing bugs

    Noted, thats clear. Thank you for specifying

    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


    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    [{
    "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,
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


    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>
     
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    [{
    "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
    }]
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • 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:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    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)
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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

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

    Kind regards,
    Andreas