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.

RTOS/CC2650: System_printf() is not working

Part Number: CC2650
Other Parts Discussed in Thread: CC2640, SYSBIOS,

Tool/software: TI-RTOS

Hi,

I followed this path for to work System_printf() :

CCS > Project Explorer > YourApp > TOOLS > appBLE.cfg

But still didn't get output using System_printf() function [ I have also included  (#include <xdc/runtime/System.h>)  ].

Do you have to add any other?

  • Hi Gaurav,

    Where are you trying to send the output?  If you have multiple “System.SupportProxy=” lines in the .cfg file then the last one wins.  

    If you do want to use SysCallback then you need to provide some additional support functions.  A description is here: processors.wiki.ti.com/.../CC26xx_Adding_basic_printf_over_uart_with_TI-RTOS

    If you want output to the console instead then you should remove or comment out the “System.SupportProxy=SysCallback;” line.

    Regards,
    Scott

  • Hi ScottG,

    I have done mention method earlier also but still i didn't get output on console ,

    n after doing this also "Add SysCallback to my configuration" remain checked, we can not unchecked it

  • Hi Gaurav,

    In your app_ble.cfg, can you move the “utils.importFile(…”  line earlier, to line #1?  

    .cfg files are processed from top to bottom, and right now, by having this import at the end of the file, the contents of cc2640.cfg can override any earlier statements. in the file.

    Does this work?

    Thanks,
    Scott

  • Hi ScottG,

    Thank you for response. I have tried as per mentioned method but still no output, I am using putty terminal for output, UART output coming properly .

    also included : #include <xdc/runtime/System.h>

    UART configuration are as follows - 

    UART_Params_init(&uartParams);
    uartParams.writeDataMode = UART_DATA_BINARY;
    uartParams.readDataMode = UART_DATA_BINARY;
    uartParams.readReturnMode = UART_RETURN_FULL;
    uartParams.readEcho = UART_ECHO_OFF;
    uartParams.baudRate = 115200;
    //uartParams.baudRate = 9600;
    uart = UART_open(Board_UART0, &uartParams);
    UART_write(uart, Array_One, sizeof(Array_One));

    screenshot for mentioned method -

    I also followed this link(e2e.ti.com/.../492622

    but no output. still trying.

  • Hi Gaurav,

    OK, thanks.  It is good that your app is running and you see UART output.  But it is very odd that you aren't seeing any console output.  Several questions:

    1) What version of TI-RTOS or BLE SDK are you using?

    2) What version of CCS are you using?

    3) Can you show the code where you are doing the System_printf() calls?  And what context are these calls being made from, for example, a Task context?

    4) Have you tried a simple System_printf() from main()?

    5) Have you tried running some of the TI-RTOS kernel examples, like “hello”?  Do you see console output for those?

    6) Can you please attach the cc2640.cfg file you are using to this forum thread?

    7) Can you attach a screenshot of what the “TI-RTOS > Products > SYSBIOS > System > System – Module Settings” view now shows in the graphical config tool?

    Thanks,
    Scott

  • Hi ScottG,

    Thanks for response.  Following are replies  to your questions -

    1) What version of TI-RTOS or BLE SDK are you using?
    >> BLE SDK = ble_sdk_2_02_01_18

         tirtos_cc13xx_cc26xx_2_20_01_08

    2) What version of CCS are you using?
    >>Code Composer Studio
    Version: 6.2.0.00050

    3) Can you show the code where you are doing the System_printf() calls? And what context are these calls being made from, for example, a Task context?
    >>Attached. 1)main.c  2) simple_peri.c   (1st use in main function, 2nd use in task-> for loop)

    4) Have you tried a simple System_printf() from main()?
    >>Yes, its in attached file(main.c)

    5) Have you tried running some of the TI-RTOS kernel examples, like “hello”? Do you see console output for those?
    >> Not yet.

    6) Can you please attach the cc2640.cfg file you are using to this forum thread?
    >>Attached

    7) Can you attach a screenshot of what the “TI-RTOS > Products > SYSBIOS > System > System – Module Settings” view now shows in the graphical config tool?
    >>

    0447.simple_peri.c

    77114.main.c

    1325.app_ble.cfg

  • Hi Gaurav,

    Thanks for the info. I won’t be able to get back to this until later today to try to recreate, but very quickly…  I see in your screenshot that SysCallback is still shown as the system provider:



    Somehow your setting of SysStd is being overridden or ignored.  Unless that gets set properly there won’t be any console output.

    Regards,
    Scott

  • Hi ScootG,

    Thank You for Reply. In Jan 7th post i mentioned the same issue. Anyway, can we completely uninstall this call back utility from IDE? so i can at-least check the SysStd  working. Is there any way?

  • Hi Gaurav,

    Yes, you’d mentioned this earlier but I thought this had changed when you’d moved the “utils.importFile(…”  line earlier, to line #1 of app_ble.cfg.  I see in the app_ble.cfg you attached that this is still at line #6.  If you move this to line #1 you should see the System provider as “SysStd” in the graphical view.  I just tried this in my own install and it works for me as expected.

    One other thing to be sure of when using SysStd is to put a new line escape “\n” at the end of the format string.  That will trigger the debugger to push the string to the console, otherwise the output will be going to a buffer.

    If you modify app_ble.cfg, and include “\n” at the end of the string, can you still not see the output in the CCS console?  If this still doesn’t work, can you please zip up and attach the whole project to this thread so I can look at it?

    Thanks,
    Scott

  • Hi Scott,

    Thanks for reply. I tried all methods that we discussed but i am not able to disable that callback's option. I have attached project. project.txt will help for flow of code - inside zip file.

    Thank you once again for your help.

    Gaurav

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/355/8321.BLE_4000_Ex_5F00_01.7z

  • Hi Gaurav,

    I looked at the projects and don’t see anything that is helpful.  The key file “app_ble.cfg” is not included in these projects.  Are you absolutely sure you modified the right app_ble.cfg file, to do the include at line #1?  

        utils.importFile("../../../../../src/common/cc26xx/kernel/cc2640/config/cc2640.cfg");
        /*
        * Extend the cc2640 configuration
        */
        var SysStd = xdc.useModule('xdc.runtime.SysStd');
        var System = xdc.useModule('xdc.runtime.System');
        System.SupportProxy = SysStd;

    The app_ble.cfg you sent earlier did not have this on line #1, so I’m thinking maybe you’ve modified a different app_ble.cfg.

    The projects you sent are referencing two different app_ble.cfg:

        cfgScript: "C%3A/ti/simplelink/ble_sdk_2_02_01_18/examples/cc2650stk/sensortag_audio/ccs/config/app_ble.cfg"
        cfgScript: "C%3A/ti/simplelink/ble_sdk_2_02_01_18/examples/cc2650lp/simple_peripheral/ccs/config/app_ble.cfg"

    Can you please make sure you’ve modified the right app_ble.cfg?  You can find the right file via the Project Explorer view in CCS: for this project, expand the “TOOLS” folder, and then right click on “app_ble.cfg [TI-RTOS]” and select Properties.  Look at the “Resolved location” to see which app_ble.cfg file the project is actually using.

    I don’t know what else to suggest at this point.  I’ve tried this with my installation and can’t recreate any problem.  So I hope this helps…

    Regards,
    Scott

  • Hi Scott,

    Thank You for useful reply. Yes after your reply i checked app_ble.cfg in my workspace's project, but its not there. Instad of that, its in 'simple_peripheral example' folder from where we copy the project. But while importing the project i checked "copy project into workspace" checkbox, remaining project is also in workspace, i also tried another with examples.

    I found two app_ble.cfg files in 'simple_peripheral example' folder one with old date & other is current one. So how to get rid of this problem? Is there another setting while importing the project into workspace.

    Thank You.
  • Hi Gaurav,

    I don’t know why that file is being linked versus being copied into the project itself.  That might be intentional to keep a common configuration file by default.  If you want to explicitly use your own app_ble.cfg into your project you can right click on the linked app_ble.cfg in the TOOLS folder (in the project as viewed in Project Explorer) and click “Exclude from Build”. 

    And then add you own app_ble.cfg into the project, and clean and build it.

    If you do that, are you able to see console output now?

    Thanks,
    Scott