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

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

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

Jump to solution
4,121 Views
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

1 Solution
1,371 Views
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

View solution in original post

0 Kudos
7 Replies
1,372 Views
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 Kudos
1,371 Views
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 Kudos
1,371 Views
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,371 Views
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 Kudos
1,371 Views
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,371 Views
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 Kudos
1,371 Views
madagaskar
Contributor II

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

0 Kudos