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.
Dear all,
I'm trying to modify the source code given by TI. My CC2540 has 256KB of memory size but if I compile my code with IAR I get this error:
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 0xbdf byte(s) of memory. The problem occurred while processing the segment placement command "-P(XDATA)XDATA_N=_XDATA_START-_XDATA_END", where at the moment of placement the available memory ranges were "XDATA:1321-1eff"
To let my code compile I have to remove some constants and on my .map file I get:
111 153 bytes of CODE memory
26 bytes of DATA memory (+ 66 absolute )
7 247 bytes of XDATA memory
192 bytes of IDATA memory
8 bits of BIT memory
3 701 bytes of CONST memory
Than it looks like IAR compiles for a 128 KB chipset....how can I set IAR in order to compile for a 256 KB chipset?
Many thanks!
Marco
The issue has to do with RAM, not with flash size. The CC2540 has 8kB of memory (XDATA), and you are using close to the limit. I suspect this can be resolved by reducing the heap size. To do this, change the value of the defined symbol INT_HEAP_LEN (in the compiler options) from the default value of 3072 to something lower (maybe to 1000?). Assuming that you are not using a lot of dynamic memory allocation this should not cause any issues.
Thanks Willis, it works! I changed the value of INT_HEAP_LEN to 1000 and my .map file is:
112 251 bytes of CODE memory
26 bytes of DATA memory (+ 66 absolute )
6 273 bytes of XDATA memory
192 bytes of IDATA memory
8 bits of BIT memory
3 701 bytes of CONST memory
Thanks again!!
Marco