This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF5340-DK problem starting own project ncs v1.5.0

HI

I'm in the process of evaluating nRF5340 but am new to Nordic chips and development environment. Im running Windows 10 and I installed nRF Connect 3.6.1 and installed the toolchain through it.

I managed to run the blinky proiect but have problems starting an own project.

I followed this guide

https://devzone.nordicsemi.com/nordic/nrf-connect-sdk-guides/b/getting-started/posts/nrf-connect-sdk-tutorial---part-1-ncs-v1-4-0

but when I build, I get this error

Creating solution Bprufa02.emProject
C:/Users/Notandi/ncs/v1.5.0/toolchain/opt/bin/cmake.exe -GNinja -DBOARD=nrf5340dk_nrf5340_cpuappns -DBOARD_DIR=C:\Users\Notandi\ncs\v1.5.0\zephyr\boards\arm\nrf5340dk_nrf5340 -BC:\Users\Notandi\Dropbox (Kiso)\BVerk\Geometer\V4\nordic\Bprufa02\build_nrf5340dk_nrf5340_cpuappns -SC:\Users\Notandi\Dropbox (Kiso)\BVerk\Geometer\V4\nordic\Bprufa02 -DNCS_TOOLCHAIN_VERSION=1.5.0 -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=C:\Users\Notandi\ncs\v1.5.0\toolchain\segger_embedded_studio/html/configure_nordic_project_menuconfig.py
-- Application: C:/Users/Notandi/Dropbox (Kiso)/BVerk/Geometer/V4/nordic/Bprufa02
-- Zephyr version: 2.4.99 (C:/Users/Notandi/ncs/v1.5.0/zephyr)
-- Found Python3: C:/Users/Notandi/ncs/v1.5.0/toolchain/opt/bin/python.exe (found suitable exact version "3.8.2") found components: Interpreter
-- Found west (found suitable version "0.9.0", minimum required is "0.7.1")
-- Board: nrf5340dk_nrf5340_cpuappns
-- Cache files will be written to: C:/Users/Notandi/ncs/v1.5.0/zephyr/.cache
-- Found dtc: C:/Users/Notandi/ncs/v1.5.0/toolchain/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/Users/Notandi/ncs/v1.5.0/toolchain/opt)
-- Found BOARD.dts: C:/Users/Notandi/ncs/v1.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuappns.dts
-- Generated zephyr.dts: C:/Users/Notandi/Dropbox (Kiso)/BVerk/Geometer/V4/nordic/Bprufa02/build_nrf5340dk_nrf5340_cpuappns/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/Notandi/Dropbox (Kiso)/BVerk/Geometer/V4/nordic/Bprufa02/build_nrf5340dk_nrf5340_cpuappns/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/Notandi/Dropbox (Kiso)/BVerk/Geometer/V4/nordic/Bprufa02/build_nrf5340dk_nrf5340_cpuappns/zephyr/include/generated/device_extern.h
-- Configuring incomplete, errors occurred!
Including boilerplate (Zephyr base): C:/Users/Notandi/ncs/v1.5.0/zephyr/cmake/app/boilerplate.cmake
-- Using NCS Toolchain 1.5.0 for building. (C:/Users/Notandi/ncs/v1.5.0/toolchain/cmake)
CMake Error at C:/Users/Notandi/ncs/v1.5.0/zephyr/cmake/kconfig.cmake:204 (message):
File not found: C:/Users/Notandi/Dropbox
Call Stack (most recent call first):
C:/Users/Notandi/ncs/v1.5.0/zephyr/cmake/app/boilerplate.cmake:534 (include)
C:/Users/Notandi/ncs/v1.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
C:/Users/Notandi/ncs/v1.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:3 (find_package)



error: cmake failed
create_nordic_project.py failed (1)

I have spend several days on this problems and looked around but cannot find a solution. I would be very happy for any hint.

Does it matter that the example uses version 1.4 and I have 1.5?

Best regards,

