1MB Flash part rom overflow error

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

1MB Flash part rom overflow error

跳至解决方案
1,038 次查看
seandema
Contributor IV

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    hexfilename
    324     64      0    388    184Sources\main.o
   2532      8      6   2546    9f2Sources\NetworkManager.o
533512      0      0 533512  82408Sources\tfs_data.o
      0      0     12     12      cSources\usb_classes.o
216060    480    608 217148  3503cHW_Test_1MB.elf

Thanks,

Sean

标签 (1)
标记 (2)
0 项奖励
1 解答
564 次查看
BlackNight
NXP Employee
NXP Employee

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

在原帖中查看解决方案

0 项奖励
2 回复数
565 次查看
BlackNight
NXP Employee
NXP Employee

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

0 项奖励
564 次查看
seandema
Contributor IV

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    hexfilename
    324     64      0    388    184Sources\main.o
   2620      8      6   2634    a4aSources\NetworkManager.o
533512      0      0 533512  82408Sources\tfs_data.o
      0      0     12     12      cSources\usb_classes.o
751280    480    608 752368  b7af0HW_Test_1MB.elf

Thanks,

Sean

0 项奖励