cancel
Showing results for 
Search instead for 
Did you mean: 

OFFICIAL RELEASE: X-CUBE-TOUCHGFX v4.13.0

Martin KJELDSEN
Chief III

Goodmorning everyone!

With the release of CubeMX 5.5.0 we've removed TouchGFX from the Middleware section of CubeMX and are now offering TouchGFX configuration through an X-CUBE.

The X-CUBE pack contains the following:

  1. TouchGFX Designer .msi, as per usual
  2. TouchGFX Generator - A tool through "additional software" for creating your TouchGFX HAL based on CubeMX settings.

CubeMX is a tool for configuring your MCU.

CubeMX is not a tool for completely configuring peripherals like touch controllers and external memories.

TouchGFX Generator (new since 4,13) is a CubeMX extension that can generate all or parts of your TouchGFX HAL Layer based partially on settings taken from your MCU configuration in CubeMX.

TouchGFX Generator (new since 4,13) is not a tool that provides complete configurations for touch controllers, external memories, etc. It only generates the TouchGFX HAL - Rendering strategies, acceleration strategies, etc.

TouchGFX Designer is a tool that can supply you with application templates for existing stm32 display kits. We are working on getting all of them updated to use the new Generator.

Please read the following guides for instructions on how to install the new TouchGFX X-CUBE and how to use the TouchGFX Generator to develop your TouchGFX HAL:

From now on it is the X-CUBE that receives a version bump, bumping the version of both tools contained within.

A few application templates already support the new TouchGFX Generator (and thus CubeMX 5.5.0), with lots more to come. One of our main priorities is to get the rest of the application templates ported to use the TouchGFX Generator,

  • STM32H7BI-DK v.3.0.0 (uploaded)
  • STM32F746-DISCO v.3.0.0 (uploaded)
  • STM32F769I-DISCO v.3.0.0 (uploaded)
  • STM32H750B-DK v3.0.0 (uploaded)
  • STM32F750-DK v3.0.0 (in progress)
  • STM32L4R9-DISCO v3.0.0 (in progress)
  • STM32L4P5-DISCO v3.0.0 (in progress)
  • STM32H743-EVAL v3.0.0 (In progress)

Generally, any application template that supports the Generator/CubeMX 5.5.0 will be major version 3.

0690X00000BviXRQAZ.png 

0690X00000BviXWQAZ.png

Let me know here if you have any questions or face any issues! We're eager to see how this works for everyone.

Now that we are officially live with X-CUBE-TOUCHGFX we'll continue working on improving documentation, offering support and updating the current application templates you can find through the designer.

Aside from that i'll do my best to catch up on this community, something i've had to neglect a bit because of the new Generator.

Best regards,

TouchGFX Generator Team

162 REPLIES 162
HP
Senior III

Getting the TouchController to work is NOT exactly like the old videos. Please see my response to the post here:

https://community.st.com/s/question/0D50X0000C0yG0rSQE/where-did-the-touch-driver-code-go?t=1579889494947

Karl Yamashita
Lead III

There is also an issue when TouchGFX generates code for Keil. The Keil names for for the generated files are not correct and also missing files.

The image shows Keil on the left column with some errors indicating the files can't be found. I had to delete the Screen1Presenter.cpp and Screen1View.cpp, then add existing files MainPresenter.cpp and MainView.cpp in the gui folder. Then compiled and saw the other errors in the generated folder, so I gave up. Hopefully you guys have an update soon.

0690X00000BwYVmQAN.jpg

If smoke escapes your device, put the smoke back in. It'll still work as a conversation piece. If you find my answers useful, click the Accept as Solution button so that way others can see the solution.
zul-a
Associate II

Hi @Martin KJELDSEN​ I created a project for STM32F7 Dico board via Touchgfx designer. Then I open the project in STM32CUBEIDE. It compiles fine but when I try to debug I am having issues. Log attached below.

0690X00000BwZLEQA3.pngP.S. I do not get this issue if I create a project using STM32CUBEIDE as the starting point.

Your help with this is much appreciated. @scottSD​ @HP​  have you guys come across this?

MLync.1
Associate II

I too am having problems generating a working project. I am using a stm32f746 discovery board.

If I start with CubeMX IDE I can generate a project that compiles, but the screen is black. (backlight is on)

I have LTDC and TouchGFX Generator configured to use SDRAM with frame buffer address of 0xc0000000.

LTDC settings , DMA2D, and TouchGFX Generator settings are the same as when I start a project from TouchGFX Designer.

When I start a project from TouchGFX Designer. I select the 746 discovery board and a blank UI. Add a few widgets, and generate the code.

I can successfully run either the simulator or target. The problem starts when I try to modify the .ioc file (using CubeMX IDE)

I am trying to include SDMMC in my project. I can successfully import the project into the IDE. When I modify the .ioc file and generate the new configuration the project's directory structure is very different from the directory structure setup by TouchGFX Designer. And many files that are automatically included when starting from CubeMX IDE are left out. Specifically the files related to FATFS.

I am using 64bit version of Java. CubeIDE 1.2.0 CubeMX 5.5.0 and Touchgfx 4.13.0

Thank you to all who have provided input on this topic. And thank you Martin.

this really sounds like the 'soft-config' of your FMC is missing.

Can you confirm that you have the following code in your FMC_Init function:

