跳转到主要内容

更新至新的TouchGFX版本

When a TouchGFX application is created, the .touchgfx project file will have the same version as the TouchGFX Designer/X-CUBE-TOUCHGFX used to create it. 但是,这并不意味着您只能使用TouchGFX的特定版本继续开发应用。

TouchGFX在设计上向后兼容,在大多数情况下,仅需一个极简单的流程使旧版本应用能够工作在TouchGFX新版本上。

您只需打开新安装的TouchGFX Designer版本,并尝试通过最近使用的应用或“打开”对话框打开旧版本应用。您将看到下面的弹窗:

版本更新弹窗

Caution
弹窗内容会先建议您在运行更新程序前备份您的应用。

按下“是”按钮,更新程序启动。完成更新后,在TouchGFX Designer中照常打开您的应用,现在您可以使用新版本了。

在极少数情况下,您必须对您的应用进行一些手动修改,以使您的应用完全更新至新的TouchGFX版本。如果您对将应用更新至新版本还有疑问,请参阅“已知问题”部分。

更新TouchGFX Generator​

When you generate code in TouchGFX Designer for a migrated project, TouchGFX updates the TouchGFX version in the project's .ioc file automatically. TouchGFX Designer cannot, however, trigger STM32CubeMX to regenerate code. Since code generation in STM32CubeMX is often required; open the .ioc file in STM32CubeMX, confirm the X-CUBE-TOUCHGFX package shows the intended version, and then generate code.

Before opening the .ioc file, ensure that the new X-CUBE-TOUCHGFX package is installed in STM32CubeMX. You can do this in one of two ways:

  1. In STM32CubeMX go to Help → Manage embedded software packages → STMicroelectronics → X-CUBE-TOUCHGFX. Click the refresh button to fetch the latest packages, select the package, and click Install.

  2. If the release is very new and not yet available from the STM32CubeMX server, download the STMicroelectronics.X-CUBE-TOUCHGFX.x.x.x.zip package from st.com. In STM32CubeMX open Help → Manage embedded software packages → From Local..., select the downloaded ZIP, and click Open.

Software Packages Manager: Install TouchGFX Generator

After either procedure the package will be installed in STM32CubeMX. Then open the .ioc file, verify that X-CUBE-TOUCHGFX has been migrated to the new version, validate the configuration, and generate code.

Note
  • You can update the TouchGFX Generator in STM32CubeMX before updating the .touchgfx file, but the recommended order is to update the .touchgfx file first.
  • For more info on how to install X-CUBE-TOUCHGFX in STM32CubeMX see Installing TouchGFX Generator in STM32CubeMX.
Caution
  • The migration is a two-step process that requires code generation from both STM32CubeMX and TouchGFX Designer.
  • TouchGFX/target code generated by the TouchGFX Generator is written to disk only after you press the Generate Code button in STM32CubeMX.