Cant get it to program

Hi,

Installed the toolchain, installed VS Code, and I think its all linked, but when I try to run even the most basic hello world program it just keeps throwing this error

boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig:61: error: couldn't parse 'default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))': macro expanded to blank string

Is there a dedicated IDE that integrates everything into a single package like the Arduino IDE or MPLAB IDE?

Regards,

R

Parents
  • I downloaded the nrf connect for desktop to install the toolchains

    Its the latest SDK version

    I created a new Hello World example which seems to use non-standard C (printk) 

    I use the build action button instead of the terminal

    I am using the nrf5340dk_nrf5340_cpuapp

    The complete error

    "

    boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig:61: error: couldn't parse 'default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))': macro expanded to blank string

    #include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (/Users/macbook/Documents/NRF/hello_world/src/main.c).

    cannot open source file "zephyr.h"

    cannot open source file "sys/printk.h"

    "

    "Launching GDB: /opt/nordic/ncs/v1.9.0/toolchain/bin/arm-none-eabi-gdb -q --interpreter=mi2 /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex
    Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
    Reading symbols from /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex...
    (No debugging symbols found in /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex)
    WARNING: Cortex-Debug will deprecate use of GDB version 8. Please upgrade to version 9+
    Launching gdb-server: /Applications/SEGGER/JLink/JLinkGDBServerCLexe -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF5340_xxAA_APP -select usb=1050023354 -rtos /Applications/SEGGER/JLink/GDBServer/RTOSPlugin_Zephyr.dylib
    Please check TERMINAL tab (gdb-server) for output from /Applications/SEGGER/JLink/JLinkGDBServerCLexe
    0x000012b2 in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "/Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.elf...
    Resetting target
    Resetting target

    Temporary breakpoint 1, main () at /Users/macbook/Documents/NRF/hello_world/src/main.c:12
    warning: Source file is more recent than executable.
    12 while(1)

    Program
    received signal SIGTRAP, Trace/breakpoint trap.
    ?? () at /opt/nordic/ncs/v1.9.0/zephyr/arch/arm/core/aarch32/cpu_idle.S:107
    107 cpsie i
    "

Reply
  • I downloaded the nrf connect for desktop to install the toolchains

    Its the latest SDK version

    I created a new Hello World example which seems to use non-standard C (printk) 

    I use the build action button instead of the terminal

    I am using the nrf5340dk_nrf5340_cpuapp

    The complete error

    "

    boards/arm/nrf5340dk_nrf5340/Kconfig.defconfig:61: error: couldn't parse 'default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))': macro expanded to blank string

    #include errors detected based on information provided by the configurationProvider setting. Squiggles are disabled for this translation unit (/Users/macbook/Documents/NRF/hello_world/src/main.c).

    cannot open source file "zephyr.h"

    cannot open source file "sys/printk.h"

    "

    "Launching GDB: /opt/nordic/ncs/v1.9.0/toolchain/bin/arm-none-eabi-gdb -q --interpreter=mi2 /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex
    Set "showDevDebugOutput": true in your "launch.json" to see verbose GDB transactions here. Helpful to debug issues or report problems
    Reading symbols from /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex...
    (No debugging symbols found in /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.hex)
    WARNING: Cortex-Debug will deprecate use of GDB version 8. Please upgrade to version 9+
    Launching gdb-server: /Applications/SEGGER/JLink/JLinkGDBServerCLexe -singlerun -nogui -if swd -port 50000 -swoport 50001 -telnetport 50002 -device nRF5340_xxAA_APP -select usb=1050023354 -rtos /Applications/SEGGER/JLink/GDBServer/RTOSPlugin_Zephyr.dylib
    Please check TERMINAL tab (gdb-server) for output from /Applications/SEGGER/JLink/JLinkGDBServerCLexe
    0x000012b2 in ?? ()
    Program stopped, probably due to a reset and/or halt issued by debugger
    add symbol table from file "/Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.elf"
    (y or n) [answered Y; input not from terminal]
    Reading symbols from /Users/macbook/Documents/NRF/hello_world/build/zephyr/zephyr.elf...
    Resetting target
    Resetting target

    Temporary breakpoint 1, main () at /Users/macbook/Documents/NRF/hello_world/src/main.c:12
    warning: Source file is more recent than executable.
    12 while(1)

    Program
    received signal SIGTRAP, Trace/breakpoint trap.
    ?? () at /opt/nordic/ncs/v1.9.0/zephyr/arch/arm/core/aarch32/cpu_idle.S:107
    107 cpsie i
    "

