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.
hi
I am using the TMS320F2837xS device with its default RAM_lnk.cmd file and i am getting the "program will not fit into available memory" error .
can somebody please provide me with a solution how i can modify the cmd file (i am all ready using the max compiler optimization ) .
my final program will run from flash (only my main ISR will run from RAM) but i sow many examples that use RAM for debugging , can you please explain me the difference of debugging from RAM vs FLASH? maybe i am wrong and i just need to run everything from flash?
"../28377S_RAM_lnk.cmd", line 50: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x1b96 page 0. Available memory ranges:
RAMM0 size: 0x2de unused: 0x2 max hole: 0x2
RAMD0 size: 0x800 unused: 0x0 max hole: 0x0
RAMLS0 size: 0x800 unused: 0x7 max hole: 0x7
RAMLS1 size: 0x800 unused: 0x6a7 max hole: 0x6a7
RAMLS2 size: 0x800 unused: 0x800 max hole: 0x800
RAMLS3 size: 0x800 unused: 0x800 max hole: 0x800
RAMLS4 size: 0x800 unused: 0x800 max hole: 0x800
best regards
Mark
Mark,
The main difference between debugging from RAM and flash is that in flash you are limited to only two break-points, whereas in RAM you can have as many as you like. The error message is telling you the .text section is too big to fit in any of the sections allocated for it. The "|" operator tells the linker to try to fit the entire .text section into the first section in the list into which it all fits. Your .text section is 0x1b96 words in length, but the biggest single block you have allocated for is is 0x800 words.
If you want to work with your entire program in RAM, what you can do is to comment out a couple of those lines in the MEMORY section and combine them into one contiguous memory block which is big enough to take your program. For example:
MEMORY
{
PAGE 0 :
/* BEGIN is used for the "boot to SARAM" bootloader mode */
BEGIN : origin = 0x000000, length = 0x000002
RAMM0 : origin = 0x000122, length = 0x0002DE
RAMD0 : origin = 0x00B000, length = 0x000800
/* RAMLS0 : origin = 0x008000, length = 0x000800 */
/* RAMLS1 : origin = 0x008800, length = 0x000800 */
/* RAMLS2 : origin = 0x009000, length = 0x000800 */
/* RAMLS3 : origin = 0x009800, length = 0x000800 */
/* RAMLS4 : origin = 0x00A000, length = 0x000800 */
RAMLS04 : origin = 0x008000, length = 0x002800
...
Then, in the SECTIONS part, allocate your .text section to this block:
/* .text : >>RAMM0 | RAMD0 | RAMLS0 | RAMLS1 | RAMLS2 | RAMLS3 | RAMLS4, PAGE = 0 */
.text : > RAMLS04, PAGE = 0
Regards,
Richard