/* USER CODE BEGIN FMC_Init 2 */
  __IO uint32_t tmpmrd = 0;
 
      /* Step 1: Configure a clock configuration enable command */
      Command.CommandMode            = FMC_SDRAM_CMD_CLK_ENABLE;
      Command.CommandTarget          =  FMC_SDRAM_CMD_TARGET_BANK1;
      Command.AutoRefreshNumber      = 1;
      Command.ModeRegisterDefinition = 0;
 
      /* Send the command */
      HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
 
      /* Step 2: Insert 100 us minimum delay */
      /* Inserted delay is equal to 1 ms due to systick time base unit (ms) */
      HAL_Delay(1);
 
      /* Step 3: Configure a PALL (precharge all) command */
      Command.CommandMode            = FMC_SDRAM_CMD_PALL;
      Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
      Command.AutoRefreshNumber      = 1;
      Command.ModeRegisterDefinition = 0;
 
      /* Send the command */
      HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
 
      /* Step 4: Configure an Auto Refresh command */
      Command.CommandMode            = FMC_SDRAM_CMD_AUTOREFRESH_MODE;
      Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
      Command.AutoRefreshNumber      = 8;
      Command.ModeRegisterDefinition = 0;
 
      /* Send the command */
      HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
 
      /* Step 5: Program the external memory mode register */
      tmpmrd = (uint32_t)SDRAM_MODEREG_BURST_LENGTH_1 | \
               SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL    | \
               SDRAM_MODEREG_CAS_LATENCY_3            | \
               SDRAM_MODEREG_OPERATING_MODE_STANDARD  | \
               SDRAM_MODEREG_WRITEBURST_MODE_SINGLE;
 
      Command.CommandMode            = FMC_SDRAM_CMD_LOAD_MODE;
      Command.CommandTarget          = FMC_SDRAM_CMD_TARGET_BANK1;
      Command.AutoRefreshNumber      = 1;
      Command.ModeRegisterDefinition = tmpmrd;
 
      /* Send the command */
      HAL_SDRAM_SendCommand(&hsdram1, &Command, SDRAM_TIMEOUT);
 
      /* Step 6: Set the refresh rate counter */
      /* Set the device refresh rate */
      HAL_SDRAM_ProgramRefreshRate(&hsdram1, REFRESH_COUNT);
 
      //Deactivate speculative/cache access to first FMC Bank to save FMC bandwidth
      FMC_Bank1->BTCR[0] = 0x000030D2;
  /* USER CODE END FMC_Init 2 */

This is not generated by the CubeMX by default.

The CubeMX does the HW config but not any chip-specific configuration.

Also you can switch off the ethernet setup since that will most likely make your board hang for the first 10 seconds while waiting for a DHCP server to provide an IP. If you don't have the ethernet connected, that is..

Hi @MLync.1​,

I'll look into this. Sounds strange to me since the Application Template structure is based directly on the output of CubeMX/Generator. I'll report back with my findings!

/Martin

I agree, you will also need these defines:

#define REFRESH_COUNT        1835
 
#define SDRAM_TIMEOUT                            ((uint32_t)0xFFFF)
#define SDRAM_MODEREG_BURST_LENGTH_1             ((uint16_t)0x0000)
#define SDRAM_MODEREG_BURST_LENGTH_2             ((uint16_t)0x0001)
#define SDRAM_MODEREG_BURST_LENGTH_4             ((uint16_t)0x0002)
#define SDRAM_MODEREG_BURST_LENGTH_8             ((uint16_t)0x0004)
#define SDRAM_MODEREG_BURST_TYPE_SEQUENTIAL      ((uint16_t)0x0000)
#define SDRAM_MODEREG_BURST_TYPE_INTERLEAVED     ((uint16_t)0x0008)
#define SDRAM_MODEREG_CAS_LATENCY_2              ((uint16_t)0x0020)
#define SDRAM_MODEREG_CAS_LATENCY_3              ((uint16_t)0x0030)
#define SDRAM_MODEREG_OPERATING_MODE_STANDARD    ((uint16_t)0x0000)
#define SDRAM_MODEREG_WRITEBURST_MODE_PROGRAMMED ((uint16_t)0x0000)
#define SDRAM_MODEREG_WRITEBURST_MODE_SINGLE     ((uint16_t)0x0200)

and this variable:

static FMC_SDRAM_CommandTypeDef Command;

MLync.1
Associate II

0690X00000BwdahQAB.pngApparently I am a confused when stating the Project File Structure is different. Here is some clarification.

When I create a project in TouchGFX Designer and import it into CubeIDE the project structure is not what I am used to seeing.

  1. The original project name is shown at the top of Project Explorer (right image). However when I select or highlight the name, the build hammer is grayed out. I cannot build that project.
  2. CubeIDE created a project (highlighted in left image) that has a very generic name. This project can be built. But the project name is always STM32F746G_DISCO. The .elf or .bin files generated by CubeIDE retain this name.
  3. CubeIDE creates a link to the .ioc file originally created by TouchGFX Designer.

Most of this can be worked through, but I am very concerned that the project and resulting products (ie .elf and .bin files) naming has changed.

I still do not understand why CubeMX does not generate all of the files needed to support the configuration entered.

If I try to edit the original .ioc file, not the link, I get an error that states Must be projects active.ioc file. Then it tells me the active file is the original project name.ioc

However CubeIDE renamed the file to STM32F746G_DISCO.

I sincerely appreciate you help.

Thank you.

I experienced very similar things when first creating the project in TouchGFX and then trying to import it into STM32CubeIDE. I highly recommend watching this video:

https://www.youtube.com/watch?v=o42r4xXOnbo

It shows you how to setup a "custom" board, but you can just choose the 746disco board and follow how the person created their project. This is what got me on track to a working setup.

Hi @Martin KJELDSEN​ . Would you please advise further on this?

Kind Regards

Zain