Stm32 cube ide linux

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

How to set up STM32CubeIDE in a Linux virtual machine and build a first sample application

License

PascalBod/lm-stm32cubeide

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Sign In Required

Please sign in to use Codespaces.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching GitHub Desktop

If nothing happens, download GitHub Desktop and try again.

Launching Xcode

If nothing happens, download Xcode and try again.

Launching Visual Studio Code

Your codespace will open once ready.

There was a problem preparing your codespace, please try again.

Latest commit

Git stats

Files

Failed to load latest commit information.

README.md

This short tutorial describes a way to make a virtual machine configured for STM32 software development with STM32CubeIDE, and explains how to use it. The virtualization environment is VirtualBox, and the guest machine runs Linux Mint.

  • Hardware: a 64-bit computer with enough memory so that the VM can be granted 16 GB, with a few tens of GB available on the disk, and one free USB A port
  • Hardware (bis): a Nucleo-L476RG board with an USB A / mini USB B cable — any similar NUCLEO board can be used
  • Developer:
    • basic knowledge of Linux (knowing the most common commands. )
    • basic knowledge of VirtualBox (knowing how to create a virtual machine. )

    Follow the instructions in this guide.

    Be sure to provide the guest machine with enough resources. STM32CubeIDE is quite power-hungry. The guide recommends 16 GB for RAM and two CPUs. On my i7-8559U host machine, a one-CPU VM won’t display correctly the Device Configuration Tool (aka CubeMX) window: two CPUs are required.

    • Download STM32CubeIDE Debian Linux Installer, version 1.12.0 at the time of writing. You will have to create an account
    • Unzip the file
    • Run resulting script:
    $ sudo sh ./st-stm32cubeide_1.12.0_14980_20230301_1550_amd64.deb_bundle.sh

    No need to perform the last step, the manual installation, described in the Installation Guide.

    Install sample applications

    • Start STM32CubeIDE, from Linux Mint main menu and then All applications > Programming
    • Keep the default workspace and click the Launch button
    • Install the STM32 MCU Package for STM32L4 Series (version 1.17.2 at the time of writing):
      • Select Help > Manage Embedded Software Packages
      • On the STM32Cube MCU Packages tab, expand the STM32L4 list and select the package
      • Click the Install button

      The package is installed in /home/developer/STM32Cube/Repository/STM32Cube_FW_L4_V1.17.2 .

      Import a sample application

      • Select File > Import.
      • Select General > Import ac6 System Workbench for STM32Project
      • Click the Next > button
      • For Import source, select /home/developer/STM32Cube/Repository/STM32Cube_FW_L4_V1.17.2/Projects/NUCLEO-L476RG/Examples/GPIO/GPIO_EXTI/SW4STM32/STM32L476RG_NUCLEO
      • Click the Finish button
      • Accept project conversion
      • A project named STM32L476RG_NUCLEO appears in the Project Explorer window
      • Click the small vertical triangle at the left of the project name, in order to display project files
      • Select Project > Build Project. If nothing happens, right-click on the project and select Build Project

      At the end of the build, the Console window displays the result:

      The Build Analyzer window provides memory usage information:

      Flash and run the application

      Connect the NUCLEO board to the host PC. Check that the virtual machine can see it, with Devices > USB from VirtualBox menu. A new USB device should be visible: STMicroelectronics STM32 STLink [0100]. Tick the associated checkbox.

      Assign the board to the virtual machine on a permanent basis:

      • Select Device > USB > USB Settings.
      • Click on the Add new USB filter button
      • Select the board
      • Click the OK button

      In the Project Explorer window, open the Debug directory and select STM32L476RG_NUCLEO.bin . This is the binary file to use to program the board.

      Create a run configuration by selecting Run > Run configurations. . Select STM32 Cortex-M C/C++ Application. Click on the New Launch Configuration tool, above the list of configuration types. The various fields should be prefilled with the right default values:

      Click the Run button.

      Depending on the version of the NUCLEO board, a window requesting an update of the ST-Link firmware may be displayed:

      Click the Yes button.

      The ST-Link upgrade window is displayed:

      Click the Open in update mode button. The window displays firmware version information:

      Click the Upgrade button. At the end of the upgrade, close the window.

      Request again to run the above run configuration. The Console window displays a rebuild, the board programming, and ends with a message saying that the debugger connection is lost. That’s normal, as we didn’t start a debugging session.

      Push the board blue button. The green LED should light up when you release the button. Push again, it should cut out when the button is released.

      STM32CubeIDE is installed with sudo. This means that the file owner is root . Consequently, updating STM32CubeIDE using Eclipse update mechanism (Help > Check for Updates) fails, when you run STM32CubeIDE from a normal user.

      One way to use this update mechanism would be to start STM32CubeIDE from root . But trying this, I got in trouble: STM32CubeIDE refused to start after an update from 1.7.0 to 1.8.0. Consequently, now, instead of updating, I install the new version from scratch. An additional benefit: the previous version can be kept.

      About

      How to set up STM32CubeIDE in a Linux virtual machine and build a first sample application

      Источник

      Install STM32CubeIDE on Linux as a Flatpak

      This tutorial shows you how to install STM32CubeIDE as a Flatpak on Linux. STM32CubeIDE is an Eclipse based C/C++ integrated development environment for STM32 microcontrollers. Besides functionality for compiling, linking and debugging your STM32 firmware, STM32CubeIDE also integrates the CubeMX tool. CubeMX makes it quick and easy to configure your STM32 microcontroller. STMicroelectronics develops and maintains STM32CubeIDE and they decided to offer STM32CubeIDE to your at no cost.

      Decorative image for the article about how to install STM32CubeIDE on Linux as a Flatpak.

      STM32CubeIDE is truly cross-platform. You can use it on Windows 10, Linux and macOS. Personally, I find this feature the most appealing, since I prefer Linux for my development work. The ST website offers download links and installation information for Linux. What most users don’t realize is that you can also install the STM32CubeIDE as a Flatpak on your Linux system. For this reason I dedicated this article to the topic of installing STM32CubeIDE on Linux as a Flatpak.

      What do you need

      A Linux application packaged as a Flatpak, runs in its own isolated sandbox environment, once you installed it on your Linux system. This means that the same Flatpak offers compatibility with all Linux distributions. Kind of like a package-once-install-everywhere type solution. Refer to this article for a more in-depth tutorial on using Flatpaks. In this article we’ll install the STM32CubeIDE Flatpak on our Linux system, directly from Flathub. The Flathub on-line repository offers an ever growing collection of Flatpaks.

      To complete the steps outlined in this article, all your really need is a Linux PC with graphical desktop environment. Because we intend to install STM32CubeIDE as a Flatpak, the type of Linux distribution doesn’t matter. It can be Debian, Ubuntu, Fedora, openSUSE, etc. The same goes for the type of graphical desktop environment. Feel free to use Gnome, KDE, Cinnamon, XFCE or whatever else rocks your boat. I decided on using my Linux laptop that runs Debian 10 with the Gnome desktop environment.

      Install Flatpak and add the Flathub repository

      Before you can install Flatpak desktop applications from the Flathub on-line repository, you first need to install the flatpak command line utility. The command to run for installing flatpak on your Linux system:

      Terminal screenshot showing you how to install the flatpak command line utility on Debian and Ubuntu.

      • Ubuntu/Debian: sudo apt install flatpak
      • openSUSE: sudo zypper install flatpak
      • Fedora: already installed by default!

      With the flatpak utility present on your Linux system, you can register the remote Flathub repository with it. That makes it possible to install Flatpak desktop applications, directory from the Flathub on-line repository:

      flatpak remote-add —if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

      Terminal screenshot that shows you how to register the remote Flathub repository, using the flatpak command line utility.

      Note the information message about the XDG_DATA_DIRS in the previous screenshot. Most desktop applications that you install as a Flatpak, also install an application launcher for you in your desktop environment’s application menu. The information message basically means that you should restart your Linux system first. Otherwise these application launchers won’t work, after you installed a Flatpak. For this reason, go ahead and restart your PC. Don’t forget to bookmark this article before. That way you can continue, once your PC completed booting.

      Install STM32CubeIDE from Flathub

      With the Flatpak command line utility installed and configured, we can continue with the install of the STM32CubeIDE on your Linux PC. To view the command to run for installing STM32CubeIDE, you can search for STM32CubeIDE on the Flathub website. This installation command you find there:

      flatpak install flathub com.st.STM32CubeIDE

      Go ahead and run this command from the terminal:

      Terminal screenshot that shows you how to install STM32CubeIDE on Linux as a Flatpak.

      After completion of the installation, you can find the STM32CubeIDE launcher in your desktop environment’s application menu:

      Screenshot of searching for the

      If for some reason the STM32CubeIDE launcher does not show up, do a quick logout/login and it should pop-up. Alternatively, you can start STM32CubeIDE from the terminal:

      flatpak run com.st.STM32CubeIDE

      Creating a new project in STM32CubeIDE

      When you start STM32CubeIDE, it always first prompts you to select an Eclipse workspace. With an Eclipse workspace you manage your C/C++ projects. Furthermore, you can store your Eclipse preferences in the workspace. This makes them available to all your projects. The default location and workspace name works fine:

      Screenshot that shows you how to select and create a new Eclipse workspace, after you started STM32CubeIDE.

      With the workspace opened, you can continue with the creation of a new STM32 Project. From the program menu, select NewSTM32 Project:

      STM32CubeIDE screenshot that shows you how to create a new STM32 project.

      Next, you simply follow the instructions on the new project wizard dialog to finish the creation of your project. Once done, the integrated CubeMX automatically opens up:

      Screenshot that show you what STM32CubeIDE looks like after you created a new STM32 project.

      Update STM32CubeIDE to the latest version

      Whenever ST releases a new version of STM32CubeIDE on Flathub, you can easily update to the latest version using the command:

      flatpak update com.st.STM32CubeIDE

      Terminal screenshot that shows you how to update the STM32CubeIDE Flatpak, once you installed it on your Linux system.

      Remove STM32CubeIDE from your Linux system

      If for some reason you decided that you do not want to use STM32CubeIDE, you can remove it by running this command from the terminal:

      flatpak uninstall com.st.STM32CubeIDE

      For completion purposes, you can run the following command to remove any potential unused Flatpak related dependencies from your Linux system:

      Wrap up

      This article showed you how you can install STM32CubeIDE on your Linux system. STM32CubeIDE is an Eclipse based C/C++ integrated development environment for STM32 microcontrollers.

      In case you are upgrading from Atollic TrueSTUDIO, refer to this article for tips on importing TrueSTUDIO projects into STM32CubeIDE.

      Instead of following the installation instructions found on the ST website, STM32CubeIDE was installed as a Flatpak from the Flathub on-line repository.

      Flatpaks offer an alternative way to install desktop application on Linux. They are especially useful in case the desktop application in question is not available for install, from your Linux distribution’s package manager.

      Источник

      Читайте также:  Linux работа с графикой
Оцените статью
Adblock
detector