on 2025-04-25 1:00 AM
This article is intended for users who would like to integrate STM32CubeIDE and GitHub. It covers the entire process from GitHub account creation to integration with STM32CubeIDE.
STM32CubeIDE is an integrated development environment (IDE) for STM32 microcontrollers and microprocessors. It combines the STM32CubeMX graphical configuration tool and the Eclipse-based IDE. GitHub is a web-based platform used for version control and collaborative software development. Integrating GitHub with STM32CubeIDE can streamline your development process, enabling efficient version control and collaboration.
To create a new GitHub account, start by navigating to GitHub.com. Once there, locate and click on the [Sign up] button on the homepage. You then need to fill in the required information, including your email address and a password. After entering this information, click on the [Create account] button. Next, check your email inbox for a verification code sent by GitHub and enter this code on the GitHub website to verify your email address. Once your email is verified, sign in to your new GitHub account using your email address and password.
Next, click the [+] button in the upper right corner of the screen, then select [New repository] from the dropdown menu. You are brought to a new window where you need to fill in details about the repository, such as choosing a unique name for your repository. Provide a brief description (optional), select whether the repository should be public or private, and decide if you want to include a README file (optional). Finally, click the [Create repository] button to finalize the creation of your new repository.
KEEP
To generate a personal access token on GitHub, start by going to the [Settings] page. Click on your profile picture in the upper right corner of the screen and select [Settings] from the dropdown menu. Next, in the left sidebar, scroll down and click on [Developer settings]. Under [Developer settings], choose [Personal access tokens] and then select [Tokens (classic)]. Click on the [Generate new token (classic)] button to create a new token.
Provide details for the token by writing a note to describe its purpose and selecting an expiration time. Choose the scopes (permissions) you wish to provide access to, as scopes determine what actions the token can perform. Finally, click the [Generate token] button. The token is only displayed once, so make sure to copy it and store it somewhere secure, as it cannot be recovered afterwards.
To install the EGit plugin in STM32CubeIDE, start by launching STM32CubeIDE on your computer. Next, go to the [Help] menu at the top of the screen and select [Eclipse Marketplace]. In the Eclipse Marketplace window, use the search bar to search for [EGit]. Find the EGit plugin in the search results and click the [Install] button next to EGit. Follow the prompts to complete the installation.
Once the installation is complete, restart STM32CubeIDE to apply the changes. After restarting, navigate to the [Window] menu, select [Show View], then [Other]. In the dialog that appears, expand the [Git] folder, select [Git Repositories], and click [OK].
To clone a repository, start by selecting the [Clone a Git repository] option. In the "Clone Git Repository" window, paste the URL of the GitHub repository you created earlier. Next, in the "Authentication" field, enter your GitHub username. For the "Password" field, use the personal access token you generated earlier instead of your GitHub password. Finally, click [Next] to proceed.
To link your project to a GitHub repository, right-click on the project in the Project Explorer. From the context menu, navigate to the "Team" menu and click on [Share Project]. In the dialog that appears, enter your GitHub username and the personal access token you generated earlier. Then, choose the GitHub repository you created and cloned earlier. Finally, click the [Finish] button to complete the linking process.
To commit and push your changes to the remote repository, right-click on the project again and navigate to the "Team" menu. Click on [Commit] to open the Git staging window. Move unstaged changes into staged changes by pressing the double [+] button or by dragging and dropping your files.
Enter a descriptive commit message in the commit message field. Click the [Commit and Push] button to commit your changes and push them to the remote repository. Follow any additional prompts to complete the push process. Finally, go to your GitHub repository in your web browser to verify the changes.
Integrating GitHub with STM32CubeIDE enhances your development workflow by providing robust version control and collaboration capabilities. By following the steps outlined in this article, you can efficiently manage your STM32 projects using GitHub.