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,
1- I am developing my application using the samples on sprc530.zip. I get the error "program will not fit into available memory".
I looked at the object files, Some files included in these project samples make big obj files like
DSP2833x_GlobalVariableDefs.obj 120 k
DSP2833x_DefaultIsr.obj 60 k
Can I modify these files to get more space for my code?
Thanks a lot,
Behzad
Behzad,
The .obj file size is not particularly reliable way to determine your code size. There is a lot of debug information in the .obj files.
There are more specifics in the error message you are getting that probably tell you what section does not fit, where it is linked, and how much room there is available in that memory. What you need to do is adjust your linker .cmd file to get everything to fit (unless of course your program really is so big that there is no way to arrange it to fit in the device. That's a different issue).
This thread might help you:
http://e2e.ti.com/support/microcontrollers/c2000/f/171/p/312815/1087913.aspx#1087913
Regards,
David
Hi David,
Thanks for your reply,
I looked at that thread. I have commented most of my code. It is in c++. Up to something like 300 lines of code, it is ok and when I add a few more lines, the linker gives error:
<Linking>
warning #10247-D: creating output section ".cio" without a SECTIONS specification
warning #10247-D: creating output section ".sysmem" without a SECTIONS specification
warning #10210-D: creating ".sysmem" section with default size of 0x400; use the -heap option to change the default size
>> Compilation failure
"../28335_RAM_lnk.cmd", line 125: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x1410 page 0. Available memory ranges:
RAML1 size: 0x1000 unused: 0x1000 max hole: 0x1000
error #10010: errors encountered during linking; "aa.out" not built
gmake: *** [aa.out] Error 1
gmake: Target `all' not remade because of errors.
I checked the original samples, for example samples just to do kind of adc conversion. Is it logical for such a simple example that the size of its ".out" file be about 180 KB? I guess it is already taking most of the code space.
Can I safely modify files like
DSP2833x_GlobalVariableDefs.obj
DSP2833x_DefaultIsr.obj
to free some code space? Or I should have another approach in my coding?
Again Thanks,
Behzad
Behzad,
behzad n said:I checked the original samples, for example samples just to do kind of adc conversion. Is it logical for such a simple example that the size of its ".out" file be about 180 KB? I guess it is already taking most of the code space.
The size of the .out file on your PC hard drive is NOT the size of the code that actually goes into the C2000 device. There is a lot of debug information in the .out file.
You should use the .map file generated by the linker to figure out what is using a lot of memory, and what memory allocation you should shuffle around to get things to fit.
behzad n said:Can I safely modify files like
DSP2833x_GlobalVariableDefs.obj
DSP2833x_DefaultIsr.obj
to free some code space? Or I should have another approach in my coding?
The DSP2833x_GlobalVariableDefs.c file is not occupying any RAM or FLASH memory. There is no point in trying to modify it. It won't buy you anything.
The DSP2833x_DefaultIsr.c is using very little memory for the ISRs. Each ISR is basically just a stub. This file is not the cause of your memory consumption.
behzad n said:<Linking>
warning #10247-D: creating output section ".cio" without a SECTIONS specification
warning #10247-D: creating output section ".sysmem" without a SECTIONS specificationwarning #10210-D: creating ".sysmem" section with default size of 0x400; use the -heap option to change the default size
>> Compilation failure
"../28335_RAM_lnk.cmd", line 125: error #10099-D: program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x1410 page 0. Available memory ranges:
RAML1 size: 0x1000 unused: 0x1000 max hole: 0x1000
error #10010: errors encountered during linking; "aa.out" not built
gmake: *** [aa.out] Error 1
gmake: Target `all' not remade because of errors.
The warnings are telling you that .cio and .sysmem sections are not specified in your linker .cmd file. You need to add these to your .cmd file or the linker will just stick these sections in a default allocation location. You want them put where YOU want them, not where the linker wants them.
Also, the 10210-D warning is saying that you didn't specify a heap size in your project options, so the default size of 0x400 is being used. This is pretty used. The heap is used for dynamic memory allocation (memalloc), and also by cio such as printf(). The default size of 0x400 is pretty large. I suspect you didn't do any memalloc(). You are probably using printf(). My suggestion would be to NOT use printf() in your code, but if you must you may want to cut the heap size down to 0x200 or so.
Your problem is that you need to adjust the .cmd file. It looks like you are not using the flash memory, but rather only the RAM. Assuming your code size does in fact fit in the RAM, you probably need to combine a few RAM sections in the .cmd so that you have a large segment of RAM to link the .text section to. I believe the linker .cmd file you are using seperately lists each RAM block, and the .text is linked to RAML1. You should combine some of the RAM blocks to make a larger one so that .text will fit.
Also be sure to add .sysmem and .cio to the .cmd file SECTIONS section.
Regards,
David