Okay, i find it hard to believe I'm even having to ask this, but is there a known issue in CCSv5 with sprintf?
We have a project that we're bringing from CCSv4 to CCSv5. The project has been developed and is fully working in CCSv4, with no problems. However, when we brought it to CCSv5, sprintf seems to be breaking.
We couldn't believe it at first either. But we've created an entirely new project, and it breaks exactly the same way.
To replicate:
New Project->CCS Project
Project Name: <Whatever>
Output Type: Executable
Family: MSP430
Variant: MSP430x5xx Family / MSP4305438
Connection: TI MSP430 USB1 [Default]
Once the project is created, goto Properties, then Build->MSP430 Compiler->Advanced Options->Library Function Assumption and change Level of Printf Support from Minimal to Full.
Then your source should be as follows:
Main.c:
/*
* main.c
*/
#include <stdio.h>
void main(void)
{
int Length;
unsigned int temp = 20;
char Msg[255];
Length = sprintf(Msg, "Hello, World, %u", temp);
}
Place a debug point at the closing brace. Then debug the program and run until the breakpoint. Once there, check the status of Msg, and it should be the following:
"Hello, World, 24"
It seems as if it prints the first digit of the value (20) but then the second digit is printed as the hexidecimal value of the number (0x14).
Has anyone else seen this? Is this a known bug? If not, any thoughts on how we screwed up our sprintf function? This is a fresh install of CCSv5.
Thanks,
Ian