I tried to setup for nRF52840DK but failed

[FAILED] Took 943.72 seconds
Could not compile dummy C
Did I need to have my nRF environment active with the path to the compiler before trying to install?

PlatformIO does not depend on any user-installed tools, it has everything built it.

What exact platformio.ini and code are you trying to compile?

I was doing the blinky example, myblinky, and after a long time it failed since it couldn’t compile dummy. I tried the report button but nothing happened.
I saved the error log and it said there was another on my disk but I removed everything thinking I needed to have a tool chain pre-setup.

For which framework? The Nordic nRF52840-DK board supports the Arduino, mbed-os and Zephyr frameworks.

For a start, it should be as easy as this when you select your board name and the Arduino framework with the blinky code.

The Frame Work is Zephyr, I’m working on the nrf9160dk and nrf5340dk but I have a nrf52840 laying around here, somewhere. I wanted to see if Platformio provides hints with the Ctrl+space like API help and I just found out there are software config API for Kconfig and hardware config hints for Devicetree.

I have no problems creating a project for that board with Zephyr. Standard generated platformio.ini

[env:nrf52840_dk]
platform = nordicnrf52
board = nrf52840_dk
framework = zephyr

and src\main.c code

#include <zephyr.h>

void main(void)
{
}

results in

Processing nrf52840_dk (platform: nordicnrf52; board: nrf52840_dk; framework: zephyr)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52840_dk.html
PLATFORM: Nordic nRF52 (7.0.0) > Nordic nRF52840-DK
HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
DEBUG: Current (jlink) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
PACKAGES:
 - framework-zephyr 2.20500.210226 (2.5.0)
 - framework-zephyr-canopennode 0.0.0-alpha+sha.468d350028
 - framework-zephyr-civetweb 0.0.0-alpha+sha.e6903b80c0
 - framework-zephyr-cmsis 0.0.0-alpha+sha.c3bd2094f9
 - framework-zephyr-fatfs 0.0.0-alpha+sha.1d1fcc725a
 - framework-zephyr-hal-nordic 0.0.0-alpha+sha.f0d54d8449
 - framework-zephyr-hal-st 0.0.0-alpha+sha.b52fdbf4b6
 - framework-zephyr-libmetal 0.0.0-alpha+sha.9d4ee2c3cf
 - framework-zephyr-littlefs 0.0.0-alpha+sha.9e4498d1c7
 - framework-zephyr-loramac-node 0.0.0-alpha+sha.3f545d76a2
 - framework-zephyr-lvgl 0.0.0-alpha+sha.31acbaa36e
 - framework-zephyr-mbedtls 0.0.0-alpha+sha.24d84ecff1
 - framework-zephyr-mcuboot 0.0.0-alpha+sha.3fc59410b6
 - framework-zephyr-mcumgr 0.0.0-alpha+sha.43845e883f
 - framework-zephyr-mipi-sys-t 0.0.0-alpha+sha.75e671550a
 - framework-zephyr-open-amp 0.0.0-alpha+sha.de1b85a130
 - framework-zephyr-openthread 0.0.0-alpha+sha.1d668284a0
 - framework-zephyr-segger 0.0.0-alpha+sha.38c79a447e
 - framework-zephyr-sof 0.0.0-alpha+sha.b5b772dd61
 - framework-zephyr-tfm-mcuboot 1.7.0-rc1
 - framework-zephyr-tinycbor 0.0.0-alpha+sha.40daca97b4
 - framework-zephyr-tinycrypt 0.0.0-alpha+sha.3e9a49d267
 - framework-zephyr-trusted-firmware-m 0.0.0-alpha+sha.96340fb6c0
 - tool-cmake 3.16.4
 - tool-dtc 1.4.7
 - tool-ninja 1.9.0
 - tool-sreccat 1.164.0 (1.64) 
 - toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
