STM32CubeProgrammer Beginner Tutorial — Hand Pose Detection on STM32N6570-DK

The hand pose detection demo running on the STM32N6570-DK

In this tutorial, we’ll guide you through getting started with STM32CubeProgrammer on the STM32N6570-DK Discovery Kit.

You’ll learn how to install the STM32CubeProgrammer on Ubuntu 24.04 and flash the Hand Pose Detection example project. This step-by-step guide is perfect for beginners who want to start exploring STM32 development, embedded programming, and Edge AI capabilities with the STM32N6 platform.

A video version of this walkthrough is also available below.


What You Will Learn

  • How to install STM32CubeProgrammer on Ubuntu 24.04
  • How to get the Hand Pose Detection example binaries (AI hand landmarks)
  • How to flash the Hand Pose Detection example to the STM32N6570-DK using STM32CubeProgrammer

Requirements

  • A computer with Ubuntu 24.04 LTS
  • STM32N6570-DK Discovery Kit
  • USB-C cable
  • Internet connection
  • Basic familiarity with the Linux terminal

How to install the STM32CubeProgrammer on Ubuntu?

Download the STM32CubeProgrammer Debian Linux Installer from the ST official website :

https://www.st.com/en/development-tools/stm32cubeprog.html

The ST official download page with the STM32CubeProgrammer Linux installer highlighted.
Figure 1: STM32CubeProgrammer for Ubuntu

The STM32CubeProgrammer installer is approximately 290 MB. For version 2.20.0, you should see a zip file named “stm32cubeprg-lin-v2-20-0.zip”.

To extract the installer, open a terminal in the directory where the zip file is located and run the following command:

unzip stm32cubeprg-lin-v2-20-0.zip

Then run the installer script using the following command:

./SetupSTM32CubeProgrammer-2.20.0.linux

The installer will guide you through the license agreements and installation options. Once installed, you can open STM32CubeProgrammer from the Ubuntu menu.

How to flash the Hand Pose Detection example?

Connect the camera module to the STM32N6570-DK board:

Image showcasing the STM32N6570-DK with camera module connection
Figure 2: STM32N6570-DK camera connection

Then, put the board into developer mode by setting the BOOT1 switch to HIGH:

Image demonstrating the position for the STM32N6570-DK boot switches for developer mode.
Figure 3: STM32N6570-DK Boot switches in developer mode

Now, connect the STM32N6570-DK to your computer via the USB-C port near the mainboard buttons (STLINK_V3EC). In this guide, we use a USB-C to USB-C cable connected to the laptop’s USB-C port.

Important: The STM32N6570-DK can draw more than 500 mA when the camera module is connected, so ensure your USB port and cable support USB 3.0 or higher.

Next, open a terminal and clone the official x-cube-n6-ai-hand-landmarks repository using the following command:

git clone https://github.com/STMicroelectronics/x-cube-n6-ai-hand-landmarks.git

Then, open STM32CubeProgrammer from the Ubuntu menu. Click the “Connect” button in the right-hand side menu:

The STM32CubeProgrammer application connect option.
Figure 4: STM32CubeProgrammer Connect button

Next, click the “External Loaders” (EL) button.

Figure 5: STM32CubeProgrammer External Loaders button

Type STM32N6570-DK in the search field and select the loader named MX66UW1G45G_STM32N6570-DK. Then click the “Erasing & Programming” option:

Figure 6: STMCubeProgrammer Erasin & Programming button

Once in the “Erasing & Programming” window, click the “Browse” button and navigate to the directory where you cloned the x-cube-n6-ai-hand-landmarks repository. Inside the Binary folder, you’ll find the four files that need to be flashed:

  1. ai_fsbl.hex
  2. hand_landmark_data.hex
  3. palm_detector_data.hex
  4. x-cube-n6-ai-hand-landmarks-dk.hex

Select the first file, click “Open”, then click “Start Programming”. Wait a few seconds for the download to complete, and repeat the process for the remaining three files. After each successful download, you should see a “File download complete” message.

The STM32CubeProgrammer application File download complete message window
Figure 7: STMCubeProgrammer File download complete message

After all four files have been flashed, disconnect the board from the computer and return the BOOT1 switch to its original position (flash mode).

Image demonstrating the position for the STM32N6570-DK boot switches for flash mode.
Figure 8: STM32N6570-DK boot switches in flash mode

Reconnect the board to power it up and remove the camera lens cap. You should start to see the camera feed on the screen. If you place your hand in front of the camera, the landmarks detection will appear.

Image demonstrating the STM32N6570-DK running the hand pose detection demo
Figure 9: STM32N6570-DK running the hand pose detection demo

This is just the beginning—stay tuned to MorphoEdge for more tutorials and guides on bringing Edge AI to your STM32 projects!