Vision Apps User Guide

Introduction

This section contains APIs for logging from remote cores to a central host core which prints all the logs to a common console.

Data Structures

struct  app_log_cpu_shared_mem_t
 Shared memory structure used for logging by a specific CPU. More...
 
struct  app_log_shared_mem_t
 
struct  app_log_init_prm_t
 Init parameters to use for appLogInit() More...
 

Functions

void appLogInitPrmSetDefault (app_log_init_prm_t *prms)
 Initialize app_log_init_prm_t with default parameters always call this function before calling appLogInit. More...
 
int32_t appLogRdInit (app_log_init_prm_t *prms)
 Init Log reader and log writer,. More...
 
int32_t appLogWrInit (app_log_init_prm_t *prms)
 Init Log reader and log writer,. More...
 
int32_t appLogRdDeInit ()
 De-init log reader and log writer. More...
 
int32_t appLogWrDeInit ()
 De-init log reader and log writer. More...
 
void appLogPrintf (const char *format,...)
 Write a string to shared memory. More...
 
int32_t appLogCioInit (void)
 Redirect printf to appLogPrintf. More...
 
void appLogCioDeInit (void)
 De-init Redirect printf to appLogPrintf. More...
 
void appLogCpuSyncInit (uint32_t master_cpu_id, uint32_t self_cpu_id, uint32_t sync_cpu_id_list[], uint32_t num_cpus)
 Sync provided list of CPUs. More...
 

Typedefs

typedef void(* app_log_device_send_string_f) (char *string, uint32_t max_size)
 Callback to write string to console device. More...
 

Macros

#define APP_LOG_MAX_CPUS   (16u)
 Max CPUs that are participating in the logging. More...
 
#define APP_LOG_MAX_CPU_NAME   (16u)
 CPU name to use as prefix while logging. More...
 
#define APP_LOG_PER_CPU_MEM_SIZE   (16*1024u - 32u)
 Size of memory used for logging by one CPU. More...
 
#define APP_LOG_AREA_VALID_FLAG   (0x1357231u)
 Flag to check if log area is valid or not. More...
 

Macro Definition Documentation

◆ APP_LOG_MAX_CPUS

#define APP_LOG_MAX_CPUS   (16u)

Max CPUs that are participating in the logging.

◆ APP_LOG_MAX_CPU_NAME

#define APP_LOG_MAX_CPU_NAME   (16u)

CPU name to use as prefix while logging.

◆ APP_LOG_PER_CPU_MEM_SIZE

#define APP_LOG_PER_CPU_MEM_SIZE   (16*1024u - 32u)

Size of memory used for logging by one CPU.

◆ APP_LOG_AREA_VALID_FLAG

#define APP_LOG_AREA_VALID_FLAG   (0x1357231u)

Flag to check if log area is valid or not.

Typedef Documentation

◆ app_log_device_send_string_f

typedef void(* app_log_device_send_string_f) (char *string, uint32_t max_size)

Callback to write string to console device.

Function Documentation

◆ appLogInitPrmSetDefault()

void appLogInitPrmSetDefault ( app_log_init_prm_t prms)

Initialize app_log_init_prm_t with default parameters always call this function before calling appLogInit.

It is recommended to call this API before calling appLogInit(). User should override init parameters after calling this API.

Parameters
prms[in] Init parameters

◆ appLogRdInit()

int32_t appLogRdInit ( app_log_init_prm_t prms)

Init Log reader and log writer,.

Parameters
prms[in] Init parameters.
Returns
0 on success, else failure.

◆ appLogWrInit()

int32_t appLogWrInit ( app_log_init_prm_t prms)

Init Log reader and log writer,.

Parameters
prms[in] Init parameters.
Returns
0 on success, else failure.

◆ appLogRdDeInit()

int32_t appLogRdDeInit ( )

De-init log reader and log writer.

Returns
0 on success, else failure.

◆ appLogWrDeInit()

int32_t appLogWrDeInit ( )

De-init log reader and log writer.

Returns
0 on success, else failure.

◆ appLogPrintf()

void appLogPrintf ( const char *  format,
  ... 
)

Write a string to shared memory.

Parameters
format[in] string to log with variable number of arguments
Returns
0 on success, else failure.

◆ appLogCioInit()

int32_t appLogCioInit ( void  )

Redirect printf to appLogPrintf.

Returns
0 on success, else failure.

◆ appLogCioDeInit()

void appLogCioDeInit ( void  )

De-init Redirect printf to appLogPrintf.

◆ appLogCpuSyncInit()

void appLogCpuSyncInit ( uint32_t  master_cpu_id,
uint32_t  self_cpu_id,
uint32_t  sync_cpu_id_list[],
uint32_t  num_cpus 
)

Sync provided list of CPUs.