Reading CMake configuration...
Parsing system calls...
Generating syscall files
Generating KObject files...
Validating driver...
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Building in release mode
Compiling .pio\build\nrf52840_dk\offsets\zephyr\arch\arm\core\offsets\offsets.c.o
..
Linking .pio\build\nrf52840_dk\firmware-pre.elf
Generating ISR list .pio\build\nrf52840_dk\zephyr\isrList.bin
Generating ISR table .pio\build\nrf52840_dk\zephyr\isr_tables.c
Compiling .pio\build\nrf52840_dk\zephyr_final\zephyr\isr_tables.c.o
Linking .pio\build\nrf52840_dk\firmware.elf
Checking size .pio\build\nrf52840_dk\firmware.elf
Building .pio\build\nrf52840_dk\firmware.hex
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   2.1% (used 5501 bytes from 262144 bytes)
Flash: [          ]   1.6% (used 16908 bytes from 1048576 bytes)
============================ [SUCCESS] Took 19.01 seconds ============================

And of course the autocomplete works.

If e.g. additionally activate the GPIO module, just like the official example does, and start typing some code…

From within the IDE how do I get -v before downloading or installing?

Currently, I’m waiting on NXP Arduino LPC176x 0.1.1 to finish updating I think, the Update button is spinning and has been forever.

I think you can close and reopen VSCode anytime and execute pio platform update from the CLI to get a better view at what’s updating.

yep, tried that, no means to select frameworks from the command line and verbos or -v isn’t a cli option
pio project init --board nrf52840_dk --frameworks zephyr
doesn’t work.

Yeah because extra options are given with -O, so pio project init --board nrf52840_dk -O "framework=zephyr" works.

And with a echo "int main() {return 0;}" > src\main.cpp for an empty cody and pasting the content of this file into zephyr/CMakeLists.txt makes it a valid project that is compilable with pio run -v for verbose mode.

Processing nrf52840_dk (platform: nordicnrf52; board: nrf52840_dk; framework: zephyr)
------------------------------------------------------------------------------------------------------------------------CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/nrf52840_dk.html
PLATFORM: Nordic nRF52 (7.0.0) > Nordic nRF52840-DK
HARDWARE: NRF52840 64MHz, 256KB RAM, 1MB Flash
DEBUG: Current (jlink) On-board (cmsis-dap, jlink) External (blackmagic, stlink)
PACKAGES:
 - framework-zephyr 2.20500.210226 (2.5.0)
 - framework-zephyr-canopennode 0.0.0-alpha+sha.468d350028
 - framework-zephyr-civetweb 0.0.0-alpha+sha.e6903b80c0
 - framework-zephyr-cmsis 0.0.0-alpha+sha.c3bd2094f9
 - framework-zephyr-fatfs 0.0.0-alpha+sha.1d1fcc725a
 - framework-zephyr-hal-nordic 0.0.0-alpha+sha.f0d54d8449
 - framework-zephyr-hal-st 0.0.0-alpha+sha.b52fdbf4b6
 - framework-zephyr-libmetal 0.0.0-alpha+sha.9d4ee2c3cf
 - framework-zephyr-littlefs 0.0.0-alpha+sha.9e4498d1c7
 - framework-zephyr-loramac-node 0.0.0-alpha+sha.3f545d76a2
 - framework-zephyr-lvgl 0.0.0-alpha+sha.31acbaa36e
 - framework-zephyr-mbedtls 0.0.0-alpha+sha.24d84ecff1
 - framework-zephyr-mcuboot 0.0.0-alpha+sha.3fc59410b6
 - framework-zephyr-mcumgr 0.0.0-alpha+sha.43845e883f
 - framework-zephyr-mipi-sys-t 0.0.0-alpha+sha.75e671550a
 - framework-zephyr-open-amp 0.0.0-alpha+sha.de1b85a130
 - framework-zephyr-openthread 0.0.0-alpha+sha.1d668284a0
 - framework-zephyr-segger 0.0.0-alpha+sha.38c79a447e
 - framework-zephyr-sof 0.0.0-alpha+sha.b5b772dd61
 - framework-zephyr-tfm-mcuboot 1.7.0-rc1
 - framework-zephyr-tinycbor 0.0.0-alpha+sha.40daca97b4
 - framework-zephyr-tinycrypt 0.0.0-alpha+sha.3e9a49d267
 - framework-zephyr-trusted-firmware-m 0.0.0-alpha+sha.96340fb6c0
 - tool-cmake 3.16.4
 - tool-dtc 1.4.7
 - tool-ninja 1.9.0
 - tool-sreccat 1.164.0 (1.64)
 - toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1)
