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/OMAP-L138: --printf_support=full is not working for float numbers

Part Number: OMAP-L138

Tool/software: Code Composer Studio

Hi,

I need to use printf and sprintf in my project. Unfortunately it does not work and prints nothing with %f format with --printf_support=full !

I have tested it on an empty project and it works fine. But I don't know what is preventing it to print float values in my other project. I have checked all the options and I read all the e2e threads about it, all said to turn on --printf_support=full in compiler options! Is there any library specific setting for it in linker?

CCS 5.3

COFF

CGT 7.4.1

XDC 3.24.5.48

SYS/BIOS 6.34.2.18

NDK 2.21.0.32

  • Make sure you #include <stdio.h> .  Check on whether you have overflowed the stack, or run out of heap memory.  These tips, and more like them, are in the article Tips for Using Printf.

    Thanks and regards,

    -George

  • Hi George
    I have checked this page before, I've tried to increase the heap size but no difference.
    I am not sure how to un-check for "No Dynamic Heaps" . Is there something related to RTSC platform?
    So sure there is not any library mismatch?

    sys/bios heap config:

    /* create a HeapMem heap instance "systemHeap" */
    var systemHeapParams = new HeapMem.Params;
    systemHeapParams.size = 4096000;
    var systemHeap = HeapMem.create(systemHeapParams);
    
    /* set "systemHeap" to be the default Heap for the app */
    Memory.defaultHeapInstance = systemHeap;
    

  • Hi Aidin,

    Since you are using SYS/BIOS, why not use System_printf and System_sprintf? There is an option with the the xdc.runtime.System module to support floats.

    Todd
  • Hi Todd,
    Thank you very much for this hint. System_printf works fine on a "hello" sys/bios example. But it doesn't show anything in my project. I have checked the .cfg file and System, SysMin and Text are enabled. I've also checked extended features for %F%f on .cfg file (found it from one of your posts in reply to other users). But Nothing happened!
  • SysMin places the characters into an internal buffer until
    1. a System_flush is called
    2. the application terminates

    Then the characters are flushed to the CCS console (via the CCS CIO buffer). Note: this wrecks real-time performance since CCS halts the target, reads the buffer and then resumes the target.

    The best way to see the characters is to look in ROV->SysMin->OutputBuf (or something like that). You need to halt the target to let ROV read the buffer though.

    You can use SysStd instead of SysMin. SysStd mimics printf behavior so characters are written directly to the CIO buffer and CCS reads them when a '\n' occurs or the buffer is full.

    Todd
  • Hi Todd,
    Finally it works. I use SysStd and everything is OK. I did not find detail documentation about them.
  • Hi Aidin,

    Glad you have it working now. The best place to look for more details is in SYS/BIOS release notes Documentation section and select SYS/BIOS APIs (cdoc) and then navigate to the desired module.

    Todd