nRF5 SDK is not maintained anymore
More Info: Consider nRF Connect SDK for new designs

Implementing 'Developing Bluetooth Low Energy products using nRF Connect' video on nRF5340-DK

I am working from this video:

https://webinars.nordicsemi.com/developing-bluetooth-low-energy-6

Which nRF5340-DK build configuration should I use please?

  • nrff5340dk_nrf5340_cpuapp
  • nrff5340dk_nrf5340_cpuapp_ns
  • nrff5340dk_nrf5340_cpunet

I've downloaded the source files and manually put the folders named 'bluetooth_remote' and 'bluetooth_remote_template' in my macOS workspace folder.

I add the 'bluetooth_remote_template' folder as a new application into VS Code, immediately I'm asked if I want to change from the current v1.9.0 version of the nRF Connect SDK. I assume that I should be working with the latest version, so confirm that I don't want to change. When I then open the project in Explorer and look at main.c I see the following Includes underlined with red squiggles.

main.c

#include <zephyr.h>
#include <logging/log.h>
#include <dk_buttons_and_leds.h>
#include "remote.h"

The same is true for the Includes in remote.c and remote.h:

remote.c
  
#include "remote.h"
    
remote.h
   
#include <zephyr.h>
#include <logging/log.h>
 
What do I need to do to provide the paths to these header files please?

Parents
  • Hi

    From the Terminal log you sent, the projetct actually builds sucessfully, and you should be able to flash it to the device if you want.

    After you do the pristine build and get these errors, try to restart VS Code and see if the errors still persists in the existing project?

    In your settings, I see you use clang as the compiler used for intellij. Try to set the ncs gnuarmemb as this instead.
    It should be located something like. ""/opt/ncs/v1.9.0/toolchain/opt/bin/arm-none-eabi-gcc"

    Does any of these suggestings fix your issue?

    Regards,
    Sigurd Hellesvik

  • Thanks Sigurd, I've done as you suggested and restarted VS Code, an I still get 10 out of 11 errors as it does at least find remote.h header file in the project folder

    How do I set the compiler to arm-none-eabi-gcc instead please? It's located here:

  • Thanks Sigurd, there's a very long list of settings to work through, could you specify exactly what I should change please, including the specific file path?

    In parallel, I did a search for 'compilerPath' and found c_cpp_properties.json:

    {
    "configurations": [
    {
    "name": "Mac",
    "includePath": [
    "${workspaceFolder}/**"
    ],
    "defines": [],
    "macFrameworkPath": [
    "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
    ],
    "compilerPath": "/usr/bin/clang",
    "cStandard": "c11",
    "cppStandard": "c++98",
    "intelliSenseMode": "macos-clang-x64",
    "configurationProvider": "ms-vscode.cmake-tools"
    }
    ],
    "version": 4
    }
    Can I just edit this JSON file please? If so, what should it specify please?
  • Hi

    When you run VS Code, do you open it from the nRF Connect for Desktop Toolchain Manager app?

    I realise that the editing of the includePath and compilerPath likely is the wrong aproach to solving this problem.
    Remove the changes you made to these, to get the original issue.

    The nRF Connect for VS Code extension should be able to configure intelliSense automatically.

    Since none of my previous suggestions have worked so far, I will ask our developers for this extension for assistance in the case.
    They will need the following information generated by VS Code:

    1. Generate support information:

    2. C/C++ Log diagnostics:

    Paste the generated information into two different files(.txt), remove information you do not want to share, and upload here.

    Regards,
    Sigurd Hellesvik

  • HI Sigurd,

    Yes, i always launch VS code from the Toolchain Manager app in nRF Connect for Desktop.

    Thanks very much, but following your example doesn't produce the same result, what am I missing please?

  • Hi

    You need to open the menu (Ctrl+P), and then type in ">" first. This way, VS Code lets you execte commands, either from itself or from extensions.

    Regards,
    Sigurd Hellesvik

  • Thanks very much Sigurd, please find requested files attached.

Reply Children
Related