TI-radar AWR1843 C674x DSP core  1
dss_main.c File Reference
#include <stdint.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <math.h>
#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/IHeap.h>
#include <xdc/runtime/System.h>
#include <xdc/runtime/Error.h>
#include <xdc/runtime/Memory.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
#include <ti/sysbios/knl/Event.h>
#include <ti/sysbios/knl/Semaphore.h>
#include <ti/sysbios/knl/Clock.h>
#include <ti/sysbios/heaps/HeapBuf.h>
#include <ti/sysbios/heaps/HeapMem.h>
#include <ti/sysbios/family/c64p/Cache.h>
#include <ti/sysbios/family/c64p/Hwi.h>
#include <ti/sysbios/family/c64p/EventCombiner.h>
#include <ti/sysbios/utils/Load.h>
#include <ti/common/sys_common.h>
#include <ti/common/mmwave_sdk_version.h>
#include <ti/utils/cycleprofiler/cycle_profiler.h>
#include <ti/drivers/mailbox/mailbox.h>
#include <ti/drivers/adcbuf/ADCBuf.h>
#include <ti/drivers/esm/esm.h>
#include <ti/drivers/pinmux/pinmux.h>
#include <ti/drivers/soc/soc.h>
#include "common/mmWave_XSS.h"
#include "dss_data_path.h"
#include "EKF_XYZ_Interface.h"
#include "common/mmw_messages.h"
#include "common/app_cfg.h"
#include <cpy_tbl.h>
Include dependency graph for dss_main.c:

Go to the source code of this file.

Data Structures

struct  DSS2MSS_HSRAM
 

Macros

#define SOC_XWR18XX_DSS_HSRAM_SIZE   0x8000U /* Size: 32KB */
 DSS stores the application output and DSS2MSS ISR information (for fast exception signalling) in HSRAM. More...
 
#define DATAPATH_DET_PAYLOAD_SIZE   (SOC_XWR18XX_DSS_HSRAM_SIZE - sizeof(uint8_t))
 
#define MMW_NUM_ANGLE_BINS   64
 

More...
 
#define SPEED_OF_LIGHT_IN_METERS_PER_SEC   (3.0e8)
 
#define SPEED_OF_LIGHT_IN_METERS_PER_USEC   (3.0e2)
 

Typedefs

typedef struct DSS2MSS_HSRAM DSS2MSS_HSRAM_t
 

Functions

static void DSS_mmWaveInitTASK (UArg arg0, UArg arg1)
 
static void DSS_mmWaveCtrlTask (UArg arg0, UArg arg1)
 
static void DSS_chirpIntCallback (uintptr_t arg)
 
static void DSS_frameStartIntCallback (uintptr_t arg)
 
static int32_t DSS_DataPathConfigAdcBuf ()
 
void DSS_dataPathConfigPopulate (DSS_DataPathObj *obj)
 
void DSS_populateUSRR (DSS_DataPathObj *obj, uint16_t subframeIndx)
 
void DSS_dBScanConfigBuffers (DSS_DataPathObj *obj)
 
static void DSS_edmaBlockCopy (EDMA_Handle handle, uint32_t loadAddr, uint32_t runAddr, uint16_t size)
 
static void DSS_copyTable (EDMA_Handle handle, COPY_TABLE *tp)
 
int32_t DSS_DataPathInit (void)
 
static int32_t DSS_SendProcessOutputToMSS (uint8_t *ptrHsmBuffer, uint32_t outputBufSize, DSS_DataPathObj *obj)
 
static void DSS_DataPathOutputLogging (DSS_DataPathObj *dataPathObj)
 
static void mboxIn_uartOut_TASK ()
 
void mboxCallbackFxn_MSS_ch0 (Mbox_Handle handle, Mailbox_Type peer)
 
void DSP_sleep (void)
 
uint16_t convertSNRdBtoThreshold (uint16_t numInteg, float ThresholdIndB, uint16_t bitwidth)
 
static int32_t DSS_mboxWrite (mmWaveMSG *message)
 
void _MmwDemo_dssAssert (int32_t expression, const char *file, int32_t line)
 
int32_t main (void)
 
void rxGainPhaseParam_Init (DSS_DataPathObj *obj)
 

Variables

DSS2MSS_HSRAM_t gHSRAM
 
far COPY_TABLE _MmwDemo_fastCode_L1PSRAM_copy_table
 
MCB gMCB
 Global Variable for tracking information required by the design. More...
 
volatile cycleLog_t gCycleLog
 

Macro Definition Documentation

◆ DATAPATH_DET_PAYLOAD_SIZE

