Link copied to clipboard!

Getting started with Riverdi STM32 display modules

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 

 

  1. 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.

 

  1. 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) 

 

  1. Connect the module

Make all connections with the power supply switched off.

  1. Connect the SWD cable to the SWD connector on the module, observing the connector orientation. 
  2. Connect the other end of the SWD cable to the ST-LINK. 
  3. Connect the ST-LINK to your PC over USB. The PC should detect the programmer; the module does not need power yet. 
  4. Connect the Molex 6-pin cable to the module’s PWR connector and to the power supply. 
  5. 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 
  1. Verify the connection

Before flashing anything, confirm that your PC can talk to the MCU.

  1. Open STM32CubeProgrammer. 
  2. In the top-right corner, select ST-LINK as the connection method and SWD as the port. Leave other settings at their defaults. 
  3. Click Connect. 

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.

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. 
  1. 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.

  1. Open TouchGFX Designer and go to the Board Specific Demo projects. 
  2. Select the Riverdi demo for your exact module and open it. 
  3. Click Generate Code and wait until generation finishes. 
  4. Click Run on Target. TouchGFX builds the project and flashes it to the module. 

When flashing completes, the demo starts on the display.

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.

  1. 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 

  1. In TouchGFX Designer, click Create New, open the By Partners tab and search for Riverdi. 
  2. Select the template for your exact module. If several versions are listed, choose the newest (the version is shown in the template details). 
  3. 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.

  1. 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.

  1. 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.

  1. 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.

  1. 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. 

2. With the module powered and the ST-LINK connected, open STM32CubeProgrammer, select ST-LINK and click Connect.

  1. 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.

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.

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.

After the module starts or is reset, the application runs on the display.

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!

Save by quality

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

Contact us now, save with quality, not on quality.