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.

CC1354R10: How to disable ITM Pin functionality

Part Number: CC1354R10
Other Parts Discussed in Thread: SYSCONFIG

Dear TI Community,

I am working on an application for the CC1354R10 that supports two boot modes:

  • Mode A: Requires ITM logging

  • Mode B: Does not use ITM, and instead repurposes the same pin for UART TX

The ITM pin and UART TX pin are therefore shared between the two modes. Although Mode B does not call any ITM-related APIs, I am still experiencing UART issues when the same pin is assigned to both ITM and UART TX.

My questions are:

  1. Is there a supported way to disable ITM functionality at runtime, either through application code or device configuration?

  2. Alternatively, is there a recommended way to create a separate build configuration where ITM is disabled for that instance?

Additional details:

  • Pin configuration is done via SysConfig

  • It is not possible to use different pins for ITM and UART since all of our other pins are already in use.
  • Boot Mode A and Mode B are completely independent. Device will not reboot from Mode B to Mode A or vice versa; so if there is a way to disable ITM via a build configuration that would be perfect.
  • I attempted calling
    GPIO_resetConfig(CONFIG_GPIO_UART_DEVICE_CMD_TX);

    just before the application starts in Mode B, with the intention of ensuring that ITM is disabled for this boot mode. However, this did not resolve the issue.

Any guidance on the correct or recommended approach for handling shared ITM/UART pins across different boot modes would be greatly appreciated.

Kind regards,
Brenton

  • Hi Brenton,

    First of all: In case you're not aware: There's an errata on the ITM on CC1354R10, CPU_04: The Instrumentation Trace Macrocell (ITM) and Data Watchpoint and Trace (DWT) are active only if an external debug probe is attached to the JTAG port of the device.

    https://www.ti.com/lit/swrz131

    It's not possible to use the ITM outside of debug situations. 

    Regarding your question: Yes, the pins are configurable at runtime. Either with separate images or just closing the ITM driver, redoing the pin configuration with the GPIO driver, then opening the UART driver. Since this is happening at runtime you will overwrite the SysConfig pin configuration.

    If you configure a UART with SysConfig, copy-paste the generated code and put it into your application you should have a working example. (Pin config is reset when you reset the device.)

    Cheers,

    Marie H

  • Hi Marie,

    Thank you for your response.

    For my tests, I did the following:

    • Removed the debugger.

    • Ran the following code:

    #include <ti/drivers/ITM.h>
    UART2_Handle uartDebug;
    UART2_Params uartParamsDebug;
    ...............
    //init function below
    ITM_close();
    GPIO_setConfig(CONFIG_GPIO_UART_DEVICE_CMD_TX, GPIO_CFG_OUTPUT | GPIO_CFG_OUT_HIGH  | GPIO_CFG_OUT_STR_MED);
    UART2_Params_init(&uartParamsDebug);
    uartParamsDebug.baudRate = baudRate;
    uartParamsDebug.parityType = UART2_Parity_NONE;
    uartParamsDebug.stopBits = UART2_StopBits_1;
    uartParamsDebug.dataLength = UART2_DataLen_8;
    uartParamsDebug.writeCallback = NULL;
    uartParamsDebug.writeMode = UART2_Mode_BLOCKING;
    uartParamsDebug.readMode = UART2_Mode_BLOCKING;
    uartDebug = UART2_open(UART_DEVICE_CMD, &uartParamsDebug);
    UART2_rxEnable(uartDebug);

    • Even after this, ITM still appears to send data via the UART Tx pin. From the serial terminal, I see a sequence like 00h ... F8h, which seems to correspond to the ITM start bits required for Wireshark logging.

      It seems the ITM output is still active despite closing it. Do you have any suggestions?

      is my configuration correct, i.e. did it correspond to your recommendations mentioned above?
    • Please note, that if I delete the ITM pin from sysconfig, then the UART works perfectly as is with no code changes required.

    With thanks

    Brenton

  • Hi Marie,

    I managed to find a solution using the following approach:

    • Disabled auto-generation of ti_drivers_config.c and ti_drivers_config.h in SysConfig.

    • Created local copies of ti_drivers_config.c/.h and conditionally disabled all ITM-related code using #ifndef MODE_B, enabling ITM only when not in Mode B.

    This allowed the shared pin to function correctly in Mode B without ITM interference.

    The above solves my issue but it's not a very clean solution as I had to disable autogeneration of files. Do you have any other suggestions for me to solve the above issue in a cleaner manner?

    Thanks for your support.

    Best regards,
    Brenton

  • Hi Brenton,

    Glad you got it to work!

    We expect most user's will arrive at the point in their software development that SysConfig needs to be disabled. I don't see any issue with this.

    Cheers,

    Marie H