#define DATAPATH_DET_PAYLOAD_SIZE   (SOC_XWR18XX_DSS_HSRAM_SIZE - sizeof(uint8_t))

Definition at line 78 of file dss_main.c.

◆ MMW_NUM_ANGLE_BINS

#define MMW_NUM_ANGLE_BINS   64

Azimuth FFT size

Definition at line 89 of file dss_main.c.

◆ SOC_XWR18XX_DSS_HSRAM_SIZE

#define SOC_XWR18XX_DSS_HSRAM_SIZE   0x8000U /* Size: 32KB */

DSS stores the application output and DSS2MSS ISR information (for fast exception signalling) in HSRAM.

Definition at line 75 of file dss_main.c.

◆ SPEED_OF_LIGHT_IN_METERS_PER_SEC

#define SPEED_OF_LIGHT_IN_METERS_PER_SEC   (3.0e8)

Definition at line 90 of file dss_main.c.

◆ SPEED_OF_LIGHT_IN_METERS_PER_USEC

#define SPEED_OF_LIGHT_IN_METERS_PER_USEC   (3.0e2)

Definition at line 91 of file dss_main.c.

Typedef Documentation

◆ DSS2MSS_HSRAM_t

Function Documentation

◆ _MmwDemo_dssAssert()

void _MmwDemo_dssAssert ( int32_t  expression,
const char *  file,
int32_t  line 
)

Description
Sends DSS assert information to MSS

Return values
NotApplicable.

Definition at line 302 of file dss_main.c.

◆ convertSNRdBtoThreshold()

uint16_t convertSNRdBtoThreshold ( uint16_t  numInteg,
float  ThresholdIndB,
uint16_t  bitwidth 
)

Description
Converts an SNR (in dB) to an SNR Threshold that the CFAR algo can use.

Parameters
[in]numberof integrations in the detection matrix Typically the number of virtual antennas
[in]Thresholdin dB (float)
Return values
Thresholdfor CFAR algorithm.

Definition at line 1267 of file dss_main.c.

◆ DSP_sleep()

void DSP_sleep ( void  )

Description
Function to sleep the DSP using IDLE instruction. When DSP has no work left to do, the BIOS will be in Idle thread and will call this function. The DSP will wake-up on any interrupt (e.g chirp interrupt).

Return values
NotApplicable.

Definition at line 288 of file dss_main.c.

◆ DSS_chirpIntCallback()

static void DSS_chirpIntCallback ( uintptr_t  arg)
static

Description
This is the callback function registered with the ADC Driver which is invoked when a chirp is available. This is executed in the ISR context.

Parameters
[in]argApplication registered argument
Return values
NotApplicable.

Definition at line 158 of file dss_main.c.

◆ DSS_copyTable()

static void DSS_copyTable ( EDMA_Handle  handle,
COPY_TABLE *  tp 
)
static

Description
Performs linker generated copy table copy using EDMA. Currently this is used to page in fast code from L3 to L1PSRAM.

Parameters
[in]handleEDMA handle
[in]tpPointer to copy table
Return values
NotApplicable.

Definition at line 1147 of file dss_main.c.

◆ DSS_DataPathConfigAdcBuf()

static int32_t DSS_DataPathConfigAdcBuf ( )
static

Description
Function to configure ADCBUF driver based on CLI inputs.

Parameters
[out]numRxChannelsNumber of receive channels.
Return values
NotApplicable.

Definition at line 1048 of file dss_main.c.

◆ DSS_dataPathConfigPopulate()

void DSS_dataPathConfigPopulate ( DSS_DataPathObj obj)

Description
populates the data path object array with the MRR configuration.

Parameters
[in]objpointer to the data path object.
Return values
NotApplicable.

Definition at line 613 of file dss_main.c.

◆ DSS_DataPathInit()

int32_t DSS_DataPathInit ( void  )

◆ DSS_DataPathOutputLogging()

void DSS_DataPathOutputLogging ( DSS_DataPathObj dataPathObj)
static

Description
Function to send data path detection output.

Return values
NotApplicable.

Definition at line 995 of file dss_main.c.

◆ DSS_dBScanConfigBuffers()

void DSS_dBScanConfigBuffers ( DSS_DataPathObj obj)

Description
Configures the dBScan buffers.

Parameters
[in]datapath Object
Return values
Notapplicable.

Definition at line 1284 of file dss_main.c.

◆ DSS_edmaBlockCopy()

static void DSS_edmaBlockCopy ( EDMA_Handle  handle,
uint32_t  loadAddr,
uint32_t  runAddr,
uint16_t  size 
)
static

Description
Performs simple block copy using EDMA. Used for the purpose of copying linker table for L3 to L1PSRAM copy. memcpy cannot be used because there is no data bus access to L1PSRAM.

