AnsweredAssumed Answered

KDS m_data segment overflow

Question asked by Utsavi Kalpesh Bharuchwala on Aug 18, 2017
Latest reply on Sep 12, 2017 by Alice_Yang

Hello,

 

I am working with KDS with Towerkit TWR0K60D100M. I created my project in Processor expert mode.

 

By building my project using SysV format. I got like below,

 

section                          size                          addr

.interrupts                       1024                              0

.flash_config                      16                         1024

.text                           129716                         1040

.ARM                                 8                       130756

.init_array                           4                       130764

.fini_array                           4                       130768

.data                              904                   536806400

.m_interrupts_ram         1024                   536805376

.bss                           67300                   536807328

.heap                          53252                  536874628

.stack                            512                   536927880

.ARM.attributes                42                                 0

.debug_info               507910                                 0

.debug_abbrev            74434                                 0

.debug_loc                228149                                 0

.debug_aranges           12400                                 0

.debug_ranges             15624                                 0

.debug_macro            349650                                 0

.debug_line                339463                                 0

.debug_str               1972414                                 0

.comment                       112                                 0

.debug_frame              37204                                 0

.stab                              156                                 0

.stabstr                          387                                 0

Total                       3791709

 

What is this Total bytes? why it is too much large?? Beyond the range of RAM? 

 

When I print size unsing Berkley format , I got like this,

 

text                      data                   bss               dec                 hex          filename

0x1fecc           0x390         0x1dce8       253764         3df44     Test_Project.elf

 

bss + data =   0x1dce8 + 0x390  =  123000 bytes used.

 

Total RAM available is 128KB in module. 

 

When I manually calculate the ram like, structures used in my project, global variables and task stacks , Total RAM I calculate is only 37000 bytes.

 

Now when I declared, say array of 9000 bytes , I am getting error like, "m_data segment overflow by 986 bytes....."

 

why this is so?  

 

Tell me how can I find  Current Free RAM? In codewarrior I was using below functions, but I was unable to find this in KDS.  

_mqx_get_initialization() and ()_mem_get_free()

 

 

Regards

Utsavi Bharuchwala

Outcomes