Component Management

How to run STM32Cube IDE on Linux: a comprehensive guide

16th January 2024
Kristian McCann
0

The STM32Cube Integrated Development Environment (IDE) has become a staple in the development and debugging of microcontroller applications. Known for its comprehensive and user-friendly platform, STM32Cube IDE is an indispensable tool for embedded systems developers. 

This article will focus on guiding Linux users through the process of downloading, installing, and starting a project in STM32Cube IDE, specifically tailored to meet the needs of beginners and seasoned developers alike.

Downloading STM32CubeIDE for Linux

Before delving into the installation process, it is crucial to understand the downloading procedure. STM32CubeIDE is available for various operating systems, including Linux, and can be downloaded from the official STMicroelectronics website.

Visit the download page: Navigate to the STM32CubeIDE download page.

Select your operating system: Choose the Linux option in the 'Get latest' block.

Registration and download: You will be required to register an account or log in if you already have one. After registration, a download link will be sent to your email. Validate your email address to initiate the download.

Installing STM32CubeIDE on Linux

The installation of STM32CubeIDE on Linux requires root privileges. The installer is available in different bundles to suit various Linux distributions. These bundles are named in the format: st-stm32cubeide_VERSION_ARCHITECTURE.PACKAGE, where:

VERSION indicates the product version and build date.

ARCHITECTURE refers to the target host computer's architecture.

PACKAGE denotes the Linux package type.

Installation steps

Locate the installer: Navigate to the location of the installer file using a command console.

Run the installer: Enter the command sudo sh ./st-stm32cubeide_VERSION_ARCHITECTURE.PACKAGE, replacing VERSION, ARCHITECTURE, and PACKAGE as appropriate for your Linux package.

Follow console instructions: The console window will provide further installation instructions.

For RPM-based distributions (Red Hat, CentOS, SUSE, Fedora), use the command sudo rpm -Uhv followed by the respective package names. For Debian-based distributions (Debian, Ubuntu), use sudo apt-get install with the relevant package files.

Manual installation process

For a manual installation, particularly for RPM and Debian-based Linux distributions, the process varies slightly:

RPM-based distributions (Red Hat, CentOS, SUSE, Fedora):

Execute the command sudo rpm -Uhv, followed by the package files like segger-jlink-udev-rules-xxxx-linux-noarch.rpm, st-stlink udev-rules-xxxx-linux-noarch.rpm, st-stlink-server-xxxx-linux-amd64.rpm, and st-stm32cubeide_xxxx_amd64.rpm.

Debian-based distributions (Debian, Ubuntu):

Use sudo apt-get install, followed by the package files such as ./segger-jlink-udev-rules-xxxx-linux-all.deb, ./st-stlink-udev-rules-xxxx-linux-all.deb, ./st-stlink-server-xxxx-linux-amd64.deb, and ./st-stm32cubeide_xxxx_amd64.deb.

Getting started with STM32CubeIDE on Linux

After the successful installation of STM32CubeIDE, it's time to delve into its functionalities and start developing.

Launch STM32CubeIDE: Open the application and specify the directory for the workspace.

Start a new project: Click on ‘Start new STM32 project’.

Select your device: Choose your device by its part number, for example, ‘STM32F103C8’, and proceed to the next step.

Project configuration: Name your project (e.g., ‘BLINK_LED’) and finish the initial setup.

Device configuration tool: Set pin specific functions in the Device Configuration Tool. For instance, setting a pin as a ‘GPIO Output’.

Writing and building your first program

Code customisation: Modify the main.c file according to your project needs. For a LED blinking project, insert the appropriate code in the while(1) loop.

Building the project: Use the shortcut Ctrl + B or navigate through the IDE menu to build your project.

Connecting and uploading to the STM32 board

Connecting ST-Link Programmer: Connect your STM32 board with an ST-Link programmer, ensuring proper pin configuration.

Uploading the code: Press the 'RUN' button in the IDE to upload the code. If needed, adjust settings in the 'Edit configuration' window.

Finalising the setup

After the code is successfully uploaded, reset your STM32 board to normal mode by adjusting the BOOT jumper and pressing the RESET button. Your STM32 board should now execute the uploaded program, such as blinking the onboard LED.

Conclusion

STM32CubeIDE offers a rich development environment for STM32 microcontroller applications. This guide provides Linux users with a clear roadmap to set up and start using STM32 CubeIDE effectively. By following these steps, developers can leverage the full potential of STM32CubeIDE for their embedded systems projects, from initial setup to project execution.

Whether you're a beginner or an experienced developer, STM32CubeIDE on Linux offers a seamless and efficient way to develop and debug STM32 microcontroller applications. By understanding the installation process and getting familiar with the IDE's functionalities, you can significantly enhance your development workflow and bring your innovative ideas to life with STM32 microcontrollers. Remember to explore the wide array of tools and features provided by STM32CubeIDE to optimise your development process.

Product Spotlight

Upcoming Events

View all events
Newsletter
Latest global electronics news
© Copyright 2024 Electronic Specifier