Skip to content

Commit

Permalink
[script] update scripts to install ARM GNU Toolchain 12
Browse files Browse the repository at this point in the history
This is compiler is a requirement for GSDK 4.4.0
  • Loading branch information
lmnotran committed Dec 18, 2023
1 parent 520d8bb commit 561b645
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 16 deletions.
22 changes: 7 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ jobs:
fail-fast: false
matrix:
include:
- gcc_ver: 6
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/6-2017q2/gcc-arm-none-eabi-6-2017-q2-update-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-6-2017-q2-update
- gcc_ver: 7
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-7-2018-q2-update
- gcc_ver: 9
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-9-2019-q4-major
- gcc_ver: 10.3
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2
gcc_extract_dir: gcc-arm-none-eabi-10.3-2021.10
- gcc_ver: 12.2.Rel1
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu/12.2.rel1/binrel/arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi.tar.xz
gcc_extract_dir: arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi
- gcc_ver: 12.3.Rel1
gcc_download_url: https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz
gcc_extract_dir: arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi

steps:
- uses: actions/checkout@v4
Expand All @@ -83,9 +77,7 @@ jobs:

- name: Bootstrap
run: |
cd /tmp
wget --tries 4 --no-check-certificate --quiet ${{ matrix.gcc_download_url }} -O gcc-arm.tar.bz2
tar xjf gcc-arm.tar.bz2
script/bootstrap arm_toolchain
- name: Build
run: |
Expand Down
28 changes: 27 additions & 1 deletion script/bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ install_packages_apt()
python3-pip \
git-lfs \
unzip \
wget
wget \
xz-utils
}

install_packages_opkg()
Expand Down Expand Up @@ -118,6 +119,29 @@ do_bootstrap_silabs()
echo "Bootstrapping silabs"
"${repo_dir}"/script/bootstrap_silabs
}

install_arm_toolchain()
{
local url=${1-"https://developer.arm.com/-/media/Files/downloads/gnu/12.3.rel1/binrel/arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi.tar.xz"}
local extract_dir=${2-"arm-gnu-toolchain-12.3.rel1-x86_64-arm-none-eabi"}

echo 'Installing GNU Arm Embedded Toolchain...'

# Download
cd /opt/
local tarball=gcc-arm.tar.xz
wget --tries 4 --no-check-certificate --quiet ${url} -O ${tarball}

# Extract
tar xvf ${tarball}

# Link
sudo ln -s -f /opt/${extract_dir}/bin/* /usr/local/bin/

# Cleanup
rm ${tarball}
}

main()
{
if [ $# == 0 ]; then
Expand All @@ -126,6 +150,8 @@ main()
do_bootstrap_silabs
elif [ "$1" == 'packages' ]; then
install_packages
elif [ "$1" == 'arm_toolchain' ]; then
install_arm_toolchain
elif [ "$1" == 'openthread' ]; then
do_bootstrap_openthread
elif [ "$1" == 'python' ]; then
Expand Down

0 comments on commit 561b645

Please sign in to comment.