Zephyr application created using West and using T2 topology.
- Update SO
sudo apt update
sudo apt upgrade- Install West
pip install west # Reset console- Initialize Workspace
west init -m https://github.com/zephyrproject-rtos/zephyr.git --mr v3.6.0 . # For raw workspace that include all modules.
west init -l # For custom west.yml file - Update West
west update # Install all modules presents in Zephyr/west.yml or west.yml custom file.- IMPORTANT: Install nrf command line tools to include j-link segger
wget https://nsscprodmedia.blob.core.windows.net/prod/software-and-other-downloads/desktop-software/nrf-command-line-tools/sw/versions-10-x-x/10-24-2/nrf-command-line-tools_10.24.2_amd64.deb
sudo dpkg -i nrf-command-line-tools_10.24.2_amd64.deb
sudo apt install /opt/nrf-command-line-tools/share/JLink_Linux_V794e_x86_64.deb --fix-broken- obtain the corresponding completion script and have it sourced to enable shell completion. Using the completion scripts:
west completion bash > ~/west-completion.bash; echo "source ~/west-completion.bash" >> ~/.bashrc- Export a Zephyr CMake package. This allows CMake to automatically load boilerplate code required for building Zephyr applications.
west zephyr-export- Zephyr’s scripts/requirements.txt file declares additional Python dependencies. Install them with pip. pip install -r ~/zephyrproject/zephyr/scripts/requirements.txt
- Download and verify the Zephyr SDK bundle:
cd ~
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/zephyr-sdk-0.17.0_linux-x86_64.tar.xz
O -> wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.9/zephyr-sdk-0.16.9_linux-x86_64.tar.xz
wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.17.0/sha256.sum | shasum --check --ignore-missing
O -> wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.9/sha256.sum | shasum --check --ignore-missing- Extract the Zephyr SDK bundle archive:
tar xvf zephyr-sdk-0.17.0_linux-x86_64.tar.xz
O -> tar xvf zephyr-sdk-0.16.9_linux-x86_64.tar.xz- Run the Zephyr SDK bundle setup script:
cd zephyr-sdk-0.17.0
./setup.sh
# You only need to run the setup script once after extracting the Zephyr SDK bundle.
# You must rerun the setup script if you relocate the Zephyr SDK bundle directory after the initial setup.- Install udev rules, which allow you to flash most Zephyr boards as a regular user:
sudo cp ~/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d
sudo udevadm control --reload- Configure zephyr ariables:
export ZEPHYR_SDK_INSTALL_DIR=/opt/zephyr-sdk/zephyr-sdk-0.16.9
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
usbipd list
usbipd bind --busid 1-2
usbipd attach --wsl --busid 1-2
usbipd detach --busid 1-2
zephyrworkspace/
├─zephyrproject
│ ├─ CMakeLists.txt
│ ├─ west.yml
│ ├─ prj.conf
│ ├─ src/
│ │ ├─ main.c
export ZEPHYR_BASE=~/zephyrworkspace/zephyr
export ZEPHYR_BASE=~zephyr-project/zephyr-v3.7.0
- First enable and modify the options you want using menu/guiconfig
west build -b native_posix_64 --build-dir build -t menuconfig
- Then a backup file will be automatically created in build/zephyr/.config.old
zephyrworkspace/
├─zephyrproject
│ ├─ CMakeLists.txt
│ ├─ build
│ │ ├─ zephyr
│ │ │ ├─ .config
│ │ │ ├─ .config.old
│ ├─ west.yml
│ ├─ prj.conf
│ ├─ src/
│ │ ├─ main.c
- Comapare both files using:
diff --changed-group-format='%>' --unchanged-group-format='' .config .config.old > mydiff.conf # this command compare .config .config.old and then save the differences between files in mydiff.confi