9.4. Enable a DM Debug Application

9.4.1. Overview

DM firmware contains Sciserver, Sciclient and RM/PM modules; where only RM/PM has debug trace support. This results in a lack of information about message request failure from HLOS to DM and also about the message forwarding from DM to TIFS, making it difficult to trace the exact point of failure. Implementing trace log for SCI driver will provide a structured way to monitor message transitions at key points, ensuring an accurate source of an error or failure. This will help identify failures precisely and hence reduce debugging time.

9.4.2. Message Flow Path

Block diagram of the Message Flow Path

9.4.3. DM Debug Application Implementation

Trace logs are added in Sciclient/Sciserver at each point, starting from the requesting to DM by HLOS to the message forwarding from DM to TIFS. Using the debug application, the following information will be traced ….

◦ Message Request ID/type

◦ Host ID information

◦ Message parameters

◦ Whether DM/TIFS will process the request

◦ ACK/NACK from TIFS/RM_PM functionality

◦ Response sent back to the host

By default this debug application is not part of DM firmware, We should enable this application inorder to get the logs.

9.4.4. How to Enable DM Debug Application

Follow these steps to enable this application in RTOS:

1.Build the sciserver_testapp_freertos with the flag ENABLE_DM_TRACE=yes.

cd {PDK_PATH}/packages/ti/build
make sciserver_testapp_freertos BOARD=$(SOC)_evm CORE=mcu1_0 ENABLE_DM_TRACE=yes -sj32

2.Copy the generated .rprc and .xer5f binaries from {PDK_PATH}/packages/ti/binary/sciserver_testapp_freertos/bin/$(SOC)_evm/ to {PDK_PATH}/packages/ti/drv/sciclient/tools/ccsLoadDmsc/$(SOC)/

3.Now build SBL and your DM application and Load them into your SD card.

Follow these steps to enable this application in Linux:

1.Build ipc_echo_testb_freertos with the flag ENABLE_DM_TRACE=yes.

cd {PDK_PATH}/packages/ti/build
make ipc_echo_testb_freertos BOARD=$(SOC)_evm CORE=mcu1_0 ENABLE_DM_TRACE=yes -sj32

2.Copy the generated .xer5f binaries from {PDK_PATH}/packages/ti/binary/ipc_echo_testb_freertos/bin/$(SOC)_evm/ to {ti-linux-firmware_folder}/ti-dm/$(SOC)/

3.Rebuild tispl.bin with updated DM and replace tispl in linux boot flow.

9.4.5. How to Enable DM logs in Linux

By default DM logs are disabled in Linux, Follow the below steps to enable DM logs in Linux:

The following example is for j784s4, and the process is the same for other SoCs.

1.Create your Linux environment.

◦ Setup ti-linux-kernel

◦ Setup ti-linux-u-boot

◦ Setup ti-linux-firmware

◦ Setup build-configs

2.Modify the k3-j784s4-j742s2-evm-common.dtsi:

◦ Change the status of mcu_uart0 to “reserved” instead of “okay” in both u-boot and linux-kernel.

◦ Do the same for wkup_uart0 if its status is “okay”.

3.Add the following lines in k3-j784s4-r5-evm.dts in u-boot:

&mcu_uart0 {
   status = "okay";
};

Note: If wkup_uart0 is not present in this file, look for wkup_uart0 in the header files of this file. If not found, add it similar to mcu_uart0 or if found change its status to okay.

4.In board-cfg.yaml of j784s4 in u-boot/board/ti/j784s4/board-cfg.yaml, change debug_cfg: accordingly.

Changes to be made in this board-cfg.yaml file

5.Run u-boot and Linux.

6.Copy the generated DTS file to the SD card:

sudo cp {ti-u-boot_folder}/build/j784s4-evm/a72/dts/upstream/src/arm64/ti/k3-j784s4-evm.dtb {sd_root_partition}/boot/dtb/ti/