在AWR1642评估板上运行mmwave_automotive_toolbox_2_7_1\labs\lab0005_object_data_over_can例程,使用周立功的USB2CAN转换器和上位机软件,基于此例程测试CAN-FD发送和接收数据,能向上位机软件发送数据,但不能接收到上位机软件发送的数据。
软件代码如下:
/*CAN-FD发送接收测试主函数*/
int main (void)
{
Task_Params taskParams;
int32_t errCode;
SOC_Cfg socCfg;
/* Initialize the ESM: */
ESM_init(0U); //dont clear errors as TI RTOS does it
/* Initialize and populate the demo MCB */
memset ((void*)&gMmwMssMCB, 0, sizeof(MmwDemo_MCB));
/* Initialize the SOC confiugration: */
memset ((void *)&socCfg, 0, sizeof(SOC_Cfg));
/* Populate the SOC configuration: */
socCfg.clockCfg = SOC_SysClock_INIT;
/* Initialize the SOC Module: This is done as soon as the application is started
* to ensure that the MPU is correctly configured. */
gMmwMssMCB.socHandle = SOC_init (&socCfg, &errCode);
if (gMmwMssMCB.socHandle == NULL)
{
System_printf ("Error: SOC Module Initialization failed [Error code %d]\n", errCode);
return -1;
}
/* Initialize the DEMO configuration: */
gMmwMssMCB.cfg.sysClockFrequency = MSS_SYS_VCLK;
gMmwMssMCB.cfg.loggingBaudRate = 921600;
gMmwMssMCB.cfg.commandBaudRate = 115200;
/* Check if the SOC is a secure device */
if (SOC_isSecureDevice(gMmwMssMCB.socHandle, &errCode))
{
/* Disable firewall for JTAG and LOGGER (UART) which is needed by the demo */
SOC_controlSecureFirewall(gMmwMssMCB.socHandle,
(uint32_t)(SOC_SECURE_FIREWALL_JTAG | SOC_SECURE_FIREWALL_LOGGER),
SOC_SECURE_FIREWALL_DISABLE,
&errCode);
}
/* Debug Message: */
System_printf ("**********************************************\n");
System_printf ("Debug: Launching the Millimeter Wave Demo\n");
System_printf ("**********************************************\n");
/* Initialize the Task Parameters. */
// Task_Params_init(&taskParams);void MmwDemo_mssInitTask(void)
{
int32_t errCode;
MMWave_InitCfg initCfg;
UART_Params uartParams;
Task_Params taskParams;
Semaphore_Params semParams;
Mailbox_Config mboxCfg;
Error_Block eb;
/* Debug Message: */
System_printf("Debug: MMWDemoMSS Launched the Initialization Task\n");
/*****************************************************************************
* Initialize the mmWave SDK components:
*****************************************************************************/
/* Pinmux setting */
/* Setup the PINMUX to bring out the UART-1 */
Pinmux_Set_OverrideCtrl(SOC_XWR16XX_PINN5_PADBE, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
Pinmux_Set_FuncSel(SOC_XWR16XX_PINN5_PADBE, SOC_XWR16XX_PINN5_PADBE_MSS_UARTA_TX);
Pinmux_Set_OverrideCtrl(SOC_XWR16XX_PINN4_PADBD, PINMUX_OUTEN_RETAIN_HW_CTRL, PINMUX_INPEN_RETAIN_HW_CTRL);
Pinmux_Set_FuncSel(SOC_XWR16XX_PINN4_PADBD, SOC_XW