AnsweredAssumed Answered

K60 Baremetal Project Code Size Error: `.text' will not fit in region `m_text'

Question asked by Dao Yan Lim on Nov 2, 2016
Latest reply on Nov 3, 2016 by Dao Yan Lim

Hi, 

 

I am using TWR-K60N512, with PK60DN512Z VMD10 chip and Codewarrior 10.5. I definitely have issues with the size of my code, I have about 50 source and header files in my source folder. About half of them are freemaster stuff, so I won't modify that. 

 

I'm wondering if anybody could:

1) Show me how to increase the maximum allowable code size, if at all possible, for baremetal projects .

2) Tell me if there's a way to display the part of my baremetal project code that is taking up too much memory so I can optimize it accordingly.

 

Here's the error I received:

c:/freescale/cw mcu v10.5/cross_tools/arm-none-eabi-gcc-4_7_3/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: i2c.elf section `.text' will not fit in region `m_text'
c:/freescale/cw mcu v10.5/cross_tools/arm-none-eabi-gcc-4_7_3/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: section .data loaded at [20000000,2000019b] overlaps section .text loaded at [1fff01e0,20001507]
c:/freescale/cw mcu v10.5/cross_tools/arm-none-eabi-gcc-4_7_3/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/bin/ld.exe: region `m_text' overflowed by 5384 bytes 
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [i2c.elf] Error 1

 

I have also attached a file with '.ld' format, which has some memory info for your reference.

 

Thanks.

Original Attachment has been moved to: PK60N512_ram.ld.zip

Outcomes