@brief nRF Zephyr Debug Notes @details nRF52 DK @auth Justin Reina @date 8/23/21 @section Procedure [2] Create a fresh VM of Ubuntu 20.04 Update & Upgrade sudo apt install git gitk sudo apt update sudo apt upgrade Get Kitware wget https://apt.kitware.com/kitware-archive.sh sudo bash kitware-archive.sh Use apt to install the required dependencies: sudo apt install --no-install-recommends git cmake ninja-build gperf \ ccache dfu-util device-tree-compiler wget \ python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \ make gcc gcc-multilib g++-multilib libsdl2-dev Install west pip3 install --user -U west echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc source ~/.bashrc Get the Zephyr source code: west init ~/zephyrproject cd ~/zephyrproject west update Export a Zephyr CMake package west zephyr-export Zephyr’s scripts: pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt 1. Download the latest SDK installer: cd ~ wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.13.0/zephyr-sdk-0.13.0-linux-x86_64-setup.run 2. Run the installer, installing the SDK in ~/zephyr-sdk-0.13.0: chmod +x zephyr-sdk-0.13.0-linux-x86_64-setup.run ./zephyr-sdk-0.13.0-linux-x86_64-setup.run -- -d ~/zephyr-sdk-0.13.0 >src ctrl roots of zephyr-sdk-0.13.0\ & zephyrproject\ 3. Install udev rules, which allow you to flash most Zephyr boards as a regular user: sudo cp ~/zephyr-sdk-0.13.0/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d sudo udevadm control --reload 4. Build the Blinky Sample cd ~/zephyrproject/zephyr west build -p auto -b nrf52dk_nrf52832 samples/basic/blinky Flash the Sample west flash @section Nordic Community Try [3] Get the Zephyr source code: west init ~/zephyrproject cd ~/zephyrproject west update > 'west flash' cd /zephyr/samples/basic/blinky > cd ~/zephyrproject/zephyr/samples/basic/blinky Connect nrf52 DK to computer and turn on it on > Devices -> USB => USB Settings... -> Add new west build -b nrf52dk_nrf52832 && west flash Now LED1 should blink 'nrfjprog --program' command cd /zephyr/samples/basic/blinky/build/zephyr nrfjprog --eraseall Make sure LED1 stops blinking nrfjprog --program zephyr.hex --sectorerase nrfjprog --reset Now LED1 should blink @section Notes @board nRF52 DK [1] *PCA10040 2.1.0 *nrf52dk_nrf52832 @section Opens NCS has Zephyr built in? @section Reference 1. https://www.nordicsemi.com/Products/Development-hardware/nrf52-dk 2. https://docs.zephyrproject.org/latest/getting_started 3. https://devzone.nordicsemi.com/f/nordic-q-a/75927/unable-to-run-zephyr-programs-on-nrf52840dk/313361#313361