首页 > 解决方案 > IAR 和 CubeIDE 的 STM32F746G 和 touchGFX 问题

问题描述

我想试试 TouchGFX。我创建了一个简单的示例。我使用 CubeMX 并选择 X-Cube-TouchGFX 4.13.0 作为附加软件。我配置一切都很好,使用示例和网络研讨会。然后,我使用 TouchGFX 设计器为我的示例插入了一个简单的 UI,所有这些都运行良好。

我使用 CubeIDE 使用 Application 结构生成了一个 IAR 项目:Advanced and linker Settings : Heap = 200 ; Stack = 800;

现在,如果我编译该项目,我没有问题,但如果我Make是该项目,我会看到此错误:

Error[Lp011]: section placement failed   unable to allocate space for
sections/blocks with a total estimated minimum size of 0x17'd129 bytes
(max align 0x4) in <[0x800'0000-0x80f'ffff]> (total uncommitted space
0xf'fe38).

后来我为STM32CubeIDE生成项目,看到这个错误:

c:\st\stm32cubeide_1.2.0\stm32cubeide\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\arm -none-eabi\bin\ld.exe:区域“FLASH”溢出 596908 字节

collect2.exe: error: ld returned 1 exit status

make: *** [makefile:74: TEST_1.elf] Error 1 "make -j8 all" terminated
with exit code 2. Build might be incomplete.

标签: graphicsstm32iarstm32cubemxstm32cubeide

解决方案


CubeMX(和 CubeIDE)不会为您生成有效的链接描述文件,因为他们不知道您正在使用哪个闪存芯片以及资产的内存区域从哪里开始。

您可以从 TouchGFX 设计器中查看一些应用程序模板,以了解链接器脚本(对于 IAR、CubeIDE、Keil)是如何根据内存映射构建的(ExtFlashSection对于 TouchGFX 应用程序来说,这里是重要的区域)。

您正在溢出,因为您的链接器试图将所有内容放入内部闪存中(因为链接器脚本没有定义 TouchGFX 资产公开的区域)。


推荐阅读