I just finished teaching an Intro to Microprocessors course using the MSP430G2553. Great, small and simple platform with lots of capabilities.
However, once we got to the more complex labs using additional components, sensors, not having printf working on this platform, made things a lot more difficult.
I've done a bunch of investigating on this issue, found lots of references an the conclusion I came to with my own experimentation is that at some point, printf might have worked on this version of the board, but now the crt library is too big for it. I got it to work on the F series of the board that has more memory. However, I really think that someone in CCS and/or TI groups should look at this and see if they can get a tiny version that fits on this. Energia somehow has it working very well and I really think that CCS/TI should as well. The two language environments are quite different and for real low level projects, you really need CCS, debugging and printf support.
Any suggestions, memory map adjustments, etc, would be appreciated. I've tried minimizing stack size,etc
Thanks for all your support and help.
Simple program using the latest CCS 6.1.1 Version: 6.1.1.00022
#include <msp430.h>
#include <stdio.h>
int main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Set Watchdog Timer interval to ~30ms
P1DIR=0;
P1DIR |= (BIT0 | BIT6); // Set P1.0 to output direction;
P1OUT = BIT0;
printf("delay cycle 100000\n");
printf("Pin P1.0 and P1.6\n");
while (1)
{
{
P1OUT ^= (BIT0 | BIT6 ); // Toggle P1.0 and P1.6 using exclusive-OR
__delay_cycles(100000);
}
}
}
Build output:
**** Build of configuration Debug for project LED-Test-G2533 ****
"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building target: LED-Test-G2533.out'
'Invoking: MSP430 Linker'
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.6/bin/cl430" -vmsp --abi=eabi --use_hw_mpy=none --advice:power="all" -g --define=__MSP430G2533__ --display_error_number --diag_wrap=off --diag_warning=225 --printf_support=nofloat -z -m"LED-Test-G2533.map" --stack_size=50 --heap_size=50 -i"C:/ti/ccsv6/ccs_base/msp430/include" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.6/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.6/include" --reread_libs --diag_wrap=off --warn_sections --display_error_number --xml_link_info="LED-Test-G2533_linkInfo.xml" --use_hw_mpy=none --rom_model --unused_section_elimination=on --compress_dwarf=on -o "LED-Test-G2533.out" "./main.obj" "../lnk_msp430g2533.cmd" -l"libc.a"
<Linking>
remark #10371-D: (ULP 1.1) Detected no uses of low power mode state changing instructions
remark #10372-D: (ULP 4.1) Detected uninitialized Port 2 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
remark #10372-D: (ULP 4.1) Detected uninitialized Port 3 in this project. Recommend initializing all unused ports to eliminate wasted current consumption on unused pins.
"../lnk_msp430g2533.cmd", line 94: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".stack" size 0x32 . Available memory ranges:
RAM size: 0x200 unused: 0x32 max hole: 0x32
>> Compilation failure
"../lnk_msp430g2533.cmd", line 93: error #10099-D: program will not fit into available memory. run placement with alignment fails for section ".sysmem" size 0x32 . Available memory ranges:
RAM size: 0x200 unused: 0x32 max hole: 0x32
error #10099-D: program will not fit into available memory. run placement with alignment fails for section "DATA_GROUP" size 0xfa . Available memory ranges:
RAM size: 0x200 unused: 0x32 max hole: 0x32
error #10010: errors encountered during linking; "LED-Test-G2533.out" not built
gmake: *** [LED-Test-G2533.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****