arm-none-eabi/bin/ld: build/com.zubax.gnss.elf section `.text' will not fit in region `flash'
出现如下错误:
/arm-none-eabi/bin/ld: build/com.zubax.gnss.elf section `.text' will not fit in region `flash'
/arm-none-eabi/bin/ld: region `flash' overflowed by 5869 bytes
bootloader编译,.text已经超过预设大小。修改方案有两个:
精简代码
修改MEMORY预设值
ChibiOS
以ChibiOS为例,修改ld.ld文件和Makefile文件
# vi ld.ld
MEMORY
{
MEMORY
{
flash : org = 0x08000000, len = 32512/*增大此值*/ /* 32K for the bootloader minus 256 for the signature */
ram : org = 0x20000100, len = 65280 /* First 256 bytes are reserved for bootloader/app communication */
}
}
# vi Makefile
APPLICATION_OFFSET = 32512 //与ld.ld中修改值对应,代码中会用到

浙公网安备 33010602011771号