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即可。