![]() |
TI-radar AWR1843 ARM-Cortex R4F core
1
|
#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/arm/v7a/Pmu.h>#include <ti/sysbios/family/arm/v7r/vim/Hwi.h>#include <ti/control/mmwavelink/mmwavelink.h>#include <ti/control/mmwave/mmwave.h>#include <ti/control/mmwavelink/include/rl_driver.h>#include <ti/common/sys_common.h>#include <ti/drivers/soc/soc.h>#include <ti/drivers/esm/esm.h>#include <ti/drivers/crc/crc.h>#include <ti/drivers/uart/UART.h>#include <ti/drivers/gpio/gpio.h>#include <ti/drivers/mailbox/mailbox.h>#include <ti/drivers/pinmux/include/pinmux_xwr18xx.h>#include <ti/drivers/osal/DebugP.h>#include <ti/drivers/canfd/canfd.h>#include <ti/drivers/pinmux/pinmux.h>#include <ti/drivers/cbuff/cbuff.h>#include <ti/utils/testlogger/logger.h>#include <ti/utils/cli/cli.h>#include "common/mmw_messages.h"#include "common/mmWave_XSS.h"#include <common/app_cfg.h>Go to the source code of this file.
Macros | |
| #define | TASK_PRIO_1 1 |
| #define | TASK_PRIO_2 2 |
| #define | TASK_PRIO_3 3 |
| #define | TASK_PRIO_4 4 |
| #define | TASK_PRIO_5 5 |
| #define | TASK_PRIO_6 6 |
Functions | |
| static void | MSS_mmWaveInitTASK (UArg arg0, UArg arg1) |
| Initialize the MCPI Log Message Buffer. More... | |
| static void | MSS_mmWaveConfigCallbackFxn (MMWave_CtrlCfg *ptrCtrlCfg) |
| This is the application registered callback function which is invoked after the configuration has been used to configure the mmWave link and the BSS. More... | |
| static void | MSS_chirpIntCallback (uintptr_t arg) |
| 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 which is registered to the listener function listenerFxn; defined within SOC_SysIntListenerCfg. Hence; In our design, there's no frame segmentation (Advanced Frame Configuration) (in other words, frame := 1 sub-frame). However, advanced frame configuration will allow the use of different subframes in the radar configuration to support and meet the requirements of different ranges: i.e ultra-short, short, medium, long ranges. Accordingly, different subframes results in different chirp sizes which is totally depending on the each sub-frameType. Therefore, It's important to identify this for each sub-frame before the start of the next subframe, at the end of the previous subframes last chirp. More... | |
| static void | MSS_mmWaveStartCallbackFxn (MMWave_CalibrationCfg *ptrCalibrationCfg) |
| Application registered callback function which is invoked on the peer domain just before the mmWave link is started on the BSS. More... | |
| static void | MSS_mmWaveStopCallbackFxn (void) |
| This is the application registered callback function which is invoked after the MSS has been stopped. Hence, possible sceanarios: More... | |
| static void | MSS_frameStartIntCallback (uintptr_t arg) |
| This is the callback function registered with the ADC Driver which is invoked when a frame is started. This is executed in the ISR context which is registered to the listener function listenerFxn; defined within SOC_SysIntListenerCfg Inside the function we Check if the frames are coming correctly, and no chirps have been missed. More... | |
| static void | MSS_mmWaveCtrlTask (UArg arg0, UArg arg1) |
| This is the task which provides an execution context for the mmWave control module. More... | |
| static void | MSS_mmWaveOpenCallbackFxn (MMWave_OpenCfg *ptrOpenCfg) |
| This is the application registered callback function which is invoked after the MSS has been opened. More... | |
| static void | MSS_mmWaveCloseCallbackFxn (void) |
| This is the application registered callback function which is invoked after the MSS has been closed. More... | |
| static int32_t | MSS_eventFxn (uint16_t msgId, uint16_t sbId, uint16_t sbLen, uint8_t *payload) |
| This is a registered event function which is invoked when an event is recieved from the BSS. This event is passed to the peer domain/core BSS. More... | |
| static void | mboxCallbackFxn_MSS_ch0 (Mbox_Handle handle, Mailbox_Type peer) |
| mboxCallbackFxn_MSS_ch0 is a callback function. Function is invoked for each received messege from the DSS peer endpoint. When invoked, release the resources and wakeup the mmWave thread to process the received message. Hence: the address of this function is passed to mboxCfg.readCallback More... | |
| static void | mboxIn_uartOut_TASK (UArg arg0, UArg arg1) |
| The Task is used to handle the recieved messages from the DSS Peer over the mailbox virtual communication channel. More... | |
| int32_t | MSS_mboxWrite (mmWaveMSG *msg) |
| int32_t | main (void) |
| Main Program entrypoint. This is the entrypoint for the MSS firmware which describe the startup sequence for the AWR1843 application running on top of MSS. The MSS application must have the following startup sequence at bootup time. Clear all the ESM group errors and register Disable the firewall for JTAG and LOGGER (UART) Start the BIOS and further initialize required peripherals. More... | |
Variables | |
| MCB | gMCB |
| gMCB structure contains the tracking information required by the design is aligned using DATA_ALIGN paragma to increase the performance of MSS core by aligning the structure gMCB (Master Control Block) to be divisable by 16. More... | |
| #define TASK_PRIO_1 1 |
Definition at line 76 of file mss_main.c.
| #define TASK_PRIO_2 2 |
Definition at line 77 of file mss_main.c.
| #define TASK_PRIO_3 3 |
Definition at line 78 of file mss_main.c.
| #define TASK_PRIO_4 4 |
Definition at line 79 of file mss_main.c.
| #define TASK_PRIO_5 5 |
Definition at line 80 of file mss_main.c.
| #define TASK_PRIO_6 6 |
Definition at line 81 of file mss_main.c.
| int32_t main | ( | void | ) |
Main Program entrypoint. This is the entrypoint for the MSS firmware which describe the startup sequence for the AWR1843 application running on top of MSS. The MSS application must have the following startup sequence at bootup time. Clear all the ESM group errors and register Disable the firewall for JTAG and LOGGER (UART) Start the BIOS and further initialize required peripherals.
Definition at line 916 of file mss_main.c.
References gMCB, MSS_mmWaveInitTASK(), MCB_t::socHandle, and TASK_PRIO_1.
|
static |
mboxCallbackFxn_MSS_ch0 is a callback function. Function is invoked for each received messege from the DSS peer endpoint. When invoked, release the resources and wakeup the mmWave thread to process the received message. Hence: the address of this function is passed to mboxCfg.readCallback
Definition at line 596 of file mss_main.c.
References gMCB, and MCB_t::mboxSemHandle.
Referenced by MSS_mmWaveInitTASK().
|
static |
The Task is used to handle the recieved messages from the DSS Peer over the mailbox virtual communication channel.
Definition at line 457 of file mss_main.c.
References gMCB, MCB_t::loggingUartHandle, MBOX_DSS2MSS_ASSERT_INFO, MBOX_DSS2MSS_DETOBJ_READY, MBOX_MSS2DSS_DETOBJ_SHIPPED, MCB_t::mboxHandle, MCB_t::mboxSemHandle, MMW_OUTPUT_MSG_SEGMENT_LEN, and MSS_mboxWrite().
Referenced by MSS_mmWaveInitTASK().
|
static |
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 which is registered to the listener function listenerFxn; defined within SOC_SysIntListenerCfg. Hence; In our design, there's no frame segmentation (Advanced Frame Configuration) (in other words, frame := 1 sub-frame). However, advanced frame configuration will allow the use of different subframes in the radar configuration to support and meet the requirements of different ranges: i.e ultra-short, short, medium, long ranges. Accordingly, different subframes results in different chirp sizes which is totally depending on the each sub-frameType. Therefore, It's important to identify this for each sub-frame before the start of the next subframe, at the end of the previous subframes last chirp.
Definition at line 219 of file mss_main.c.
References MCB_t::chirpInt, gMCB, NUM_SUBFRAMES, MCB_t::numChirpsPerSubframe, MCB_t::subframeCntFromChirpInt, and MCB_t::subframeId.
Referenced by MSS_mmWaveInitTASK().
|
static |
This is a registered event function which is invoked when an event is recieved from the BSS. This event is passed to the peer domain/core BSS.
Definition at line 283 of file mss_main.c.
Referenced by MSS_mmWaveInitTASK().
|
static |
This is the callback function registered with the ADC Driver which is invoked when a frame is started. This is executed in the ISR context which is registered to the listener function listenerFxn; defined within SOC_SysIntListenerCfg Inside the function we Check if the frames are coming correctly, and no chirps have been missed.
Definition at line 253 of file mss_main.c.
References MCB_t::chirpInt, MCB_t::frameStartToken, and gMCB.
Referenced by MSS_mmWaveInitTASK().
| int32_t MSS_mboxWrite | ( | mmWaveMSG * | msg | ) |
Definition at line 432 of file mss_main.c.
References gMCB, and MCB_t::mboxHandle.
Referenced by mboxIn_uartOut_TASK().
|
static |
This is the application registered callback function which is invoked after the MSS has been closed.
Definition at line 416 of file mss_main.c.
Referenced by MSS_mmWaveInitTASK().
|
static |
This is the application registered callback function which is invoked after the configuration has been used to configure the mmWave link and the BSS.
Definition at line 346 of file mss_main.c.
Referenced by MSS_mmWaveInitTASK().
|
static |
This is the task which provides an execution context for the mmWave control module.
Definition at line 614 of file mss_main.c.
References MCB_t::ctrlHandle, and gMCB.
Referenced by MSS_mmWaveInitTASK().
|
static |
Initialize the MCPI Log Message Buffer.
MSS Initialization Task which initializes the various components in the MSS subsystem including UART for logging and configurations and Mailbox for bi-directional communication between MSS and DSS subsystems.
setup the PINMUX (pin multiplexing) for bringing out the UART; (UART settings configuring, I/O cell characteristics specification)
Initialize the UART
Initialize the CAN interface
Initialize the Mailbox
Definition at line 643 of file mss_main.c.
References MCB_t::chirpIntHandle, MCB_t::commandUartHandle, MCB_t::ctrlHandle, MCB_t::frameStartIntHandle, gMCB, MCB_t::loggingUartHandle, mboxCallbackFxn_MSS_ch0(), MCB_t::mboxHandle, mboxIn_uartOut_TASK(), MCB_t::mboxSemHandle, MSS_chirpIntCallback(), MSS_CLIInit(), MSS_eventFxn(), MSS_frameStartIntCallback(), MSS_mmWaveCloseCallbackFxn(), MSS_mmWaveConfigCallbackFxn(), MSS_mmWaveCtrlTask(), MSS_mmWaveOpenCallbackFxn(), MSS_mmWaveStartCallbackFxn(), MSS_mmWaveStopCallbackFxn(), MCB_t::numChirpsPerSubframe, MCB_t::socHandle, SUBFRAME_MRR_NUM_CHIRPS_TOTAL, SUBFRAME_USRR_NUM_CHIRPS_TOTAL, and TASK_PRIO_6.
Referenced by main().
|
static |
This is the application registered callback function which is invoked after the MSS has been opened.
Definition at line 400 of file mss_main.c.
Referenced by MSS_mmWaveInitTASK().
|
static |
Application registered callback function which is invoked on the peer domain just before the mmWave link is started on the BSS.
Definition at line 362 of file mss_main.c.
References mmW_MSS_STATS_t::datapathStartEvt, DSS_START_COMPLETED_EVT, MCB_t::eventHandle, gMCB, and MCB_t::stats.
Referenced by MSS_mmWaveInitTASK().
|
static |
This is the application registered callback function which is invoked after the MSS has been stopped. Hence, possible sceanarios:
Definition at line 385 of file mss_main.c.
References mmW_MSS_STATS_t::datapathStopEvt, gMCB, and MCB_t::stats.
Referenced by MSS_mmWaveInitTASK().
| MCB gMCB |
gMCB structure contains the tracking information required by the design is aligned using DATA_ALIGN paragma to increase the performance of MSS core by aligning the structure gMCB (Master Control Block) to be divisable by 16.
Definition at line 163 of file mss_main.c.
Referenced by main(), mboxCallbackFxn_MSS_ch0(), mboxIn_uartOut_TASK(), MSS_chirpIntCallback(), MSS_CLIBasicCfg(), MSS_CLISensorStart(), MSS_CLISensorStop(), MSS_frameStartIntCallback(), MSS_mboxWrite(), MSS_mmWaveCtrlTask(), MSS_mmWaveInitTASK(), MSS_mmWaveStartCallbackFxn(), and MSS_mmWaveStopCallbackFxn().