Skip to main content
Associate
May 12, 2025
Solved

Source Code of Demo Application for STM32U5G9J-DK2

  • May 12, 2025
  • 3 replies
  • 1195 views

Hello,

I’ve recently purchased the STM32U5G9J-DK2 Discovery board and noticed it came with a demo app preloaded with UI, touch input, etc. But I can't seem to find the source code for it anywhere.

I checked STM32CubeIDE examples, the STM32U5 firmware package and even TouchGFX Designer, but no luck so far.

Also, the examples in STM32CubeIDE don’t seem to have a proper TouchGFX integration for this board and the TouchGFX Designer demos I tried show corrupted graphics on the screen.

Having a working sample project would really help right now because I’m not sure how to get the GUI part working without one. Just something that shows how to properly set up TouchGFX on this board, even a basic example would do.

If anyone knows where the source code for the original demo is, or has a working TouchGFX example for this board, or at least point me in the right direction, I’d really appreciate it!

Thanks in advance!

 

Best answer by GaetanGodart

"Hello @ArunJohn ,

 

You should be able to create a project on the TouchGFX Designer for your STM32U5G9K-DK2 without issue.

 

Here are the steps:

  1. Open TouchGFX Designer, click on "Demos" then "Select Board Setup", type "U5G9" and select your board (there is a FreeRTOS and a ThreadX version)
    GaetanGodart_0-1747063079643.png
  2. Select a demo and click on "Create"
    GaetanGodart_1-1747063219430.png

     

  3. Connect your board and click on "Program and Run Target"
    GaetanGodart_2-1747063283534.png

     

 

By following this steps you should have a working demo on your STM32U5G9J-DK2.

If it not the case, double check :

  • you connected the board to the STLINK pin
  • the jumpers/switches are set for STLINK flashing
  • you are flashing both the code and the assets (this is default):
    GaetanGodart_3-1747063400053.png

     

 

Regards,

3 replies

GaetanGodart
GaetanGodartBest answer
Technical Moderator
May 12, 2025

"Hello @ArunJohn ,

 

You should be able to create a project on the TouchGFX Designer for your STM32U5G9K-DK2 without issue.

 

Here are the steps:

  1. Open TouchGFX Designer, click on "Demos" then "Select Board Setup", type "U5G9" and select your board (there is a FreeRTOS and a ThreadX version)
    GaetanGodart_0-1747063079643.png
  2. Select a demo and click on "Create"
    GaetanGodart_1-1747063219430.png

     

  3. Connect your board and click on "Program and Run Target"
    GaetanGodart_2-1747063283534.png

     

 

By following this steps you should have a working demo on your STM32U5G9J-DK2.

If it not the case, double check :

  • you connected the board to the STLINK pin
  • the jumpers/switches are set for STLINK flashing
  • you are flashing both the code and the assets (this is default):
    GaetanGodart_3-1747063400053.png

     

 

Regards,

ferro
Lead
May 12, 2025

Hello@GaetanGodart 

would it be possible to make a carbon copy of the flash with CubeProgrammer and then flash that to get exact SW that was in the board upon purchase ?

 

GaetanGodart
Technical Moderator
May 13, 2025

Hello @ferro ,

 

It is probably possible.
You juts need to by pass read protection if they are here, a good retro-engineering software such as Ghidra and the skills to do it :)

 

Regards,

ferro
Lead
May 12, 2025

Hi @ArunJohn 

"I can't seem to find the source code for it anywhere"

you can get it from GfxDesigner as explained here

https://community.st.com/t5/stm32-mcus-boards-and-hardware/code-for-touchgfx-demo-stm32u5g9/m-p/675907#M19094

 

GaetanGodart
Technical Moderator
May 13, 2025

The out of the box demo delivered on the board upon purchase might not be one of the demos available in Designer, we provide MCU load and some other demos such as the "map demo" on the out of the box demo.

I don't remember what is flashed by default on the STM32U5G9J-dk2.

ferro
Lead
May 13, 2025

@ArunJohn 

"the TouchGFX Designer demos I tried show corrupted graphics on the screen."

I tried to run Demo 7 from GfxDesigner and it works Okay on my board. Which demos are corrupted on your board ? I'll try those.

ferro_0-1747132214940.png