I'm attempting to use a 1MB K60 (MK60FN1M0VLQ15) because I have a rather large webpage I would like to store internally using TFS. However when I compile I get an error saying I have a rom overflow. I'm using the twrk60F120M BSP which I believe is a 1MB flash BSP. I'm also using MQX 4.1 and CW 10.5. I probably don't have something setup correctly. Any idea what that might be?
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: HW_Test_1MB.elf section `.text' will not fit in region `rom'
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 `rom' overflowed by 227488 bytes
I got CW to printout the size of what I'm building. Adding all that up I got 753,606 bytes which is under the 1MB flash size I have.
text | data | bss | dec | hex | filename |
324 | 64 | 0 | 388 | 184 | Sources\main.o |
2532 | 8 | 6 | 2546 | 9f2 | Sources\NetworkManager.o |
533512 | 0 | 0 | 533512 | 82408 | Sources\tfs_data.o |
0 | 0 | 12 | 12 | c | Sources\usb_classes.o |
216060 | 480 | 608 | 217148 | 3503c | HW_Test_1MB.elf |
Thanks,
Sean
Solved! Go to Solution.
Hello,
Your linked .elf file even only shows 216 kByte? I suggest you check your linker file how large the 'rom' section region is?
Erich
Hello,
Your linked .elf file even only shows 216 kByte? I suggest you check your linker file how large the 'rom' section region is?
Erich
Thanks! I think that was where I needed to be looking.
Pulled up my linker file and found the rom section to be smaller than 1MB. Looks like about 500KB.
vectorrom (RX): ORIGIN = 0x00000000, LENGTH = 0x00000400
cfmprotrom (R): ORIGIN = 0x00000400, LENGTH = 0x00000020
rom (RX): ORIGIN = 0x00000420, LENGTH = 0x0007FBE0 /* Code + Const data*/
I tried changing the rom section to 0xFFBE0. I got that by subtracting the 0x420 taken up by vectorrom and cfmprotrom from 1MB. (0x100000 – 0x420 = 0xFFBE0). Once I rebuilt this seemed to fixed the issue. I can build/link and load my webpage from internal flash now.
Here are the sizes of things now:
text | data | bss | dec | hex | filename |
324 | 64 | 0 | 388 | 184 | Sources\main.o |
2620 | 8 | 6 | 2634 | a4a | Sources\NetworkManager.o |
533512 | 0 | 0 | 533512 | 82408 | Sources\tfs_data.o |
0 | 0 | 12 | 12 | c | Sources\usb_classes.o |
751280 | 480 | 608 | 752368 | b7af0 | HW_Test_1MB.elf |
Thanks,
Sean