跳转到主要内容

升级项目

TouchGFX Generator参数存储在.ioc文件中(STM32CubeMX工程)。 When a new version of TouchGFX Generator is released, the parameters of the old version may be incompatible with the new version and may require migration. 本节介绍在STM32CubeMX中成功迁移和更新项目所需的步骤。

Since STM32CubeMX does not support upgrading between X-CUBE versions, the upgrade is automatically performed by TouchGFX Designer when Generate Code is pressed, due to the following command in the PostGenerateTargetCommand section of the .touchgfx file.

.touchgfx
"PostGenerateTargetCommand" : "touchgfx update_project --project-file=../upgrade.ioc --platform=m7"

该命令将读取.ioc文件并更新参数,以适应X-CUBE-TOUCHGFX的当前版本。 以下是在X-CUBE-TOUCHGFX 4.13.0创建的.ioc文件上手动运行脚本(X-CUBE-TOUCHGFX 4.14.0)的示例。

使用STM32F746 DISCO TouchGFX Board Setup的升级示例,从4.13.0升级到4.14.0
$ touchgfx update_project --project-file=../STM32F746G_DISCO.ioc
TouchGFX Generator 4.13.0 found
Creating backup of ../STM32F746G_DISCO.ioc as ../backup_STM32F746G_DISCO.ioc
Performing upgrade 4.13.0 -> 4.14.0 ... OK

使用STM32CubeMX打开更新过的项目时,系统会提示用户安装.ioc文件提示的X-CUBE-TOUCHGFX版本(如果尚未安装)。 Clicking Download now will download and install the new version of X-CUBE-TOUCHGFX.

缺失其他软件组件:TouchGFX Generator 4.14.0

All configurations in TouchGFX Generator will be kept during the upgrade procedure, and a backup of the .ioc file will be placed beside the original on prepended with backup_.

要使用TouchGFX Generator提供的新功能,必须在STM32CubeMX中执行生成代码
Caution
如果通过STM32CubeMX为现有的TouchGFX项目升级X-CUBE-TOUCHGFX,升级过程并非通过TouchGFX Designer来运行,TouchGFX Generator参数将被重置为默认值,因为它们要适用于不同版本。