Modules coveredÂ
| Display size | MCU |
| 5″Â | STM32U5G9NJH6QÂ |
| 5″Â | STM32U5A9NJH6QÂ |
| 7″, 10.1″, 12.1″Â | STM32H757XIH6Â |
Â
What you will be able to do at the endÂ
- Connect and power the module correctlyÂ
- Verify communication over ST-LINKÂ
- Run the Riverdi demo from TouchGFX DesignerÂ
- Create and run your own GUIÂ
- Build and flash a project from STM32CubeIDEÂ
- Flash a prebuilt .hex or .elf file with STM32CubeProgrammerÂ
- What you need
Programming and power are two separate connections: the module is programmed over SWD and powered through its PWR connector. Please keep in mind that PWR and SWD molex are the same 6-pin. There were reported issues that end-user mixed them and the module got damaged.
| Item | What we use in this guide | Purpose |
| Riverdi STM32 display module | One of the modules listed above | The target device |
| ST-LINK programmer | ST-LINK/V2 or ST-LINK/V3 | Connects your PC to the STM32 for programming and debugging |
| SWD cable | RVA-SWD-06M-C100-V2 | Links ST-LINK to the module’s SWD connector |
| Power cable (Molex 6-pin) | RVA-0106M-1.25FF-1 | Connects the power supply to the PWR connector |
| Power supply | 12 V / 3 A; a bench supply with current limit is the most convenient | Powers the module |
| PC | Any PC that runs the ST tools below | Runs the software |
In this guide we use a bench power supply set to 12V / 3A. A bench supply is convenient because you can set the voltage and control the current draw. For the exact power parameters of your module, see its datasheet.
The power cable listed above is not intended for direct use. It is a double-ended 6-pin Molex cable that must be cut to the required length and properly prepared by the end user for power connection. The power cable shown in the photos in this guide is a ready-made cable prepared for use with a bench power supply.
Note: some ST-LINK/V3 versions can power the target device. We don’t plan for Riverdi modules to be powered this way and have not tested it, so we cannot guarantee it works correctly. Power the module separately through the PWR connector.

- Install the software
Download all three tools from the STMicroelectronics website and install them with default settings.
| Tool | What you use it for in this guide |
| STM32CubeProgrammer | Connecting to the module and flashing ready files |
| TouchGFX Designer | Designing the GUI and running it on the module |
| STM32CubeIDEÂ | Building and flashing the project (optional in this guide)Â |
- Connect the module
Make all connections with the power supply switched off.
- Connect the SWD cable to the SWD connector on the module, observing the connector orientation.Â
- Connect the other end of the SWD cable to the ST-LINK.Â
- Connect the ST-LINK to your PC over USB. The PC should detect the programmer; the module does not need power yet.Â
- Connect the Molex 6-pin cable to the module’s PWR connector and to the power supply.Â
- Set the supply to 12 V with a 3 A limit, double-check the wiring, then switch it on.Â
Your setup now has two independent paths:
- Programming: module → SWD → ST-LINK → USB → PCÂ
- Power: module → PWR → 12 V / 3 A supplyÂ

- Verify the connection
Before flashing anything, confirm that your PC can talk to the MCU.
- Open STM32CubeProgrammer.Â
- In the top-right corner, select ST-LINK as the connection method and SWD as the port. Leave other settings at their defaults.Â
- Click Connect.Â

STM32CubeProgrammer with ST-LINK, Port: SWD and the Connect button highlighted.
If the connection works, STM32CubeProgrammer shows information about the detected STM32. This confirms that the ST-LINK, the SWD link and the MCU all work, and you can start flashing.

Successful connection with the detected device information.
If the module is not detected, check that:
- the module is powered,Â
- the supply is set to the correct voltage,Â
- the SWD cable is correctly connected to the module,Â
- the other end of the SWD cable is correctly connected to the ST-LINK,Â
- the ST-LINK is connected to your PC over USB.Â
- Run the Riverdi demo
Start with a ready-made demo before you build anything yourself. If something fails later, a demo that ran correctly lets you rule out the setup and focus on your project.
- Open TouchGFX Designer and go to the Board Specific Demo projects.Â
- Select the Riverdi demo for your exact module and open it.Â
- Click Generate Code and wait until generation finishes.Â
- Click Run on Target. TouchGFX builds the project and flashes it to the module.Â

