STM32 Tutorials¶
These tutorials will help you get started with TROPIC01 on STM32-based platforms using Libtropic. Currently, we officially support Nucleo F439ZI and Nucleo L432KC development boards.
We will go through our examples in the examples/stm32/ directory. In this directory, there are multiple subdirectories for each supported Nucleo board. Most of the instructions in this tutorial are common for all of the boards.
Hardware Setup¶
Connection Instructions
The Nucleo F439ZI board is compatible with our TROPIC01 Arduino Shield, which we recommend for this tutorial. You can get the shield here.
If you have any other shield which exposes SPI connections (or a custom PCB), you can use it as well, but you have to connect it manually e.g., using DuPont (jumper) wires. Refer to the table below for wiring:
| TROPIC01 | NUCLEO F439ZI |
|---|---|
| GND | GND |
| 3V3 | 3V3 |
| MISO (SDO) | GPIOA_6 |
| MOSI (SDI) | GPIOA_7 |
| SCK | GPIOA_5 |
| CS (CSN) | GPIOD_14 |
| GPO | GPIOF_15 |
We do not offer a shield compatible with the Nucleo L432KC. You can use any of our shields (available here) which expose SPI connections (or a custom PCB). Connect the TROPIC01 to the Nucleo L432KC according to the table below:
| TROPIC01 | NUCLEO L432KC |
|---|---|
| GND | GND |
| 3V3 | 3V3 |
| MISO (SDO) | A6 |
| MOSI (SDI) | A5 |
| SCK | A4 |
| CS (CSN) | A3 |
Advanced: How to Use Different Nucleo Pins?
The pin assignments above are used in our examples by default. The pins can be changed in the source code of each example. However, apart from changing assignment, you also have to initialize different peripherals, which is not documented here.
Software Setup¶
First, install the dependencies and prepare the repository:
Installation Instructions
- Install CMake:
- Ubuntu/Debian:
sudo apt update && sudo apt install cmake - Fedora:
sudo dnf install cmake - Other: cmake.org
- Ubuntu/Debian:
- Install Make:
- Ubuntu/Debian:
sudo apt update && sudo apt install make - Fedora:
sudo dnf install make
- Ubuntu/Debian:
- Install GCC cross-compiler for ARM:
- Ubuntu/Debian:
sudo apt update && sudo apt install gcc-arm-none-eabi - Fedora:
sudo dnf install arm-none-eabi-gcc
- Ubuntu/Debian:
- Install OpenOCD:
- Ubuntu/Debian:
sudo apt update && sudo apt install openocd - Fedora:
sudo dnf install openocd
- Ubuntu/Debian:
- Install a serial monitor of your choice (
minicom,screen,GTKTerm).- For beginners we recommend GUI-based GTKTerm.
- Ubuntu/Debian:
sudo apt update && sudo apt install gtkterm - Fedora:
sudo dnf install gtkterm
- Ubuntu/Debian:
- For beginners we recommend GUI-based GTKTerm.
- Get the Libtropic repository:
- Using git:
git clone https://github.com/tropicsquare/libtropic.git - Or you can download the latest release.
- Using git:
TBA
TBA
After that, setup your system:
System Setup Instructions
To upload the example programs, you need to have access to USB devices (usually, you must be a member of the plugdev group). Also, permissions (udev rules) have to be correctly configured, refer to the OpenOCD documentation.
As the output of examples is printed to the serial port, you need an access to it. Either run the serial port monitor as root, or you have to add yourself to a group with access to serial ports. Usually, you must be a member of the dialout group.
# Check if you are in the plugdev and the dialout groups. Required groups can
# be different, check the documentation of your Linux distribution
groups
# Add yourself to each group you are not in
sudo usermod -aG plugdev "$USER"
sudo usermod -aG dialout "$USER"
# Log out and log in again to reflect changes
TBA
TBA
Start with our Tutorials!¶
Do not skip!
We strongly recommend going through each tutorial in this specific order without skipping. You will gather basic information about the chip and update your TROPIC01's firmware, which will guarantee compatibility with the latest Libtropic API.
FAQ¶
If you encounter any issues, please check the FAQ before filing an issue or reaching out to our support.