Reading CMake configuration...
-- Application: C:/Users/Max/Documents/PlatformIO/Projects/proj_init/zephyr
-- Zephyr version: 2.5.0 (C:/Users/Max/.platformio/packages/framework-zephyr)
-- Found Python3: C:/Users/Max/AppData/Local/Programs/Python/Python38/python.exe (found suitable exact version "3.8.6") found components: Interpreter
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: C:/Users/Max/.platformio/packages/framework-zephyr/.cache
-- Found dtc: C:/Users/Max/.platformio/packages/tool-dtc/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (C:/Users/Max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214)
-- Found BOARD.dts: C:/Users/Max/.platformio/packages/framework-zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/include/generated/device_extern.h
Parsing C:/Users/Max/.platformio/packages/framework-zephyr/Kconfig

Loaded configuration 'C:/Users/Max/.platformio/packages/framework-zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'

Configuration saved to 'C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/.config'

Kconfig header saved to 'C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/include/generated/autoconf.h'

-- The C compiler identification is GNU 8.2.1
-- The CXX compiler identification is GNU 8.2.1
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/Max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214/bin/arm-none-eabi-gcc.exe
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk

CMake Warning:
  Manually-specified variables were not used by the project:

    PIO_PACKAGES_DIR



c:\users\max\appdata\local\programs\python\python38\python.exe "C:\Users\Max\.platformio\packages\framework-zephyr\scripts\parse_syscalls.py" --include "C:\Users\Max\.platformio\packages\framework-zephyr\include" --include "C:\Users\Max\.platformio\packages\framework-zephyr\drivers" --include "C:\Users\Max\.platformio\packages\framework-zephyr\subsys\net" --json-file C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\misc\generated\syscalls.json --tag-struct-file C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\misc\generated\struct_tags.json
c:\users\max\appdata\local\programs\python\python38\python.exe "C:\Users\Max\.platformio\packages\framework-zephyr\scripts\gen_syscalls.py" --json-file C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\misc\generated\syscalls.json --base-output C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\syscalls --syscall-dispatch C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\syscall_dispatch.c --syscall-list C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\syscall_list.h --split-type k_timeout_t
c:\users\max\appdata\local\programs\python\python38\python.exe "C:\Users\Max\.platformio\packages\framework-zephyr\scripts\gen_kobject_list.py" --kobj-types-output C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\kobj-types-enum.h --kobj-otype-output C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\otype-to-str.h --kobj-size-output C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\otype-to-size.h --include C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\misc\generated\struct_tags.json
c:\users\max\appdata\local\programs\python\python38\python.exe "C:\Users\Max\.platformio\packages\framework-zephyr\scripts\gen_kobject_list.py" --validation-output C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\include\generated\driver-validation.h --include C:\Users\Max\Documents\PlatformIO\Projects\proj_init\.pio\build\nrf52840_dk\zephyr\misc\generated\struct_tags.json
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Framework incompatible library C:\Users\Max\.platformio\lib\Adafruit BusIO
Framework incompatible library C:\Users\Max\.platformio\lib\Adafruit GFX Library
Framework incompatible library C:\Users\Max\.platformio\lib\ArduinoJson
Framework incompatible library C:\Users\Max\.platformio\lib\ITTIoT
Found 0 compatible libraries
Framework incompatible library C:\Users\Max\.platformio\lib\PubSubClient
Scanning dependencies...
More details about "Library Compatibility Mode": https://docs.platformio.org/page/librarymanager/ldf.html#ldf-compat-mode
No dependencies
Building in release mode
arm-none-eabi-gcc -o .pio\build\nrf52840_dk\offsets\zephyr\arch\arm\core\offsets\offsets.c.o -c -std=c99 -Os -imacrosC:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacrosC:/Users/Max/.platformio/packages/framework-zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/Max/Documents/PlatformIO/Projects/proj_init/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/Max/.platformio/packages/framework-zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -nostdinc -iprefix C:/Users/Max/.platformio/packages/framework-zephyr -iwithprefixbefore/kernel/include -iwithprefixbefore/arch/arm/include -iwithprefixbefore/include -iwithprefixbefore/soc/arm/nordic_nrf/nrf52 -iwithprefixbefore/modules/hal_nordic/nrfx -isystemC:/Users/Max/.platformio/packages/framework-zephyr/lib/libc/minimal/include -isystemc:/users/max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214/bin/../lib/gcc/arm-none-eabi/8.2.1/include -isystemc:/users/max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214/bin/../lib/gcc/arm-none-eabi/8.2.1/include-fixed -DPLATFORMIO=50101 -DARDUINO_NRF52_DK -DBUILD_VERSION=zephyr-v20500 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I.pio\build\nrf52840_dk\zephyr\include\generated -IC:\Users\Max\.platformio\packages\framework-zephyr-segger-0.0.0-alpha+sha.38c79a447e\rtt -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx\drivers\include -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx\mdk -IC:\Users\Max\.platformio\packages\framework-zephyr-cmsis-0.0.0-alpha+sha.c3bd2094f9\CMSIS\Core\Include C:\Users\Max\.platformio\packages\framework-zephyr\arch\arm\core\offsets\offsets.c
arm-none-eabi-gcc -o .pio\build\nrf52840_dk\zephyr_final\zephyr\misc\empty_file.c.o -c -std=c99 -Os -imacrosC:/Users/Max/Documents/PlatformIO/Projects/proj_init/.pio/build/nrf52840_dk/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -mcpu=cortex-m4 -mthumb -mabi=aapcs -imacrosC:/Users/Max/.platformio/packages/framework-zephyr/include/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-strict-overflow -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/Users/Max/Documents/PlatformIO/Projects/proj_init/zephyr=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/Users/Max/.platformio/packages/framework-zephyr=ZEPHYR_BASE -ffunction-sections -fdata-sections -nostdinc -iprefix C:/Users/Max/.platformio/packages/framework-zephyr -iwithprefixbefore/include -iwithprefixbefore/soc/arm/nordic_nrf/nrf52 -iwithprefixbefore/modules/hal_nordic/nrfx -isystemC:/Users/Max/.platformio/packages/framework-zephyr/lib/libc/minimal/include -isystemc:/users/max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214/bin/../lib/gcc/arm-none-eabi/8.2.1/include -isystemc:/users/max/.platformio/packages/toolchain-gccarmnoneeabi@1.80201.190214/bin/../lib/gcc/arm-none-eabi/8.2.1/include-fixed -DPLATFORMIO=50101 -DARDUINO_NRF52_DK -DBUILD_VERSION=zephyr-v20500 -DKERNEL -DNRF52840_XXAA -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -I.pio\build\nrf52840_dk\zephyr\include\generated -IC:\Users\Max\.platformio\packages\framework-zephyr-segger-0.0.0-alpha+sha.38c79a447e\rtt -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx\drivers\include -IC:\Users\Max\.platformio\packages\framework-zephyr-hal-nordic-0.0.0-alpha+sha.f0d54d8449\nrfx\mdk -IC:\Users\Max\.platformio\packages\framework-zephyr-cmsis-0.0.0-alpha+sha.c3bd2094f9\CMSIS\Core\Include C:\Users\Max\.platformio\packages\framework-zephyr\misc\empty_file.c
...