Baldur

  • Hi again, Baldur!

    You are correct that the name of the samples in the SDK are shortened, but in this case peripheral_hr is the sample located under zephyr\samples\bluetooth\peripheral_hr. While Bluetooth: Peripheral Heart Rate Monitor with Coded PHY is peripheral_hr_coded, located in the nrf\samples\bluetooth folder.

    Based on the sample description it's supposed to be tested with central_hr so it doesn't necessarily show up properly on a phone. I suggest testing with peripheral_uart or peripheral_lbs instead, which both can be interacted with using a phone.

    As you can see there are three possible board targets for the nRF5340DK:
    - nRF5340_cpuapp: this is the secure domain application core and it's what I recommend using initially.
    - nRF5340_cpuappns: this is the non-secure domain application core, meaning that the application will run in separate domain with certain permissions. This is controlled by the Secure Partition Manager running in the secure domain. Using this allows for more secure applications, where sensitive information and such can be stored in the secure domain.
    - nRF5340_cpunet: this is the network core, which usually run the hci_rpmsg sample enabling the application core to use the network core as a BLE controller. This should be pre programmed on the core, and you should only need to reprogram it if you change anything in the controller code (hci_rpmsg). 

    I suggest following Getting started with nRF Connect SDK (nRF53 Series) and Working with the nRF53 series guides closely.

    EDIT: Corrected some wrong info about the sample name.

    Best regards,
    Carl Richard

  • Hi Carl Richards

    I have tried to follow the directions as close as possible, but have not had luck compiling the peripheral_lbs example and run successfully. There are also other issues that I ran into that makes me unsure.

    Question 1)

    When I download the two hex files delivered in the Peripheral _Heart_rate example, it works if I use the programmer via nRF Connect, not If I just drag and drop to the MSD device that appears when kit is plugged in. After dragging the first file over, the drive reopens with an fail.txt file saying "Error during erase"

    I thought both methods should work. Is this normal?

    (since I have the programmer option this is not a major issue, but makes me uncertain so It would be good to know)

    Question 2:

    When I open the peripheral_lbs project via nRF connect->Toolchain manager->open IDE->Open nRF connect SDK project and do a "build and run", everything goes as expected. In my CDC terminal I get:

    But I never see any Nordic_LBS device in my phone that I can connect to (as the example https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_lbs/README.html indicates I should see)

    How can I debug this or get more information what to do?

    (this is a major issue since I don't have a clue how to precede)

    Question 3:

    I can build and run the blinky project, but if I try to build the biinky_pwm project

    I get the following error

    Looking at the readme.rst file for this project, 5340 is not mentioned.

    Are not all projects in the SDK meant for for 5340?

    Are there instructions for how to make it work?

    (this is not a major issue, more for me to understand how the environment is meant to be)

    Question 5

    I'm also a little confused in the nomenclature in the last image. I expected single blinky project in a solution, but in the above image there are multiple "projects" (which looks more like folders or just files (ending with .a, I guess libraries)) . I have seen videos where with a more recognizable structure

    Here there is a solution with a blinky project that has folders.

    (not a major issue but would be interesting to get a comment on this)

    Best regards,

    Baldur

  • Hi Carl Richards.

    I did not find the reply button to my last post so I put this here.

    I finally managed to compile, download and run an BLE sample application. :-)

    I found the following guide very useful:

    https://www.programmersought.com/article/51616750462/

    It goes step by step through the process mentioning all the details for a specific task.

    I think it makes better clear that I need to download two codes(and which one), one for each processor than the following example:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/bluetooth/peripheral_lbs/README.html

    What I had to do in addition to the guide is to program both files at the same time with the programmer and reset afterwards:

    It would still be interesting to get comments to my previous questions.

    Best regards, and thanks again for your help,

    Baldur

  • Hi!

    Great to hear that you finally got it to work. It's correct that the programming process isn't covered for every sample, but I believe the Building and programming a sample section of the nRF53 guide should cover this part quite well.

    As for your questions:

    1.  This is likely due to the readback protection the nRF5340, which is enabled after resets. You can disable it by recovering the device as described in the documentation.

    2. You solved this, but the issue was likely that the network core wasn't programmed with the BLE controller image(hci_rpmsg).

    3. This is a issue in the board definition for the nRF5340DK in Zephyr. In short, the sample checks if the nRF5340 has a PWM led node in its devicetree (which is a data structure Zephyr uses for describing hardware) and it can't find any due to it not being listed. Thus, it fails. 

    I'll see to it being fixed, but you can replace <ncs_root>\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340_cpuapp_common.dts with the attached file (which contains the rather simple fix).

    4. The confusing project structure of NCS projects in Segger Embedded Studio is an unfortunate side effect of the build environment. The main project is the one with the CMake logo beside it and your source code inside. 

    I hope this answers your questions! Please reach out if you face any other issues!

    Best regards,
    Carl Richard

  • Hi Carl Richard.

    Thank you very much for your answers. They were very helpful.

    Regarding question 3, I have looked around but cannot see any attachment. Might I be overlooking something?

    I got curious about the file you mention (<ncs_root>\zephyr\boards\arm\nrf5340dk_nrf5340\nrf5340_cpuapp_common.dts). I could see it in my blinky_pwm project, but double-clicking on it tells me that I can not read it:

    I could find it in my installation path

    and looking at it in a text editor, it seems to define my nrf5340-DK on-board-resources  (pinout for leds, buttons,...).

    I guess that this file is common for all projects (and is thus not copied to each project) and as such the system makes it non-editable (since the board is fixed). Am I correct?

    If I was to make my own board, I guess I would make me a file like this that describes the on-board resources?

    Working with other ARM processors, the IDE typically has some kind of setup manager for the on-chip resources (setting clock frequency, enabling counters and so on - in general setting of all the processor registers). Is that what devicetree is about, or is there some tool that I am missing (similar to processor expert in NXP or STM32CubeMX)?

    If devicetreee.h describes the registers, I expect that it would be different for every project and thus under the project folder. I looked at my project folder and its subdirectories:

    C:\Users\Notandi\ncs\v1.5.0\zephyr\samples\basic\blinky_pwm

    but I could not find a devicetree.h for this  project.

    Best regards,

    Baldur

Related