AM62x MCU+ SDK  10.01.00
Debug

Features Supported

  • APIs to log strings to the selected console
  • APIs to assert if a expression evaluates to 0
    • Before asserting, it will log the file and line number to console
  • Ability to disable assert's and logging via a pre-processor define
  • The following console options are supported
    • Log to CCS IDE console via JTAG
    • Log to UART terminal
  • SysCfg support for below,
    • SysCfg can be used to select the log console
    • When UART log is selected, SysCfg allows to select the UART instance and its properties (baud rate etc) to use.
    • SysCfg option to select UART for remote core trace when uart log is enabled. This enables the UART instance to be not closed as part of closing all drivers. Essentially used for Device Mangaer applications to enable Device Mangaer trace logs over UART.
    • SysCfg option to enable SysFw trace. When SysFw UART trace option is selected, SysCfg allows to select UART instance and its pinmuxing.
    • SysCfg option to enable shared memory reader task.
  • APIs to read line as string and/or format input in scanf style from UART console.

Features NOT Supported

  • Log APIs should not be called from ISR context. When called in ISR the APIs have no effect.

Important Usage Guidelines

UART logging

  • Make sure the selected UART driver is opened for the logs to be output to UART.
    • When enabled via SysCfg, calling the function Drivers_open opens and initializes the UART for logging.

Other guidelines

  • Log and assert APIs should not be called from ISR context.
  • The assert and logging APIs are task or thread safe, i.e they can be called from multiple tasks without the output getting mixed.
  • The cores on which CCS or UART console logging is enabled can use either NORTOS or FreeRTOS.
  • If the UART console is used for remote core trace and needs to be opened forever in a FreeRtos application, then the " Remote Core Trace (UART) " option in the sysconfig can be enabled. So, the uart driver will not get closed when common Drivers_close function is called.

Example Usage

Include the below file to access the APIs,

#include <stdio.h>

Example usage for assert,

void *addr = NULL;
/* This will assert when addr is NULL */

Example usage for logs,

uint32_t value = 10;
char *str = "Hello, world !!!";
/* use snprintf to format the string and then call the logging function */
DebugP_log("This is %s and value = %d",
str,

Example usage for scanf,

uint32_t value32;
DebugP_log("Enter a 32b number\r\n");
value32 = 0;
DebugP_scanf("%d", &value32);
DebugP_log("32b value = %d\r\n", value32);

API

APIs for Debug log's and assert's

NULL
#define NULL
Define NULL if not defined.
Definition: csl_types.h:100
addr
uint64_t addr
Definition: csl_udmap_tr.h:3
str
char str[32]
Definition: tisci_core.h:1
DebugP_log
#define DebugP_log(format,...)
Function to log a string to the enabled console.
Definition: DebugP.h:227
DebugP_scanf
int32_t DebugP_scanf(char *format,...)
Read a formatted string from the selected UART driver.
value
uint32_t value
Definition: tisci_otp_revision.h:2
DebugP.h
DebugP_assert
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:175