KL27Z .flashConfig compiles on one machine, overflows on another

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

KL27Z .flashConfig compiles on one machine, overflows on another

Jump to solution
503 Views
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 Kudos
1 Solution
499 Views
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.

View solution in original post

0 Kudos
1 Reply
500 Views
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 Kudos