Here are the installation commands for a few Linux distributions.
NOTE
gdb-multiarchis the GDB command you'll use to debug your ARM Cortex-M programs
sudo apt-get install \
gdb-multiarch \
minicom \
openocdNOTE
arm-none-eabi-gdbis the GDB command you'll use to debug your ARM Cortex-M programs
sudo apt-get install \
gdb-arm-none-eabi \
minicom \
openocdsudo dnf install \
minicom \
openocd \
gdbNOTE
arm-none-eabi-gdbis the GDB command you'll use to debug your ARM Cortex-M programs
sudo pacman -S \
arm-none-eabi-gdb \
minicom \
openocdNOTE
arm-none-eabi-gdbis the GDB command you'll use to debug your ARM Cortex-M programs
For distros that don't have packages for ARM's pre-built
toolchain,
download the "Linux 64-bit" file and put its bin directory on your path.
Here's one way to do it:
mkdir -p ~/local && cd ~/localtar xjf /path/to/downloaded/file/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2Then, use your editor of choice to append to your PATH in the appropriate
shell init file (e.g. ~/.zshrc or ~/.bashrc):
PATH=$PATH:$HOME/local/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux/bin
sudo apt-get install \
bluez \
rfkillsudo dnf install \
bluez \
rfkillsudo pacman -S \
bluez \
bluez-utils \
rfkillThese rules let you use USB devices like the F3 and the Serial module without root privilege, i.e.
sudo.
Create 99-openocd.rules in /etc/udev/rules.d using the idVendor and idProduct
from the lsusb output.
For example, connect the STM32F3DISCOVERY to your computer using a USB cable. Be sure to connect the cable to the "USB ST-LINK" port, the USB port in the center of the edge of the board.
Execute lsusb:
lsusb | grep ST-LINKIt should result in something like:
$ lsusb | grep ST-LINK
Bus 003 Device 003: ID 0483:374b STMicroelectronics ST-LINK/V2.1
So the idVendor is 0483 and idProduct is 374b.
sudo vi /etc/udev/rules.d/99-openocd.rulesWith the contents:
# STM32F3DISCOVERY - ST-LINK/V2.1
ATTRS{idVendor}=="0483", ATTRS{idProduct}=="374b", MODE:="0664"
Create /etc/udev/rules.d/99-ftdi.rules:
sudo vi /etc/udev/rules.d/99-openocd.rulesWith the contents:
# FT232 - USB <-> Serial Converter
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6001", MODE:="0664"
sudo udevadm control --reload-rulesIf you had any board plugged to your computer, unplug them and then plug them in again.
Now, go to the next section.