KL27Z .flashConfig compiles on one machine, overflows on another

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

KL27Z .flashConfig compiles on one machine, overflows on another

跳至解决方案
659 次查看
JesseVer
Contributor I

I am trying to move a project between laptops. 

They should have identical environments, but the project will not compile at the destination.

From the build console output I can tell all the files are loaded and checked for consistency. At the linker step something goes wrong:

Building target: project.elf

Invoking: Cross ARM C++ Linker

arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-builtin -Wall  -g3 -T "../../DaqCommon/MKL27Z128xxx4_flash.ld" -Xlinker --gc-sections -Wl,-Map,"GDX-SND-0T1.map" --specs=nano.specs -mapcs  -Xlinker -static  -Xlinker -z  -Xlinker muldefs  -Xlinker --defsym=__usb_ram_size__=0x800 -o "project.elf"...

 

project.elf section `.flash_config' will not fit in region `m_flash_config'

section .text loaded at [00000410,00012017] overlaps section .flash_config loaded at [00000400,0000041f]

region `m_flash_config' overflowed by 16 bytes 

collect2.exe: error: ld returned 1 exit status

 

I believe this memory section is being built in startup_MKL27Z4.S file with:

   .syntax unified

    .arch armv6-m

 

    .section .isr_vector, "a"

    .align 2

    .globl __isr_vector

__isr_vector:

    .long   __StackTop                                      /* Top of Stack */

… … … … … ...

    .long   PORTC_PORTD_IRQHandler                          /* Single interrupt vector for PORTC; PORTD Pin detect*/

 

    .size    __isr_vector, . - __isr_vector

 

/* Flash Configuration */

    .section .FlashConfig, "a"

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFFFFFF

    .long 0xFFFF31FE

 

    .text

    .thumb

 

/* Reset Handler */

 

    .thumb_func

    .align 2

    .globl   Reset_Handler

    .weak    Reset_Handler

... ... ...

 

The code is only trying to populate 16 bytes, as the memory space requires, so why does it overrun by 16 bytes?

What in the environment could cause this to memory space to be built twice?

0 项奖励
回复
1 解答
655 次查看
JesseVer
Contributor I

I think I found my answer:
There were two startup.S files in a folder.
There was a filter set in:

Project Properties >> C/C++ General >> Paths and Symbols >> Source Location >> {Project Name} +> Filter to "ignore one of the .S files"

Some code folders were rearranged in the move, they were relinked, but not filtered and two .S files were populating the memory space.

在原帖中查看解决方案

0 项奖励
回复
1 回复
656 次查看
JesseVer
Contributor I

I think I found my answer:
There were two startup.S files in a folder.
There was a filter set in:

Project Properties >> C/C++ General >> Paths and Symbols >> Source Location >> {Project Name} +> Filter to "ignore one of the .S files"

Some code folders were rearranged in the move, they were relinked, but not filtered and two .S files were populating the memory space.

0 项奖励
回复