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.

MSP430G2553-Q1: How to add stdio support in project from Code Composer Stuido9.3.0.00012 ?

Part Number: MSP430G2553-Q1
Other Parts Discussed in Thread: MSP430G2553

Dear TI

      To add the support for printf or sprintf, I have to add stdio.h in the project(BlinkLED sample project).

      Here are the steps what I already did:

      (1) Add #include <stdio.h>, and add code in main.c : printf("Hello");

      (2) Set both heap size and stack size to 512, in the menu: Project->Property->Build->MSP430 Linker->Basic options

      (3) clean and build

Then the error is showing:

"../lnk_msp430g2553.cmd", line 90: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".bss" size 0xaa . Available memory ranges:
RAM size: 0x200 unused: 0x70 max hole: 0x70
"../lnk_msp430g2553.cmd", line 91: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".data" size 0xfc . Available memory ranges:
RAM size: 0x200 unused: 0x70 max hole: 0x70
"../lnk_msp430g2553.cmd", line 100: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".cio" size 0x120 . Available memory ranges:

I read the MSP430 Optimizing C/C++ Compiler v21.6.0.LTS, in chapter 7.2.1, I read: 

cl430 main.c --run_linker --heap_size=400 --library=rts430_eabi.lib --output_file=main.out

Do I miss something in my project configuration? It is urgent, please help me, thanks.

BR

Johnson

  • C-Printf.c
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    #include <stdio.h>
    #include <string.h>
    #define UART_PRINTF
    #ifdef UART_PRINTF
    int fputc(int _c, register FILE *_fp);
    int fputs(const char *_ptr, register FILE *_fp);
    #endif
    Main()
    {
    ……………
    }
    #ifdef UART_PRINTF
    int fputc(int _c, register FILE *_fp)
    {
    while(!(UCA0IFG&UCTXIFG));
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Here is the code for your to refer.

    You can also find some help in this:http://software-dl.ti.com/ccs/esd/documents/sdto_cgt_tips_for_using_printf.html

**Attention** This is a public forum