From 3f6737f6886880f4fe4245d7aa8f30a2e11f3f51 Mon Sep 17 00:00:00 2001 From: Magdalena Kasenberg Date: Tue, 5 Oct 2021 12:26:40 +0200 Subject: [PATCH] doc: autopts: Remove duplication of getting started guide and highlight only the differences in setup instead. Signed-off-by: Magdalena Kasenberg --- .../bluetooth/autopts/autopts-linux.rst | 77 +--------- .../bluetooth/autopts/autopts-win10.rst | 139 ++---------------- 2 files changed, 15 insertions(+), 201 deletions(-) diff --git a/doc/guides/bluetooth/autopts/autopts-linux.rst b/doc/guides/bluetooth/autopts/autopts-linux.rst index 68915352e01..67b21a8ef8f 100644 --- a/doc/guides/bluetooth/autopts/autopts-linux.rst +++ b/doc/guides/bluetooth/autopts/autopts-linux.rst @@ -26,82 +26,7 @@ Setup Linux Setup Zephyr project --------------------- -Do the setup from Zephyr site https://docs.zephyrproject.org/latest/getting_started/index.html, -especially: - -Update OS -^^^^^^^^^^ - -This guide covers Ubuntu version 18.04 LTS and later. - -.. code-block:: - - sudo apt update - sudo apt upgrade - -Install dependencies -^^^^^^^^^^^^^^^^^^^^^ - -.. code-block:: - - 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 - -Get Zephyr and install Python dependencies -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Install west, and make sure ~/.local/bin is on your PATH environment variable: - -.. code-block:: - - pip3 install --user -U west - echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc - source ~/.bashrc - -Get the Zephyr source code: - -.. code-block:: - - west init ~/zephyrproject - cd ~/zephyrproject - west update - -Export a Zephyr CMake package. This allows CMake to automatically load -boilerplate code required for building Zephyr applications: - -.. code-block:: - - west zephyr-export - -Zephyr’s scripts/requirements.txt file declares additional Python dependencies. -Install them with pip3: - -.. code-block:: - - pip3 install --user -r ~/zephyrproject/zephyr/scripts/requirements.txt - -Install a Toolchain -^^^^^^^^^^^^^^^^^^^^ - -A toolchain provides a compiler, assembler, linker, and other programs -required to build Zephyr applications. - -Download the latest SDK installer from https://github.com/zephyrproject-rtos/sdk-ng/releases and -run the installer, installing the SDK in ~/zephyr-sdk-, e.g.: - -.. code-block:: - - chmod +x zephyr-sdk--setup.run - ./zephyr-sdk--setup.run -- -d ~/zephyr-sdk- - -Install udev rules, which allow you to flash most Zephyr boards as a regular user: - -.. code-block:: - - sudo cp ~/zephyr-sdk-/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d - sudo udevadm control --reload +Do the setup from `Getting Started Guide `_. Install nrftools (only required in the actual hardware test mode) ================================================================= diff --git a/doc/guides/bluetooth/autopts/autopts-win10.rst b/doc/guides/bluetooth/autopts/autopts-win10.rst index d3af5977afb..7b7fbd54db1 100644 --- a/doc/guides/bluetooth/autopts/autopts-win10.rst +++ b/doc/guides/bluetooth/autopts/autopts-win10.rst @@ -69,7 +69,7 @@ drivers from installation directory Setup Zephyr project for Windows ================================= -Setup from Zephyr site https://docs.zephyrproject.org/latest/getting_started/index.html: +Brief of setup `Getting Started Guide `_: Open Git Bash and go to home: @@ -115,134 +115,23 @@ dependencies. Install them with pip: pip3 install -r ~\zephyrproject\zephyr\scripts\requirements.txt -Setup WSL1 with Ubuntu 20.4 +Setup WSL with Ubuntu ============================ -Setup Install Ubuntu 20.4 on `WSL1 `_. -Open PowerShell as Administrator and run: - -.. code-block:: - - dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart - -Restart Windows. After restart, open Microsoft Store and install Ubuntu 20.4 LTS. - -.. image:: install_ubuntu_on_wsl.png - :height: 350 - :width: 500 - :align: center - -Run Ubuntu. You will be asked to create a user account and password: - -.. image:: ubuntu_first_launch.png - :height: 150 - :width: 800 - :align: center - -When finished, run commands: - -.. code-block:: - - sudo apt update - sudo apt upgrade - -Install python3: - -.. code-block:: - - sudo apt install python3 - -Install pip: - -.. code-block:: - - sudo apt install python3-pip - -Install west: - -.. code-block:: - - pip3 install --user -U west - -Export local bin to PATH: - -.. code-block:: - - echo 'export PATH=~/.local/bin:"$PATH"' >> ~/.bashrc - -Reload PATH: - -.. code-block:: - - source ~/.bashrc - -Install cmake: - -.. code-block:: - - sudo apt install cmake - -Go to your zephyrproject: - -.. code-block:: - - cd /mnt/c/Users/Codecoup/zephyrproject - -and then run: +Install Ubuntu 20.4 on `WSL `_. + +When finished, perform the Ubuntu setup from `Getting Started Guide `_, +but skip west init and west update commands, as you can use the previously downloaded +Zephyr source code at mounted Windows folder /mnt/c/Users//zephyrproject. +Skip install of udev rules also, because we won't flash the board from wsl. + +Remember to run: .. code-block:: + cd /mnt/c/Users//zephyrproject west zephyr-export - pip3 install --user wheel - pip3 install --user -r /mnt/c/Users/codecoup/zephyrproject/zephyr/scripts/requirements.txt - -Check if all modules have been installed: - -.. code-block:: - - pip3 list - -If modules still will be missing, just install them with: - -.. code-block:: - - pip3 install - -Install Ninja: - -.. code-block:: - - pip3 install ninja - -Go to home: - -.. code-block:: - - cd ~ - -Download latest toolchain installer from https://github.com/zephyrproject-rtos/sdk-ng/releases. Move it to ~ - -.. code-block:: - - mv /mnt/c/Users/Codecoup/Downloads/zephyr-sdk--setup.run ~ - -Give permissions to the installer: - -.. code-block:: - - chmod +x zephyr-sdk--setup.run - -and run the installer: - -.. code-block:: - - ./zephyr-sdk--setup.run -- -d ~/zephyr-sdk- - -Copy rules: - -.. code-block:: - - sudo cp ~/zephyr-sdk-/sysroots/x86_64-pokysdk-linux/usr/share/openocd/contrib/60-openocd.rules /etc/udev/rules.d + pip3 install --user -r zephyr/scripts/requirements.txt Restart the Ubuntu machine. You may want to shutdown all WSL consoles from Windows's Git Bash: @@ -255,7 +144,7 @@ After Ubuntu restart, go to: .. code-block:: - cd /mnt/c/Users/codecoup/zephyrproject + cd /mnt/c/Users//zephyrproject and test if west can build: @@ -267,7 +156,7 @@ From now on, you can build projects by typing in Windows's Git Bash: .. code-block:: - wsl -d Ubuntu-20.04 -u codecoup -- bash -c -i "cd /mnt/c/Users/Codecoup/zephyrproject/ ; west build -p auto -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/tester/" + wsl -d Ubuntu-20.04 -u -- bash -c -i "cd /mnt/c/Users//zephyrproject/ ; west build -p auto -b nrf52840dk_nrf52840 zephyr/tests/bluetooth/tester/" Install nrftools =================