Board Specific Demo list with the Riverdi project.

Generate Code and Run on Target buttons.
When flashing completes, the demo starts on the display.

Photo of the demo running on the module.
A running demo confirms that power, SWD, ST-LINK and TouchGFX support for your module all work. You are ready to build your own GUI.
- Build your first GUI
You will build a two-screen interface with a button that switches screens, entirely in TouchGFX Designer, without writing code.
Create the projectÂ
- In TouchGFX Designer, click Create New, open the By Partners tab and search for Riverdi.Â
- Select the template for your exact module. If several versions are listed, choose the newest (the version is shown in the template details).Â
- Name the project, e.g. MyFirstGUI, and click Create.Â

Design the screensÂ
4. On the empty first screen, drag in a Text Area (e.g. “Hello Riverdi!”) and a Button With Label (e.g. “Next”). Adjust position, size and style as you like.

5. Add a second screen, Screen2, with a text.

6. Go back to the first screen, open Interactions and add one: trigger = Button is clicked (Next), action = Change screen → Screen2.
Test and run
7. Click Run Simulator (F5) and check that Next opens Screen2. The simulator lets you test layout and interactions without flashing the module each time.
8. Save, then click Generate Code (F4).
9. With the module connected and powered, click Run on Target (F6).

Tap Next on the display. When “It works!” appears, your own GUI is running on the module.

Photo of GUI running on the module.
- Build and flash from STM32CubeIDE
A TouchGFX project can also be built and flashed from STM32CubeIDE. This is where you will continue once you start adding your own application code; here we only open, build and run the project.
- In TouchGFX Designer, click Generate Code so the STM32CubeIDE project files are up to date.Â

2. In your TouchGFX project folder, open the folder for STM32CubeIDE and open the project in STM32CubeIDE.

3. Select Build Project (or the Build icon in the toolbar). Check the console at the bottom: the build should finish without errors.

4. With the module connected and powered, click Run. STM32CubeIDE builds the project, connects through ST-LINK and flashes the module.

When flashing completes, the application starts on the display.
- Flash a prebuilt file with STM32CubeProgrammer
You don’t have to open the project in TouchGFX Designer or STM32CubeIDE every time you want to flash it. If the project has already been built, you can flash the output file directly with STM32CubeProgrammer, which is convenient, for example, when you load the same application onto another module.
- Locate the application file. After a successful build, the output is a .hex or .elf file, depending on how the project was built. For a TouchGFX project, you can also use the generated target.hex.Â

Project folder with target.hex highlighted.Â
2. With the module powered and the ST-LINK connected, open STM32CubeProgrammer, select ST-LINK and click Connect.

STM32CubeProgrammer connected to the module.
- Open External Loaders and select the loader for your module.Â
ouchGFX projects store graphics, fonts and other GUI assets in external flash memory. A working ST-LINK connection to the MCU does not by itself give STM32CubeProgrammer access to that memory; this access goes through the External Loader. The loader must match your module and its memory configuration. With the wrong one, programming can fail, or the application can start with graphics, fonts or other GUI elements missing or displayed incorrectly. For details, see this article.

External Loaders tab with the Riverdi loader selected.
4. Open Erasing & Programming and select the application file, e.g. target.hex. Files in .hex and .elf format contain the memory addresses, so you don’t need to enter a start address.

Erasing & Programming with a .hex file selected.
5. Click Start Programming. STM32CubeProgrammer writes the application to the MCU memory and, if the project requires it, the data to the external memory. When it finishes, it confirms that programming completed.

Message confirming that programming completed.
After the module starts or is reset, the application runs on the display.

Message confirming that programming completed.
Next stepsÂ
You now have a working setup and your own GUI running on the module. From here, you can continue in STM32CubeIDE and add your own application code.
DISCOVER OUR
Whitepaper
Achieve the perfect user-display interaction with the right Touch Sensor IC. Ever faced issues with phantom touch events or certification? Boost your R&D like a pro with our Whitepaper!

Go to our product catalog and see how you can save by quality, not on quality.


