This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

XDATA Memory of CC2541 of SensorTag Project

Dear All,

I am modifying SensorTag project and needing to ad some math calculation. The memory issue came to me as shown below:

Error[e104]: Failed to fit all segments into specified ranges. Problem discovered in segment XDATA_N. Unable to place 2 block(s) (0xc02 byte(s) total) in 0x91e byte(s) of memory. The problem occurred while processing the segment placement command "-P(XDATA)XDATA_N=_XDATA_BEG-_XDATA_END", where
at the moment of placement the available memory ranges were "XDATA:15e2-1eff"

I tried to change the XDATA segment from:

-D_XDATA_END=0x1EFF

to:

-D_XDATA_END=0x2EFF

The successful build result is like this:

116 031 bytes of CODE memory (+ 10 945 range fill )
34 bytes of DATA memory (+ 101 absolute )
8 676 bytes of XDATA memory
194 bytes of IDATA memory
8 bits of BIT memory
1 204 bytes of CONST memory

-----

But in this case I built Image B and after flashing to the chip it doesn't work.

Please anyone explain to me about this memory segmentation. I saw in the user guide that the XDATA is 32kb.

-----------------------

And if I would like to minimize the SensorTag basic app, which part is recommended to remove and what is the part I must keep from the BLE Stack. I only need one sensor profile actually, but I need some additional calculation process.

Thank you

Gilar

  • "-D_XDATA_END=0x2EFF" doing this makes you 100% guaranteed to fail. Look at the memory map. At best case, you have 8K of SRAM which means your SRAM section is 0x0000-0x1FFF. You are telling the compiler to try to store data where RAM doesn't exist (0x2000-0x2FFF). Any writes the chips tries to this region are lost and all reads will return 0. 

     

    The XDATA_N segment holds static and global variables. You can either use less of these variables or skrink the amount of space you give to other variables