Skip to content

Commit

Permalink
Add Zephyr virtual env
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogs9 committed Sep 16, 2024
1 parent fee1178 commit 60d1c46
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
3 changes: 0 additions & 3 deletions config/freertos/esp32/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ pushd $FW_TARGETDIR >/dev/null
# Install toolchain
mkdir toolchain

# Make sure pip is up to date
pip install --upgrade setuptools --break-system-packages

pushd toolchain >/dev/null
git clone -b v4.1 --recursive https://github.com/espressif/esp-idf.git

Expand Down
2 changes: 2 additions & 0 deletions config/zephyr/generic/build.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
. $PREFIX/config/utils.sh

pushd $FW_TARGETDIR >/dev/null
source $FW_TARGETDIR/venv/bin/activate

source $FW_TARGETDIR/zephyrproject/zephyr/zephyr-env.sh

export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
Expand Down
11 changes: 9 additions & 2 deletions config/zephyr/generic/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@ export PATH=~/.local/bin:"$PATH"
export ZEPHYR_VERSION="v0.12.4"
export ARCH=$(uname -m)

# Create a virtual environment
python3 -m venv $FW_TARGETDIR/venv
source $FW_TARGETDIR/venv/bin/activate

# Install west
pip3 install --user -U west --break-system-packages
pip3 install --user -U west

pushd $FW_TARGETDIR >/dev/null

Expand All @@ -31,7 +35,7 @@ pushd $FW_TARGETDIR >/dev/null
west update
popd >/dev/null

pip3 install -r zephyrproject/zephyr/scripts/requirements.txt --ignore-installed --break-system-packages
pip3 install -r zephyrproject/zephyr/scripts/requirements.txt --ignore-installed

if [ "$PLATFORM" = "host" ]; then
if [ "$ARCH" = "aarch64" ]; then
Expand Down Expand Up @@ -71,4 +75,7 @@ pushd $FW_TARGETDIR >/dev/null
touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE
touch mcu_ws/ros2/ros2_tracing/lttngpy/COLCON_IGNORE

# Upgrade sphinx
pip install --force-reinstall Sphinx==4.2.0

popd >/dev/null
2 changes: 2 additions & 0 deletions config/zephyr/generic/flash.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
pushd $FW_TARGETDIR > /dev/null

source $FW_TARGETDIR/venv/bin/activate

ZEPHYR_BUILD_DIR="$FW_TARGETDIR/build/zephyr"

# Host platform (=native_posix) is special, as flashing is actually just executing the binary
Expand Down
1 change: 1 addition & 0 deletions config/zephyr/generic/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
<build_depend>gcc-multilib</build_depend>
<build_depend>g++-multilib</build_depend>
<build_depend>openocd</build_depend>
<build_depend>python3-venv</build_depend>

</package>

0 comments on commit 60d1c46

Please sign in to comment.