Devcontainer for Visual Studio Code to develop microcontroller applications easily with the nRF Connect SDK.
Full explaination on my blog post
{ | |
"name": "nRFConnect-SDK", | |
"build": { | |
"_comment" : "Links to the dockerfile", | |
"dockerfile": "Dockerfile" | |
}, | |
"customizations": { | |
"vscode": { | |
"settings": { | |
"_comment": "The command called when opening the terminal", | |
"terminal.integrated.shell.linux": "nrfutil toolchain-manager launch /bin/bash -- /root/entry.sh", | |
"_comment": "Path to the working directory for nRF Connect extension", | |
"nrf-connect.topdir": "/workdir", | |
"_comment": "Path to the nRF Connect SDK", | |
"nrf-connect.toolchainManager.installDirectory": "/root/ncs", | |
"_comment": "Program used to detect conneted devices", | |
"nrf-connect.deviceProvider": "nrfjprog" | |
}, | |
"_comment": "Extensions to be installed", | |
"extensions": [ | |
"nordic-semiconductor.nrf-connect-extension-pack", | |
"ms-vscode.cpptools", | |
"twxs.cmake", | |
"mhutchie.git-graph", | |
"geeebe.duplicate", | |
"mcu-debug.debug-tracker-vscode", | |
"marus25.cortex-debug" | |
] | |
} | |
}, | |
"userEnvProbe": "loginInteractiveShell", | |
"_comment": "Mount the working folder...", | |
"workspaceMount": "source=${localWorkspaceFolder},target=/workdir/workspace,type=bind", | |
"_comment": "... to this path", | |
"workspaceFolder": "/workdir/workspace", | |
"_comment": "The privileged container will have access to the USB devices", | |
"runArgs": [ "--privileged" ] | |
} |
# Derive from Nordic's image, SDK version 2.5 | |
FROM nordicplayground/nrfconnect-sdk:v2.5-branch | |
# Update the distro | |
RUN apt-get -y update | |
# Install git and GDB | |
RUN apt-get -y install git gdb-multiarch | |
# Create the workspace folder | |
RUN mkdir /workdir/workspace |
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"cwd": "${workspaceFolder}", | |
"_comment": "The elf file to debug", | |
"executable": "${workspaceFolder}/Main/build/zephyr/zephyr.elf", | |
"name": "Cortex debug Main", | |
"request": "launch", | |
"type": "cortex-debug", | |
"_comment": "Run to main", | |
"runToEntryPoint": "main", | |
"showDevDebugOutput": "none", | |
"_comment": "Which type of debugger to use", | |
"servertype": "jlink", | |
"_comment": "Location of the debug server", | |
"serverpath": "/opt/SEGGER/JLink/JLinkGDBServerCLExe", | |
"_comment": "GDB path, we installed it in the Dockerfile", | |
"gdbPath": "gdb-multiarch", | |
"_comment": "The device to debug", | |
"device": "nRF52833_xxAA", | |
"_comment": "Path to the SVD file fo the device", | |
"svdFile": "/workdir/modules/hal/nordic/nrfx/mdk/nrf52833.svd" | |
} | |
] | |
} |