.. _beagleconnect-freedom-using-zephyr: Using Zephyr ############ Developing directly in Zephyr will not be ultimately required for end-users who won't touch the firmware running on BeagleConnectâ„¢ Freedom and will instead use the BeagleConnectâ„¢ Greybus functionality, but is important for early adopters as well as people looking to extend the functionality of the open source design. If you are one of those people, this is a good place to get started. Equipment to begin development ****************************** There are many options, but using BeaglePlay gives a reasonable common environment. Please adjust as you see fit. Required ======== * BeaglePlay with provided antennas * BeagleConnect Freedom with provided USB cable * 2x 5V/3A USB power adapters * USB Type-C cable for use with BeaglePlay Recommended ============ * Ethernet cable and Internet connection Install the SDK on BeaglePlay ================================= You can use BeaglePlay as the primary development board for setting up the Zephyr environment on BeagleConnect Freedom. To setup Zephyr on BeaglePlay, see :ref:`beagleplay-zephyr-development-setup`. The instructions linked above setup the environment for targeting BeaglePlay's on CC1352. We need to change it to target BeagleConnect Freedom. You can directly go on to Step 5 under `Zephyr Setup for BeagleConnect Freedom `_. .. todo:: note the tested version of software for BeaglePlay Zephyr setup for BeagleConnect Freedom ========================================= To setup Zephyr on your machine for running modules on BeagleConnect Freedom, follow the given instructions : 1. First, install the Zephyr SDK bundle: .. code-block:: bash cd ~ wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.15.1/zephyr-sdk-0.16.8_linux-aarch64_minimal.tar.gz wget -O - https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v0.16.8/sha256.sum | shasum --check --ignore-missing .. note:: Find the latest releases of the Zephyr SDK `here `_. Change the version of the sdk according to your requirement. Also, you may replace ```` with the host system you are currently working with. 2. Extract the Zephyr SDK bundle: .. code-block:: bash tar xf zephyr-sdk-0.16.8_linux-aarch64_minimal.tar.gz .. note:: It is recommended to extract the Zephyr SDK bundle at one of the following locations: .. code-block:: bash - $HOME - $HOME/.local - $HOME/.local/opt - $HOME/bin - /opt - /usr/local The Zephyr SDK bundle archive contains the ```` directory and, when extracted under ``<$HOME>``, the resulting installation path will be ``<$HOME/zephyr-sdk-``. 3. Run the Zephyr SDK bundle setup script: .. code-block:: bash cd zephyr-sdk-0.16.8 ./setup.sh 4. Further, go on to setup the BeagleConnect Freedom (BCF)'s SDK. .. code-block:: bash west init -m https://github.com/zephyrproject-rtos/zephyr --mr sdk zephyr-beagle-cc1352-sdk cd $HOME/zephyr-beagle-cc1352-sdk python3 -m venv zephyr-beagle-cc1352-env 5. Export the required variables as given below: .. code-block:: bash echo "export ZEPHYR_TOOLCHAIN_VARIANT=zephyr" >> $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate echo "export ZEPHYR_SDK_INSTALL_DIR=$HOME/zephyr-sdk-0.16.8" >> $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate echo "export ZEPHYR_BASE=$HOME/zephyr-beagle-cc1352-sdk/zephyr" >> $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate echo 'export PATH=$HOME/zephyr-beagle-cc1352-sdk/zephyr/scripts:$PATH' >> $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate echo "export BOARD=beagleplay" >> $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate source $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate west update west zephyr-export pip3 install -r zephyr/scripts/requirements-base.txt .. note:: You might need to change the version of the Zephyr-SDK based on the SDK setup done in Step 1. Try demo applications ********************* Now you can build various Zephyr applications Build and flash Blinky ====================== .. note:: Before building any example, ensure to run this command: .. code-block:: bash source $HOME/zephyr-beagle-cc1352-sdk/zephyr-beagle-cc1352-env/bin/activate Run the build and flash commands. Make sure to connect the BeagleConnect Freedom to your computer before flashing. .. code-block:: bash cd $ZEPHYR_BASE west build zephyr/samples/basic/blinky west flash Zephyr Documentation ====================== You can refer to `Zephyr Getting Started `_ for further development! Debug applications over the serial terminal =========================================== .. note:: #TODO#