Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to do the following: #690

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions config/zephyr/generic/create.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,43 +15,47 @@ if ! (( $CMAKE_VERSION_MAJOR_NUMBER > 3 || \
fi

export PATH=~/.local/bin:"$PATH"
export ZEPHYR_VERSION="v0.12.4"
export ZEPHYR_VERSION="0.16.3"
export ARCH=$(uname -m)

pushd $FW_TARGETDIR >/dev/null

west init zephyrproject
pushd zephyrproject >/dev/null
cd zephyr
git checkout zephyr-v2.6.0
git checkout v3.6.0
cd ..
west update
west blobs fetch hal_espressif
west zephyr-export
popd >/dev/null

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

if [ "$PLATFORM" = "host" ]; then
if [ "$ARCH" = "aarch64" ]; then
export TOOLCHAIN_VERSION=zephyr-sdk-0.13.1-linux-aarch64-setup.run
export ZEPHYR_VERSION="v0.13.1"
else
export TOOLCHAIN_VERSION=zephyr-sdk-0.12.4-x86_64-linux-setup.run
fi
else
if [ "$ARCH" = "aarch64" ]; then
export TOOLCHAIN_VERSION=zephyr-toolchain-arm-0.13.1-linux-aarch64-setup.run
export ZEPHYR_VERSION="v0.13.1"
else
export TOOLCHAIN_VERSION=zephyr-toolchain-arm-0.12.4-x86_64-linux-setup.run
fi
sdkfound=false
if [ -e ~/.zephyrrc ]; then
source ~/.zephyrrc
if [ -d $ZEPHYR_SDK_INSTALL_DIR ]; then
ln -s $ZEPHYR_SDK_INSTALL_DIR zephyr-sdk
sdkfound=true
fi
fi
echo PLATFORM: $PLATFORM
if [ "$sdkfound" = false ]; then
export TOOLCHAIN_VERSION=zephyr-sdk-${ZEPHYR_VERSION}_linux-${ARCH}.tar.xz

wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/$ZEPHYR_VERSION/$TOOLCHAIN_VERSION
chmod +x $TOOLCHAIN_VERSION
./$TOOLCHAIN_VERSION -- -d $(pwd)/zephyr-sdk -y
wget https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v$ZEPHYR_VERSION/$TOOLCHAIN_VERSION
chmod +x $TOOLCHAIN_VERSION
tar -xvf ./$TOOLCHAIN_VERSION
mv zephyr-sdk-${ZEPHYR_VERSION} zephyr-sdk

rm -rf $TOOLCHAIN_VERSION
rm -rf $TOOLCHAIN_VERSION

fi
pushd zephyr-sdk
./setup.sh -t all -c -h
popd
echo FW_TARGET_DIR: ${FW_TARGET_DIR}
export ZEPHYR_TOOLCHAIN_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=$FW_TARGETDIR/zephyr-sdk

Expand All @@ -68,6 +72,6 @@ pushd $FW_TARGETDIR >/dev/null
touch mcu_ws/uros/rclc/rclc_examples/COLCON_IGNORE

# Upgrade sphinx
pip install --force-reinstall Sphinx==4.2.0
#pip install --force-reinstall Sphinx==4.2.0
drensber marked this conversation as resolved.
Show resolved Hide resolved

popd >/dev/null
2 changes: 1 addition & 1 deletion config/zephyr/generic/flash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ else

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

west flash
west flash ${UROS_EXTRA_FLASH_ARGS[@]}

fi

Expand Down
3 changes: 3 additions & 0 deletions config/zephyr/generic/supported_platforms
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ olimex-stm32-e407
nucleo_f401re
nucleo_h743zi
nucleo_f746zg
esp32_devkitc_wroom
esp32c3_devkitm
rpi_pico_w
7 changes: 7 additions & 0 deletions scripts/flash_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -e
set -o nounset
set -o pipefail

UROS_EXTRA_FLASH_ARGS=""

FW_TARGETDIR=$(pwd)/firmware
PREFIX=$(ros2 pkg prefix micro_ros_setup)

Expand All @@ -16,6 +18,11 @@ else
exit 1
fi

if [[ -n "$@" ]]; then
UROS_EXTRA_FLASH_ARGS=("$@")
fi
export UROS_EXTRA_FLASH_ARGS

# Flash specific firmware folder if needed
if [ -d "$PREFIX/config/$RTOS/generic" ]; then
if [ -f $PREFIX/config/$RTOS/generic/flash.sh ]; then
Expand Down
Loading