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.

CCSTUDIO3: printf() stopped working and locks program

Part Number: CCSTUDIO3
Other Parts Discussed in Thread: TMS320F28386S, C2000WARE

I was using plain ole printf() to print to the console. Now it longer works and locks the program in progress. It seems to stop on    __TI_file_lock(stdout);

  • Hello,

    Please provide the following information:

    -Exact CCS version number

    -Exact compiler version number

    -Target device

    -Host OS

    -(if possible) a reproducible test case

    Thanks

    ki

  • CCS version: 11.1.0.00011 

    Compiler: V22.6.0.LTS

    The device is TMS320F28386S.

    Host OS: Windows 10 Pro, version 10.0.19044 Build 19044.

    Test case:

    The project is an import of C:\ti\c2000\C2000Ware_4_02_00_00\driverlib\f2838x\examples\c28x_dual\flash_kernel\

    The file is flash_kernel_c28x_dual_ex1_sci_flash_kernel_cpu1.c

    I added lines 50, 70, and 71. When started it locks up. Also single stepping does not return from line 70.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //###########################################################################
    //
    // FILE: flash_kernel_c28x_dual_ex1_sci_flash_kernel_cpu1.c
    //
    // TITLE: CM kernel main function
    //
    //###########################################################################
    // $Copyright:
    // Copyright (C) 2022 Texas Instruments Incorporated - http://www.ti.com
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    // Redistributions of source code must retain the above copyright
    // notice, this list of conditions and the following disclaimer.
    //
    // Redistributions in binary form must reproduce the above copyright
    // notice, this list of conditions and the following disclaimer in the
    // documentation and/or other materials provided with the
    // distribution.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Thanks.

    You earlier mentioned:

    Now it longer works and locks the program in progress

    Looks like printf was once working as expected. Was this with the same project, device, and CCS version? Or was it a different environment altogether?

    Thanks

    ki

  • All the same.

  • I should add that other projects like blinky work OK with printf().

  • It is likely an issue specific to the project. I searched around in the forums and found the below thread:

    https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/968929/ccs-msp430f2418-problems-with-printf-redirected-to-uart-1/3580253#3580253

    btw - I can reproduce the issue with the same examples (+ your modifications). I don't have an explanation (yet) on the root cause however.

  • Thanks for investigating.

    Meanwhile I had a workaround. It wasn't much work to create a write routine to spit out messages to SCI B and a Putty window.

    JH

  • Meanwhile I had a workaround. It wasn't much work to create a write routine to spit out messages to SCI B and a Putty window.

    Thanks for sharing. We often don't see much printf (over JTAG) usage on MCUs like C2000 due to the high resource demands. Alternate methods such as you describe are more common.