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.

CCS/IWR6843: System_printf() function problem

Part Number: IWR6843
Other Parts Discussed in Thread: SYSBIOS

Tool/software: Code Composer Studio

Hi,

we have problem with system_printf() function, for example,

there is a number float a = 2066412032 and float b = 52410593152,

when we use the code to output the number,

System_printf(" a = %f \n", a);

System_printf(" b = %f \n", b);

get the results:

a = 2066412032.0000

b = (error)

why?

System_printf(" %f \n") only support a float number less than 9.9999e9,not support a float greater than 1.00e10,

why ?

do you have a method to solve this problem ???

many thanks

  • Hi User,

    I've asked an expert to look into this and we should have an answer for you sometime next week.

     

    Cheers,

    Akash

  • This is SYSBIOS question [there is a separate forum for that]. Suggestion: search in your web-browser "system_printf float" or something similar, see what comes up. Another path: Open the API documentation by going to your BIOS installation and open docs/Bios_APIs.html. Then navigate to the API at xdc/runtime/System [how do we know the path? -- as you see in the code to see system APIs you include you refer through "#include <ti/xdc/runtime/System.h>"] and read the API description [you can search "float"]. You can do similar read for any other BIOS APIs you have questions about in future.

  • Hi

    we search "float", but didn't find the answer,

    I have an another question,

    mmwave_sdk_user_guide, section 6.3 Enable DebugP logs,

    I followed the user guide, but it didn't work,I didn't see the log information in the runtime object viewer window,

    why ?

    many thanks

  • I saw you rejected this one which means you couldn't find the answer. Not sure if you opened the documentation in the BIOS API documentation as recommended, you should be able to find the word "float" which will locate a section below and you can go from there:

    -----------

    EXTENDED CONVERSION SPECIFIERS
    The following conversion specifiers are optionally supported. See the extendedFormats configuration parameter for more information about how to enable these conversion specifiers.
    f
    decimal floating point.
    $
    non-ANSI conversion prefix. This prefix indicates that the next character identifies a non-ANSI standard conversion. See the next section for details.

    --------

    For new question, please start a new query as per forum guidelines.

  • Hi,

    we found the documentation and opened,

    And added the code

    System.extendedFormats = "%$L%$S%$F%f";

    into the mmw_dss.cfg file,

    make the experiment,the test code is

    oupt result is

    then we make changes,  the code is

    output is

    why ?

    many thanks

  • I asked the author of the System_printf() code about this problem. Here is the answer:

    "Support for %f is very primitive (to minimize foot print): the current algorithm is

    1. break the float into whole number and 4 digits of any fractional part,
    2. use existing integer-to-string functions (needed for %l) to convert the two pieces

     This has minimal footprint, but has some serious limitations.  For example, ceiling of the float must be < LONG_MAX; otherwise it'll output a corrupt value; so we output "(error)" for any value > LONG_MAX."

    Alan