天天看點

STM32F103C8T6用GD32替換後IAR編譯提示錯誤

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。

STM32F103C8T6用GD32替換後IAR編譯提示錯誤

解決辦法:

勾選Override default -> Edit -> Stack/Heap Sizes,改成0x800即可。

繼續閱讀