Children
  • Hi,

    Can you upload the support information from VS Code? Open Command Palette in VS Code and write nRF Connect: Generate Support Information. When you select this the information will be generated in the output terminal. Copy it and upload it here by going to Insert > Code, and paste the information there.

    Best regards,

    Marte

  • IMPORTANT: The data below could contain sensitive or confidential information about your environment.
    If you do not wish this to be seen by others, please make sure to remove it before sharing.

    For help and support, visit the Nordic DevZone at devzone.nordicsemi.com/.

    {
    "platform": {
    "os": "darwin",
    "osVersion": "Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:54 PST 2021; root:xnu-8019.61.5~1/RELEASE_X86_64",
    "osKernel": "21.2.0",
    "vscode": "1.64.2",
    "electron": "13.5.2",
    "node": "v14.16.0"
    },
    "system": {
    "date": "2022-02-28T12:23:29.312Z",
    "vscodeRoot": "/Applications/Visual Studio Code.app/Contents/Resources/app",
    "nrfConnectForDesktopInstalled": true,
    "vscodeUptime": "01:06:12",
    "osUptime": "04:40:46",
    "cpu": {
    "model": "Intel(R) Core(TM) i5-5675R CPU @ 3.10GHz",
    "speed": "3100 MHz",
    "count": 2
    },
    "memory": {
    "total": "16.00 GB",
    "free": "1.66 GB"
    }
    },
    "workspace": {
    "name": "hello_world",
    "workspaceFile": null,
    "folders": [
    "/Users/macbook/Documents/NRF/hello_world"
    ]
    },
    "extensions": {
    "internal": {
    "nordic-semiconductor.nrf-connect": {
    "version": "2022.1.192",
    "path": "/Users/macbook/.vscode/extensions/nordic-semiconductor.nrf-connect-2022.1.192",
    "isActive": true
    },
    "nordic-semiconductor.nrf-terminal": {
    "version": "2022.1.30",
    "path": "/Users/macbook/.vscode/extensions/nordic-semiconductor.nrf-terminal-2022.1.30",
    "isActive": true
    },
    "nordic-semiconductor.devicetree": null,
    "nordic-semiconductor.kconfig": null
    },
    "external": {
    "marus25.cortex-debug": "1.2.2",
    "ms-vscode.cpptools": "1.8.4",
    "ms-vscode.js-debug": "1.64.3",
    "ms-vscode.js-debug-companion": "1.0.15",
    "ms-vscode.references-view": "0.0.81",
    "ms-vscode.vscode-js-profile-table": "0.0.18",
    "cschlosser.doxdocgen": "1.4.0",
    "jeff-hykin.better-cpp-syntax": "1.15.13",
    "ms-vscode-remote.remote-containers": "0.217.4",
    "ms-vscode-remote.remote-ssh": "0.74.0",
    "ms-vscode-remote.remote-ssh-edit": "0.74.0",
    "ms-vscode-remote.remote-wsl": "0.64.2",
    "ms-vscode.cmake-tools": "1.9.2",
    "ms-vscode.cpptools-extension-pack": "1.1.0",
    "ms-vscode.cpptools-themes": "1.0.0",
    "trond-snekvik.gnu-mapfiles": "1.1.0",
    "twxs.cmake": "0.0.17"
    }
    },
    "tools": {
    "/Applications/SEGGER/JLink/JLinkExe": "7.62a",
    "/usr/local/bin/nrfjprog": "10.15.2",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/cmake": "3.21.1",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/west": "0.12.0",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/python3": "3.9.6",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/ninja": "1.10.2",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/gperf": "3.1",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/dtc": "1.6.1",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/arm-none-eabi-gcc": "9-2019-q4-major",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/gn": "1975",
    "/opt/nordic/ncs/v1.9.0/toolchain/bin/git": "2.32.0"
    },
    "connectedDevices": [
    {
    "id": "1050023354"
    }
    ],
    "config": {
    "nordic-semiconductor.nrf-connect": {
    "topdir": "/opt/nordic/ncs/v1.9.0",
    "toolchain": {
    "path": "/opt/nordic/ncs/v1.9.0/toolchain"
    },
    "ozonePath": "",
    "applications": [
    "/Users/macbook/Documents/NRF/hello_world"
    ],
    "jlink": {
    "rtosPlugin": ""
    },
    "kconfig": {
    "interface": "kconfig"
    },
    "welcome": {
    "showOnStartup": false
    },
    "west": {
    "env": {
    "$base": "terminal"
    }
    },
    "boardRoots": [
    "${workspaceFolder}"
    ],
    "enableTelemetry": false
    },
    "nordic-semiconductor.nrf-terminal": {
    "terminalMode": "character"
    },
    "nordic-semiconductor.devicetree": {
    "modules": [
    "${zephyrBase}",
    "${zephyrBase}/../nrf",
    "."
    ],
    "zephyr": "",
    "ctxFile": "",
    "defaultBoard": ""
    },
    "nordic-semiconductor.kconfig": {
    "root": "",
    "env": {},
    "cfiles": true,
    "disable": false,
    "zephyr": {
    "base": ""
    },
    "python": "",
    "liveValue": true
    },
    "marus25.cortex-debug": {
    "armToolchainPath": null,
    "armToolchainPrefix": "arm-none-eabi",
    "gdbPath": null,
    "objdumpPath": null,
    "JLinkGDBServerPath": null,
    "openocdPath": null,
    "pyocdPath": null,
    "PEGDBServerPath": null,
    "stutilPath": null,
    "stlinkPath": null,
    "stm32cubeprogrammer": null,
    "enableTelemetry": true,
    "flattenAnonymous": false,
    "registerUseNaturalFormat": true,
    "variableUseNaturalFormat": true,
    "dbgServerLogfile": null,
    "showDevDebugOutput": "none"
    }
    },
    "environment": {
    "westExe": "/opt/nordic/ncs/v1.9.0/toolchain/bin/west",
    "westEnv": {
    "ELECTRON_RUN_AS_NODE": "1",
    "GIT_EXEC_PATH": "/opt/nordic/ncs/v1.9.0/toolchain/Cellar/git/2.32.0_1/libexec/git-core",
    "HOME": "/Users/macbook",
    "PATH": "/opt/nordic/ncs/v1.9.0/toolchain/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin",
    "ZEPHYR_BASE": "/opt/nordic/ncs/v1.9.0/zephyr",
    "GNUARMEMB_TOOLCHAIN_PATH": "/opt/nordic/ncs/v1.9.0/toolchain",
    "ZEPHYR_TOOLCHAIN_VARIANT": "gnuarmemb",
    "USER": "macbook"
    },
    "toolchainPath": "/opt/nordic/ncs/v1.9.0/toolchain",
    "toolchainBinPath": "/opt/nordic/ncs/v1.9.0/toolchain/bin",
    "toolchainVersion": "1.9.0"
    },
    "terminal": {
    "shell": null,
    "defaultProfile": null
    }
    }
  • Hi,

    I do not see any issues from this information, as everything seems to be as it should. However, there was a similar issue on Mac here: https://devzone.nordicsemi.com/f/nordic-q-a/84209/failed-to-compile-non-secure-boards. Can you try downgrading VS Code to version 1.62.3? Make sure to install the Intel Chip version of VS Code, and not Universal or Apple Silicon. Also try upgrading Python to v3.10.2.

    RM said:
    I created a new Hello World example

    Did you make any changes to the example, or is it exactly like the Hello World example from Zephyr?

    RM said:
    The complete error

    Can you upload the complete build output? By this I mean starting with 'west build ...' and everything that comes after when it tries to build.

    Marte Myrvold said:
    Have you checked if any of the fixes in Common fixes for nRF Connect SDK build problems helps?

    Did you try any of the tests or fixes in the guide I linked?

    Best regards,

    Marte

Related