STM32 Rust Page: Difference between revisions

From bibbleWiki
Jump to navigation Jump to search
Created page with "=Introduction= This is meant to be a general page for rust when using STM32 ==Install Rust For Embedded== First we install rust. This adds something to ~/.bashrc so rebooting is the quickest way <syntaxhighlight lang="bash"> sudo apt install curl curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh </syntaxhighlight> For stm32 we need the toolchain <syntaxhighlight lang="bash"> rustup target add thumbv7em-none-eabihf cargo install cargo-binutils cargo install c..."
 
Line 12: Line 12:
cargo install cargo-binutils
cargo install cargo-binutils
cargo install cargo-generate
cargo install cargo-generate
sudo apt install gdb-multiarch openocd qemu-system-arm
</syntaxhighlight>
</syntaxhighlight>
Now we install the debugger and the gcc tools. We tried the arm download but it relied on python and shared libraries not on Ubuntu 24.04
Install the gcc tools
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
apt install gcc-arm-linux-gnueabi gcc-arm-linux-gnueabihf gcc-arm-none-eabi 
sudo apt install gdb-multiarch openocd qemu-system-arm
</syntaxhighlight>
</syntaxhighlight>
I now use the arm download and put it in the /opt directory, currently arm-gnu-toolchain-14.2, and add it to my path in .bashrc
Now we need to install the arm software. For me I went to the arm download page and took the latest version.[[https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads here]]<br>
 
I unzipped it and put it in the /opt directory, currently arm-gnu-toolchain-14.2, and add it to my path in .bashrc

Revision as of 22:31, 5 February 2025

Introduction

This is meant to be a general page for rust when using STM32

Install Rust For Embedded

First we install rust. This adds something to ~/.bashrc so rebooting is the quickest way

sudo apt install curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

For stm32 we need the toolchain

rustup target add thumbv7em-none-eabihf
cargo install cargo-binutils
cargo install cargo-generate

Install the gcc tools

sudo apt install gdb-multiarch openocd qemu-system-arm

Now we need to install the arm software. For me I went to the arm download page and took the latest version.[here]

I unzipped it and put it in the /opt directory, currently arm-gnu-toolchain-14.2, and add it to my path in .bashrc