Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8575793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:46:30+00:00 2026-06-11T19:46:30+00:00

I am upgrading a fully tested C program for the Texas Instruments (TI) MSP430

  • 0

I am upgrading a fully tested C program for the Texas Instruments (TI) MSP430 micro-controller using a different C compiler, changing from the Quadravox, AQ430 Development Tool to the VisualGDB C compiler.

The program compiles with zero errors and zero warnings with VisualGDB. The interrupt service routines, timers, UART control, and more all seem to be working. Certain uses of sprintf, however, are not working. For example:

unsigned int duration;
float msec;

msec = (float)duration;

msec = msec / 125.0;

sprintf(glb_response,"break: %3.1f msec",msec);

This returns: break: %3.1f msec

This is what is expected: break: 12.5 msec

I have learned about the following (from Wikipedia):

The compiler option –printf_support=[full | minimal | nofloat] allows
you to use a smaller, feature limited, variant of printf/sprintf, and
make that choice at build time.

The valid values are:

full: Supports all format specifiers. This is the default.

nofloat: Excludes support for printing floating point values. Supports
all format specifiers except %f, %g, %G, %e, and %E.

minimal: Supports the printing of integer, char, or string values
without width or precision flags. Specifically, only the %%, %d, %o,
%c, %s, and %x format specifiers are supported

I need full support for printf. I know the MSP430 on my product will support this, as this C program has been in service for years.

My problem is that I can’t figure out 1) if VisualGDB has the means to set printf support to full and 2) if so, where and to set it.

Any and all comments and answers will be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T19:46:31+00:00Added an answer on June 11, 2026 at 7:46 pm

    I would suggest that full support for floating point is both unnecessary and ill-advised. It is a large amount of code to solve a trivial problem; and without floating-point hardware, floating point operations are usually best avoided in any case for performance, code space and memory usage reasons.

    So it appears that duration is in units of 1/125000 seconds and that you wish to output a value to a precision of 0.1 milliseconds. So:

    unsigned msec_x10 = duration * 10u / 125u ;
    
    sprintf( glb_response, 
             "break: %u.%u msec", 
             msec_x10 / 10,  
             msec_x10 % 10 ) ;
    

    If you want rounding to the nearest tenth (as opposed to rounding down), then:

    unsigned msec_x10 = ((duration * 20u) + 125 ) / 250u ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm upgrading an app from Rails 3.0 to 3.1. We've been using Compass and
I`v been upgrading CakePHP from 1.2.10 to 1.3.11 by using Migrating from CakePHP 1.2
I'm upgrading an old internal website from .net 2 to 4 using this procedure
Upgrading from ASP.NET WebAPI Beta to RC has provided some amount of excitement and
In upgrading my application from v1 to v2, I've made a few small changes
After upgrading to a newer hibernate version (guess it came with the switch from
After upgrading from Spring 3.0.0.M4 to 3.0.0.RC1 and Spring Security 3.0.0.M2 to 3.0.0.RC1, I've
I have been upgrading several different VS2008 projects into VS2010 and have found a
I am upgrading a project from EntLib 4.1 to EntLib 5. I've skimmed through
I had a fully working build environment before upgrading to iPhone OS 3.1 and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.