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.

TPS65982: Disable SWD controller in Debug Accessory mode?

Part Number: TPS65982
Other Parts Discussed in Thread: TPS65981, TPS6598X-CONFIG
I am experimenting with Debug Accessory mode using TPS65982 EVM. My goal is to use an external USB-C debug accessory to interface with a microcontroller SWD bus via the TPS6598x SWD_DAT and SWD_CLK pins. For this purpose, TPS65982 would need to pass through the SWD bus without responding to it. The problem I have found with this approach is that the SWD_DAT and SWD_CLK pins are connected to both the Port Data Multiplexer and the Digital Core.
As a result, when I connect an external debugger to TPS65982 using Debug Accessory mode, SBU1 and SBU2 are connected to SWD_CLK and SWD_DAT pins as expected. However the SWD controller on the TPS65982 is also present on the same SWD bus and responds to SWD debug protocol, preventing me from accessing the microcontroller SWD via these pins.
Is there a way to configure TPS65982 firmware so as to entirely disable the TPS65982 SWD controller, so that it does not respond in Debug Accessory mode? If so, I believe this would permit me to use the Debug Accessory as I was hoping.
I am testing using TPS65982 EVM, but intend to use TPS65981 in the design.
  • Hi Martin,

    The TPS65982 will not connect the SBU lines to the SWD lines, this is not how the internal Firmware is setting those signals. When the TPS65982 detects Rd/Rd on both CC lines, it will detect the connection as a debug accessory but will not do anything outside of that. It is then up to the users host controller to read back the connection status from the TPS65982 and then determine what they would like to do with the data lines in their system.

    Please also make sure you are using the latest firmware on your TPS65982EVM when doing testing. You can download the application customization tool under the tools and software tab to get the latest.

    If this answers your question, PLEASE select This resolved my issue

    Thank you,

    Eric

  • Hi Eric,

    The TPS65982 does connect SBU lines to SWD_CLK and SWD_DAT in Debug Accessory mode.

    1. When Debug Accessory is connected, Mux Status register 0x6e indicates that MUX RFU Selection is "SWD_CLK to SBU2, SWD_DAT to SBU1" (see below)
    2. We tested this electrically and the observed behavior matches the register setting, i.e. signals are passed from SBU pins to SWD pins in Debug Accessory mode only.
    3. This is also consistent with your post here: https://e2e.ti.com/support/interface/usb/f/1008/t/609163 which states that "Lastly, the system port signals SWD_CLK and SWD_DIO are routed as analog signals to the USB Type-C port signals SBU1 and SBU2, respectively."

    I tested using latest released versions of config tool  (3.17) and firmware (1.12.07).

    This behavior is important for several reasons:

    • We want to use SWD lines to debug the host controller. In this case we cannot rely on correct operation of host controller to read connection status and program the crossbar
    • Programming the crossbar from the host controller appears to be unsupported by TI. The Mux Status register (0x6e) is undocumented as far as I can tell. (Can you share the register specification for this register?)

    So I would like to return to the original question, is it possible to disable TPS65982 SWD controller so that we can use these pins to debug the host controller in Debug Accessory mode?

    Thanks Eric!

    Martin

    P.S. Here's the Mux Status register with Debug Accessory disconnected:



    And with Debug Accessory connected:


  • Hi,

    Based on my discussions with team, I understand that the goal of this exercise to disable debug accessory mode so that there is no security risk.

    TPS6598x Configuration GUI tool has an option to do so, in the "System Configuration" you can un-check "Debug Accessory Support" as shown below.

     

    Regards,

    Atiq 

  • Hi Atiq,

    Thanks for taking a look at this issue!

    We do not want to disable Debug Accessory Mode. We want Debug Accessory mode to be enabled, but we would like to disable the Single Wire Debug (SWD) JTAG controller in the TPS65982. Is this possible, either via the Configuration Tool TPS6598X-CONFIG, or via I2C register write?

    Hopefully the attached diagram will help explain (along with the posts above).

  • Hi Martin,

    The muxing of SWD onto SBU pins is a TI internal FW debug feature, but does exist in firmware 1.12.07 as you suggest. We do not recommend using this mode, which was put into the device for internal development and debugging purposes, but if you do use the mode we are unable to alter its functionality. The behavior of this mode is to route the internal SWD block of the TPS65986 device out the SBU lines of the type-C cable, and no other mode is supported.

    Thank you,
    Eric
  • That is disappointing, Debug Accessory is a potentially useful solution to a common problem for embedded/mobile device development. It looks like TI is incrementally crippling this feature. We will have to add an external mux instead. In any case, thank you for your time and feedback, it is useful, I am resolving the issue.

    Martin