-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
55 lines (46 loc) · 1.86 KB
/
Copy pathsetup.sh
File metadata and controls
55 lines (46 loc) · 1.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env bash
# Exit immediately if a command exits with a non-zero status
set -e
echo "===================================================="
echo " Starting Setup for RPL STM32 CMake Build"
echo "===================================================="
# 1. Enable the Universe repository (where arm-none-eabi lives)
echo "--> Enabling Ubuntu Universe repository..."
sudo apt-get install -y software-properties-common
sudo add-apt-repository -y universe
# 2. Update package lists
echo "--> Updating package lists..."
sudo apt-get update -y
# 3. Install core build tools and language servers
echo "--> Installing build tools (Build-Essential, CMake, Ninja, Git, Clangd)..."
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
git \
clangd
# 4. Install the ARM GCC Cross-Compiler toolchain
echo "--> Installing ARM Cross-Compiler (arm-none-eabi-gcc)..."
sudo apt-get install -y \
gcc-arm-none-eabi \
binutils-arm-none-eabi \
gdb-arm-none-eabi \
libnewlib-arm-none-eabi
# 5. Install hardware flashing and debugging utilities
echo "--> Installing hardware utilities (OpenOCD, STLink Tools)..."
sudo apt-get install -y \
openocd \
stlink-tools
# 6. Verification
echo "===================================================="
echo " Verification"
echo "===================================================="
echo -n "CMake version: " && cmake --version | head -n 1
echo -n "Ninja version: " && ninja --version
echo -n "ARM GCC version: " && arm-none-eabi-gcc --version | head -n 1
echo -n "Clangd version: " && clangd --version
echo -n "OpenOCD version: " && openocd --version | head -n 1
echo -n "ST-Link CLI version: " && st-info --version
echo "===================================================="
echo " Setup Complete! You are ready to build and flash."
echo "===================================================="