Try the new version: www.pomad.fr/POMAD_2024/welcome

1.1. Tools setup

Submitted by admin on Sat, 05/01/2021 - 14:21


To complete these tutorials, you'll need to install the following software on your computer :

  •   STM32CubeIDE : The Eclipse/gcc based Integrated Development Environment (IDE) officially developed and promoted by ST.
  • STM32CubeProgrammer : A standalone software for programming (flashing) STM32 devices. It is also useful to program device Option Bytes (OB) and can also be used to update ST-Link firmware.
  • STM32CubeMonitor : A Node-RED based application to monitor live variables and build custom dashboards.

 

1. STM32CubeIDE

Since 2019, STM32CubeIDE has become the free, STMicroelectronics supported, integrated development environment for STM32 MCUs. It is basically the assembly of an Eclipse/gcc environment together with  CubeMX device configuration and code generation tool. It is available for all major OS (Windows, Linux, Mac). At time of writing it is in 1.6.1 version.

You can download STM32CubeIDE from ST website: www.st.com/en/development-tools/stm32cubeide.html. You may be asked to create an ST account prior to the download.

Then just select the installer you need according to your OS:

 

Start the installation process. Keep the installation path short and avoid any special character, accents or spaces. You may for instance choose C:\STM as the installation path as shown below:

 

Make sure both J-Link and ST-Link drivers are included in the installation process:

 

When finished, visit the installation folder and make sure STM32CubeIDE executable is there:

 

You may then start STM32CubeIDE using your OS launcher :

Since STM32CubeIDE is an Eclipse environment, the first thing you need at startup is to set the current workspace. The workspace is nothing more than a directory to store projects and settings.
 
Within Eclipse, various settings may be applied:
-    Globally (for all your eclipse tasks)
-    At workspace level (for all projects inside a given workspace)
-    At project level (for one project only)
 
For now, let us specify a workspace dedicated to tutorials, under C:\STM\workspace_tuto for instance, if you are on your own computer. You should point to a folder related to your network drive (P:\) if you are working on school computer (e.g. P:\STM\workspace_tuto). Again, avoid spaces, accents, and special characters in the workspace path. Also keep the "do not ask again" option unchecked. That's a good thing to get asked for which workspace you want to start with every time you launch the IDE.
 

 

When starting STM32CubeIDE the first time, your network firewall may ask for an authorization that you should accept. An Internet access is required for updates, and device-related libraries downloads.

You may also be asked for automatic data collection from ST in order to improve the product. That's up to you to accept or deny this one.

When STM32CubeIDE has finished loading, you'll end-up within Eclipse. Close the Information Center.

 

2. Testing ST-Link drivers and Nucleo board

Because STM32CubeIDE comes with ST-Link drivers, you should now be able to connect the Nucleo board to your computer using the USB cable.

For now, do not pay attention to the LEDs on the Nucleo board. Plugging the USB cable should first attach a new drive to your computer:

Note that this is a fake drive, that is only provided as a mean to flash the target device by drag and dropping executable files prior downloaded from the online MBED environment. It is by no means a mass storage device that you can use for storing files. Actually, it will be of no use for us since we're not using MBED.

Then visiting the Windows Peripheral Manager, you should see two new items:

  • The ST-Link Debug probe under USB Peripherals category
  • An ST-Link Virtual COM Port under the Ports category
     

If you can't see those, then there no need to go further. Something went wrong with the installation process, or your Nucleo board is not working properly. Review the above instructions and try again.

 

3. STM32CubeProgrammer

You can download the STM32CubeProgrammer from ST website: www.st.com/en/development-tools/stm32cubeprog.html.

Proceed to the installation. You can use the same installation folder as for STM32CubeIDE (eg C:\STM\STM32CubeProgrammer):

 

Then accept default options:

 

When finished, unplug the Nucleo USB cable (if plugged) and launch STM32CubeProgrammer using your OS:

STM32CubeProgrammer should then signal that no ST-Link is found:

Then, connect the Nucleo USB cable and hit the refresh  button. Now the ST-Link debug probe is found.

Before connecting to the target STM32, let us see if the ST-Link requires a firmware update.

Hit the button.

In the STLinkUpgrade dialog box, click the Open in update mode button first. ST-Link will be briefly disconnected/reconnected and update information appears in the lower part of the window.

Then click the Upgrade button and wait until the process complete. A message tells you that the process is successful.

Now click the button

Make sure that the status changed to "Connected":

Then review the Target information region. This one should report the found target board and device:

Also review the Log area which reports useful information gathered while connecting to the target:

If everything went as expected, you can now feel confident that all is working properly and that you have an up-to-date ST-Link.

IMPORTANT WARNING : Within STM32CubeProgrammer, you can access Option Bytes (OB) and change the memory Read Out and Write protection level. DO NOT TRY ANYTHING HERE unless instructed. Changing the memory protection level is an irreversible action that will definitely brick your Nucleo board and is intended for mass production and intellectual property protection.

If you memory protect your development board, then you can keep it as a decorative fashion accessory. Yet, too big for earrings...

You've been warned...

Click the Disconnect button, and close STM32CubeProgrammer.

 

4. STM32CubeMonitor

Last in the list is the STM32CubeMonitor tool.

It is available for download from ST web site : www.st.com/en/development-tools/stm32cubemonitor.html

Again, use the same folder as before for the installation location (eg. C:\STM\STM32CubeMonitor):

Then complete the installation process.

When done, just make sure that STM32CubeMonitor launches without problems:

Then quit the application for now. We'll leave this for another tutorial when required.

 

5. Summary

In this tutorial, we've setup all the software tools you'll need to proceed with the subsequent STM32 training program. If you've followed above instructions well, you've got a directory with a short and simple path from the root that regroups :

  • 3 development tools:
    • The Integrated Development Environment (IDE), which is the place you write programs, build executables and perform debugging tasks.
    • A standalone programmer tool, useful to check that ST-Link and target board are healthy, and necessary to perform low-level configuration.
    • A tool to monitor live variables at runtime and build custom dashboard. You must consider this as another (complementary) debug approach to the standard debugging process. It is particularly useful during optimization of real time control projects and more generally with projects that involve signal processing.
  • 1 workspace folder to store tutorials projects.


 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.