Parameters
[in]handleEDMA handle
[in]loadAddrload address
[in]runAddrrun address
[in]sizesize in bytes
Return values
NotApplicable.

Definition at line 1185 of file dss_main.c.

◆ DSS_frameStartIntCallback()

static void DSS_frameStartIntCallback ( uintptr_t  arg)
static

Description
This is the callback function registered when a frame is triggered. This is executed in the ISR context.

Parameters
[in]argApplication registered argument
Return values
NotApplicable.

Definition at line 177 of file dss_main.c.

◆ DSS_mboxWrite()

static int32_t DSS_mboxWrite ( mmWaveMSG message)
static

Description
Function to send a message to peer through Mailbox virtural channel

Parameters
[in]messagePointer to the Capture demo message.
Returns
Success - 0 Fail < -1

Definition at line 640 of file dss_main.c.

◆ DSS_mmWaveCtrlTask()

static void DSS_mmWaveCtrlTask ( UArg  arg0,
UArg  arg1 
)
static

Description
This is the task which provides an execution context for the mmWave control module.

Parameters
[in]arg0Argument0 with which the task was created
[in]arg1Argument1 with which the task was created
Return values
NotApplicable.

Definition at line 199 of file dss_main.c.

◆ DSS_mmWaveInitTASK()

static void DSS_mmWaveInitTASK ( UArg  arg0,
UArg  arg1 
)
static

Description
DSS Initialization Task which initializes the various components in the DSS subsystem.

Parameters
[in]arg0Argument0 with which the task was created
[in]arg1Argument1 with which the task was created
Return values
NotApplicable.

Definition at line 472 of file dss_main.c.

◆ DSS_populateUSRR()

void DSS_populateUSRR ( DSS_DataPathObj obj,
uint16_t  subframeIndx 
)

Description
Populates the configuration for the USRR point cloud subframe.

Parameters
[in]datapath Object
Return values
Notapplicable.

Q format of the output x/y/z coordinates

CFAR configuration in Doppler direction

CFAR configuration in Range direction

min and max range configuration

Multi object beam forming configuration

DC Range antenna signature calibration configuration.

CFAR thresholds are varied as a function of range

peakVal thresholds are varied as a function of range (meant to remove cases of clutter being detected too when we drive the car.) Thresholds were derived from experiments.

Configuring the dbSCan for car like objects. These numbers are derived from field tests

Configuring the 'parking assist' occupancy detect.

Definition at line 1316 of file dss_main.c.

◆ DSS_SendProcessOutputToMSS()

int32_t DSS_SendProcessOutputToMSS ( uint8_t *  ptrHsmBuffer,
uint32_t  outputBufSize,
DSS_DataPathObj obj 
)
static

Description
Function to send detected objects to MSS logger.

Parameters
[in]ptrOutputBufferPointer to the output buffer
[in]outputBufSizeSize of the output buffer
[in]objHandle to the Data Path Object
Return values
=0Success <0 Failed

Definition at line 766 of file dss_main.c.

◆ main()

int32_t main ( void  )

Description
Entry point into the DSS MRR TI Design

Return values
NotApplicable.

Definition at line 331 of file dss_main.c.

◆ mboxCallbackFxn_MSS_ch0()

void mboxCallbackFxn_MSS_ch0 ( Mbox_Handle  handle,
Mailbox_Type  peer 
)

Description
This function is a callback function that invoked when a message is received from the peer.

Parameters
[in]handleHandle to the Mailbox on which data was received
[in]peerPeer from which data was received
Return values
NotApplicable.

Definition at line 741 of file dss_main.c.

◆ mboxIn_uartOut_TASK()

static void mboxIn_uartOut_TASK ( )
static

Description
The Task is used to handle the mmw demo messages received from Mailbox virtual channel.

Parameters
[in]arg0arg0 of the Task. Not used
[in]arg1arg1 of the Task. Not used
Return values
NotApplicable.

Definition at line 667 of file dss_main.c.

◆ rxGainPhaseParam_Init()

void rxGainPhaseParam_Init ( DSS_DataPathObj obj)

Variable Documentation

◆ _MmwDemo_fastCode_L1PSRAM_copy_table

far COPY_TABLE _MmwDemo_fastCode_L1PSRAM_copy_table

◆ gCycleLog

volatile cycleLog_t gCycleLog

Definition at line 99 of file dss_main.c.

Referenced by MmwDemo_processChirp().

◆ gHSRAM

Definition at line 86 of file dss_main.c.

◆ gMCB

MCB gMCB

Global Variable for tracking information required by the design.

Definition at line 97 of file dss_main.c.