STM32测试正常的代码,换成GD32后,IAR编译出现如下错误:
Error[Lp011]: section placement failed
unable to allocate space for sections/blocks with a total estimated minimum size of 0x5cbc bytes (max align 0x8) in <[0x20000000-0x20004fff]> (total
uncommitted space 0x5000).
Error[Lp021]: the destination for compressed initializer batch "P2-1" is placed at an address that is dependent on the size of the batch, which is not allowed when using
lz77 compression. Consider using "initialize by copy with packing = zeros" (or none) instead.
Error while running Linker
问题原因:
STM32换成GD32后,IAR会自动修改链接配置文件为GD32F103x8.icf,该文件默认的堆栈大小为0x2000,而STM32的配置文件默认为0x800。

解决办法:
勾选Override default -> Edit -> Stack/Heap Sizes,改成0x800即可。
解决GD32IAR编译错误
本文介绍从STM32切换到GD32后使用IAR编译时遇到的错误及其解决方法。主要原因是链接配置文件中堆栈大小设置不同导致内存分配失败。
3609

被折叠的 条评论
为什么被折叠?



