MQX lite and region 'm_data' overflowed (Kinetis L)

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

MQX lite and region 'm_data' overflowed (Kinetis L)

跳至解决方案
4,733 次查看
madagaskar
Contributor II

Hello everyone,

I try to used MQX lite with MKL25Z128VLK4 microcontroler. Today, when I created a few tasks i had  following message:

- project.elf section '.bss' will not fit in region 'm_data'

- region 'm_data' overflowed by 1512 bytes

So after that I counted stack size for tasks and MQX lite. I was using only 9 kB RAM! (microcontroler have 16 kB) Does anybody know where is a problem?

Regards,

Pawel

标记 (5)
1 解答
1,983 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi Pawel,

The RAM contains the stack, the heap and the data. Therefore there are many other information that may be causing the overflow besides the tasks stack. You can go to menu Project > Properties > C/C++ Build > Settings > Additional Tools and check print Size. After building you will see a summary with the size of each of your application's sections. Add data and bss sections plus your tasks stack to get the whole ram usage.

Regards,

Carlos

在原帖中查看解决方案

0 项奖励
回复
7 回复数
1,984 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi Pawel,

The RAM contains the stack, the heap and the data. Therefore there are many other information that may be causing the overflow besides the tasks stack. You can go to menu Project > Properties > C/C++ Build > Settings > Additional Tools and check print Size. After building you will see a summary with the size of each of your application's sections. Add data and bss sections plus your tasks stack to get the whole ram usage.

Regards,

Carlos

0 项奖励
回复
1,983 次查看
cwati
Contributor III

Carlos, if it doesn't finish linking it doesn't print the total sizes.  Any recommendation to get the approximate sizes before it tries to link?


Thanks,

Cecylia

0 项奖励
回复
1,983 次查看
BlackNight
NXP Employee
NXP Employee

Hi Cecylia,

you could use the 'size' command to determine the data/code size for each object file, see

Listing Code and Data Size for each Source File with GNU and Eclipse | MCU on Eclipse

Keep in mind that the linker will remove unreferenced variables/functions, so the size will be 'worst case' numbers.

Erich

1,983 次查看
dave408
Senior Contributor II

@Erich_Styger, based off of some of your great blog posts, couldn't Pawel's issue also be related to the fact that the memory is split into lower and upper regions?  I looked at the reference manual for his MKL25Z128VLK4 chip and it looks like it's split into 4k and 12k regions.  I would have thought that he'd have still run into problems even if he reduced his memory usage from 9k to even 8k, considering the way the MKL25Z128VLK4 splits its memory.  Just curious and trying to learn more about these chips...

0 项奖励
回复
1,983 次查看
Jorge_Gonzalez
NXP Employee
NXP Employee

Hello Cecylia Wati:

Modify the linker file adding more memory space to the segments and "trick" the linker. This way the linking phase finishes and you can see the sections that occupy more space. Obviously you cannot download the generated elf to the device because it exceeds the available memory.

Regards!

Jorge Gonzalez

1,983 次查看
cwati
Contributor III

Thanks, it works.  I was having problem fitting an .elf into K22F with 128Kb.  So, instead of using "K22FN128xxx10_flash.ld" I used the K22FN512*ld (512 instead of 128).  Then I could see the details printed out.

Cheers,

Cecylia

0 项奖励
回复
1,983 次查看
madagaskar
Contributor II

Now I know where was a problem. Thank you realy much Carlos, yours answer was realy helpfull. :smileywink:

0 项奖励
回复