This project strives to make containerized development with Nordic/ST chips, Zephyr-RTOS and VS Code as smooth as possible. It also provides an environment for running CI-jobs.
- Install
Dev Containers
extension. (There should also be a recommendation pop-up window prompting to install recommended extensions) - Clone this repository to an empty directory so that there are no siblings.
- Open it in VSCode.
- When get prompted to
Reopen in Container
, do so. In case prompt does not come, callDev Container: Reopen in container
Action. - Wait until setup is complete. Should you see prompts to Reload Window, don't do that just yet. First time it may take a while, because the image is built or downloaded and then setup scripts are run.
- Reload Window (either through prompt or just close and open it). It's needed for some extensions and to select newly installed python venv for tasks.
- Enjoy! Or not.
If you want to run a specific command, you may also do run_in_docker.sh <SPECIFIC COMMAND>
.
You can build or flash from the calling context with run_in_docker.sh west build
and run_in_docker.sh west flash -r pyocd
.
You can also run bash in Docker by run_in_docker.sh bash
.
Then you can also attach to running container with VSCode, but you won't have docker extensions and some other configurations.
Please note that if only on_docker_startup.sh
is changed, there is no need to rebuild the image!
- For debugging on Windows WSL you will need:
- USB-IP
- NRF command line tools on WSL and Windows
- Restaring udev:
sudo service udev restart && sudo udevadm control --reload
-
Minicom has to be setup to use Logs. It's not done since Serial ports can be individual. Check them with
dmesg | grep tty
,lsusb
. Usually it's something like/dev/ttyACM0
. Usesudo minicom -s
to set it up,/dev/ttyACM0
is set as default. -
If building container does not work:
- try adding
--no-cache
todocker build
command. - try running the first time from the shell script instead of VSCode to see the logs clearly without pop-up errors.
- try adding
-
If you reloaded VSCode before intitial installation was complete, no problem. Close VSCode, run
docker ps
, stop running containers and open VSCode again. -
If image is build succesfully in
run_in_docker.sh
, but you have issues with VSCode, try runningDev Containers: Rebuild without cache and reopen in contaier
action (not from a container). Also ensure that there are no modification which cause container to exit before VSCode canattach itself. -
If you have issues with
west flash
, ensure$LANG
is not set. "terminal.integrated.detectLocale": "off" has to be off, otherwise VSCode sets this ENV.