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.
Hellow,
I was using IAR when I reached the 4Kb code size limit, then I decided to move to CCSv4. I use printf function to send characters through UART. In order to custom my UART I've followed the steps in http://processors.wiki.ti.com/index.php?title=CCE_FAQs#How_to_use_printf_in_CCE_v3.3F. When I've compiled the code I get the following code errors:
run placement fails for object ".bss", size 0x293 (page 0). Available ranges: RAM size: 0x200 unused: 0xc max hole: 0xc
run placement fails for object ".cio", size 0x120 (page 0). Available ranges: RAM size: 0x200 unused: 0xc max hole: 0xc
run placement fails for object ".stack", size 0x50 (page 0). Available ranges: RAM size: 0x200 unused: 0xc max hole: 0xc
My device ist the MSP430F2252.
And my questions are:
- Is there any way to use the printf funtion without this objects? (I think it is impossible)
- is 0xc the space I have left?
- is there any alternative to printf function?? It is very useful for me to print variable string characters, like this printf("AT+CMSS=%u[,%s]",sms,tn);
Thanks in advance, Biara
Hi,
Biara said:- Is there any way to use the printf funtion without this objects? (I think it is impossible)
No. However, there are two additional wiki pages that will help you:
http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler
http://processors.wiki.ti.com/index.php/Printf_support_in_compiler
Biara said:- is 0xc the space I have left?
Yes. The difference between unused and max hole is non-contiguous (unused) and contiguous (max hole).
Biara said:- is there any alternative to printf function?? It is very useful for me to print variable string characters, like this printf("AT+CMSS=%u[,%s]",sms,tn);
Due to memory constraints, the only feasible alternative I know for the amount of memory available is shown below:
http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/115871.aspx
Regards,
Rafael
Thanks for your quick response, I've rerouted the fputc() and fputs() functions in the same way indicated in http://processors.wiki.ti.com/index.php/Printf_support_for_MSP430_CCSTUDIO_compiler and the code errors have dissapear. But now I´ve some more doubts:
- what is the function of register FILE *_fp?
int fputc(int _c, register FILE *_fp)
{
while(!(UCA0TXIFG & IFG2));
UCA0TXBUF = (unsigned char) _c;
return((unsigned char)_c);
}
- What does the fputs function? What does it charges to UCA0TXBUF?
int fputs(const char *_ptr, register FILE *_fp)
{
unsigned int i, len;
len = strlen(_ptr);
for(i=0 ; i<len ; i++)
{
while(!(UCA0TXIFG & IFG2));
UCA0TXBUF = (unsigned char) _ptr[i];
}
return len;
}
- Is there any way to kow how many RAM I´ve left?
Thanks in advance, Biara
Hi,
The register FILE *_fp parameter does not have any function in the modified functions for the MSP430. It is required in the modified runtime library functions to maintain compatibility with the existing header files - otherwise the compiler would throw errors if the prototype (in the header file) and the function (in your source file) do not match.
The fputs function prints a string instead of a single character of fputc.
The amount of static RAM available (i.e., allocated by the linker) is available in the linker map file. In your CCS project, open the output subdirectory (typically Debug or Release) and double-click on the file with the .map extension. It reports the memory sections together with usage.
Hope this helps,
Rafael
Thanks for your reply again.
I've followed your instructions and I've gotten this memory configuration:
name origin length used unused attr
---------------------- -------- --------- -------- -------- ----
SFR 00000000 00000010 00000000 00000010 RWIX
PERIPHERALS_8BIT 00000010 000000f0 00000000 000000f0 RWIX
PERIPHERALS_16BIT 00000100 00000100 00000000 00000100 RWIX
RAM 00000200 00000200 000001d9 00000027 RWIX
INFOD 00001000 00000040 00000000 00000040 RWIX
INFOC 00001040 00000040 00000000 00000040 RWIX
INFOB 00001080 00000040 00000000 00000040 RWIX
INFOA 000010c0 00000040 00000000 00000040 RWIX
FLASH 0000c000 00003fde 00000a60 0000357e RWIX
INT00 0000ffe0 00000002 00000000 00000002 RWIX
INT01 0000ffe2 00000002 00000000 00000002 RWIX
INT02 0000ffe4 00000002 00000000 00000002 RWIX
INT03 0000ffe6 00000002 00000000 00000002 RWIX
INT04 0000ffe8 00000002 00000000 00000002 RWIX
INT05 0000ffea 00000002 00000000 00000002 RWIX
INT06 0000ffec 00000002 00000000 00000002 RWIX
INT07 0000ffee 00000002 00000002 00000000 RWIX
INT08 0000fff0 00000002 00000000 00000002 RWIX
INT09 0000fff2 00000002 00000000 00000002 RWIX
INT10 0000fff4 00000002 00000000 00000002 RWIX
INT11 0000fff6 00000002 00000000 00000002 RWIX
INT12 0000fff8 00000002 00000000 00000002 RWIX
INT13 0000fffa 00000002 00000002 00000000 RWIX
INT14 0000fffc 00000002 00000000 00000002 RWIX
RESET 0000fffe 00000002 00000002 00000000 RWIX
But in other project I've obteined:
name origin length used unused attr
MEM 00000200 0000fdfd 00000665 0000f798 RWIX
RESET 0000fffe 0000ffff 00000000 0000ffff
Why doesn't it shows RAM and the others names?
In this last project I've obteined this warnings:
creating output section ".int06" without a SECTIONS specification (and the same for the .int07, .int13, .restet and stack. files). I've searched in the forum about this warnings and in this thread http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/199685/710628.aspx#710628 say: It is advisable to update the linker command file and add these sections to the SECTIONS specification. ¿How can I do that?
Thanks in advance, Biara
Hi,
From what you posted (the error messages and the contents of the two map files) it seems the first linker CMD file is more complete. I would use it.
Cheers,
Rafael
CCS comes installed with many example linker command files for MSP430. You can find things like ...
install_root/ccs_base/msp430/include/msp430x461x1.cmd
I suggest you use the one for your target system.
Thanks and regards,
-George
Thanks, then the file lnk_msp430f2252.cmd is the only file with .cmd extension that must contain the project carpet?