This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3356: Question about remote frame receive of DCAN on am335x

Part Number: AM3356
Other Parts Discussed in Thread: SYSBIOS

Hello,

I want to inquire about the DCAN remote frame on AM335X. The chip used is AM3356 chip, and the RTOS used is TI's SYSBIOS. The CANFestival protocol stack needs to be used on this system. The current phenomenon is that the data frame of DCAN is received normally, but the remote Frame reception exception.According to 23.3.15.8 Reception of Remote Frames in the AM335x Technical Reference Manual, we know that there are three ways to receive remote frames, we configure it as the third one,The remote frame is treated similar to a received data frame,register are stored in the message object in the message RAM,and perform subsequent data processing.Dir = ‘1’ (direction = transmit), RmtEn = ‘0’, UMask = ‘1’,The configuration has been completed, and the specific procedures are as follows:

void CANRemoteObjectConfig(UINT16 CobId,UINT16 msgIndex, UINT32 ifReg)
{
	/* Use Acceptance mask. */
    DCANUseAcceptanceMaskControl(SOC_DCAN_0_REGS, DCAN_MASK_USED, ifReg);

    /* Configure the DCAN mask registers for acceptance filtering. */
    DCANMsgObjectMskConfig(SOC_DCAN_0_REGS, DCAN_IDENTIFIER_MSK(0x7FF,
                           DCAN_ID_MSK_11_BIT), DCAN_MSK_MSGDIR_DISABLE,
    		               DCAN_MSK_EXT_ID_DISABLE, ifReg);

    /* Set the message valid bit */
    DCANMsgObjValidate(SOC_DCAN_0_REGS, ifReg);

    /* Set the message id of the frame to be received */
    DCANMsgIdSet(SOC_DCAN_0_REGS, CobId, DCAN_11_BIT_ID, ifReg);

    /* Set the message object direction as receive */
    DCANMsgDirectionSet(SOC_DCAN_0_REGS, DCAN_TX_DIR, ifReg);

    DCANRemoteFrameDisable(SOC_DCAN_0_REGS,ifReg);
   // DCANTransmitRequestControl(SOC_DCAN_0_REGS,DCAN_TRANSMIT_REQUESTED,ifReg);

    /* Enable the receive interrupt for the message object */
    DCANMsgObjIntEnable(SOC_DCAN_0_REGS, DCAN_RECEIVE_INT, ifReg);

    /* Enable the FIFO end of block */
    DCANFIFOEndOfBlockControl(SOC_DCAN_0_REGS, DCAN_END_OF_BLOCK_DISABLE, ifReg);

	if(DCANMsgValidStatusGet(SOC_DCAN_0_REGS, msgIndex)==0)
	{
    	/* Configure the command register */
    	DCANCommandRegSet(SOC_DCAN_0_REGS, (DCAN_ACCESS_CTL_BITS | DCAN_MSG_WRITE |
                      	DCAN_ACCESS_MSK_BITS | DCAN_ACCESS_ARB_BITS),
                      	msgIndex, ifReg);
	}
}

The call to this function is as follows:

CANRemoteObjectConfig(FuncId_NMTERR+NodeId,MsgNum_ReceiveTop+(msgindex++),DCAN_IF2_REG);

We have tried turning the RmtEn bit on and off to ensure RmtEn = '0'. The current situation is as follows, when using the debugger PCAN to send a remote frame, the AM335X cannot receive the remote frame, nor can it enter the receive interrupt, and there is no message in the message object.

Thanks and regards.

  • Part Number: AM3356

    你好 ,

    我想咨询一下AM335X上的DCAN远程帧。使用的芯片是AM3356芯片,使用的RTOS是TI的SYSBIOS。在这个系统上需要使用 CANFestival 协议栈。目前的现象是DCAN的数据帧接收正常,但是remote Frame接收异常。根据AM335x 技术参考手册中的2 3.3.15.8 接收远程帧,我们知道接收远程帧有三种方式,我们将其配置为第三种远程帧被视为接收到的数据帧,注册存储在消息RAM中的消息对象中,并进行后续的数据处理。Dir = '1'(方向 = 传输),RmtEn = '0',UMask = '1'。配置已经完成,具体步骤如下:

    void CANRemoteObjectConfig(UINT16 CobId,UINT16 msgIndex, UINT32 ifReg)
    {
    	/* Use Acceptance mask. */
        DCANUseAcceptanceMaskControl(SOC_DCAN_0_REGS, DCAN_MASK_USED, ifReg);
    
        /* Configure the DCAN mask registers for acceptance filtering. */
        DCANMsgObjectMskConfig(SOC_DCAN_0_REGS, DCAN_IDENTIFIER_MSK(0x7FF,
                               DCAN_ID_MSK_11_BIT), DCAN_MSK_MSGDIR_DISABLE,
        		               DCAN_MSK_EXT_ID_DISABLE, ifReg);
    
        /* Set the message valid bit */
        DCANMsgObjValidate(SOC_DCAN_0_REGS, ifReg);
    
        /* Set the message id of the frame to be received */
        DCANMsgIdSet(SOC_DCAN_0_REGS, CobId, DCAN_11_BIT_ID, ifReg);
    
        /* Set the message object direction as receive */
        DCANMsgDirectionSet(SOC_DCAN_0_REGS, DCAN_TX_DIR, ifReg);
    
        DCANRemoteFrameDisable(SOC_DCAN_0_REGS,ifReg);
    
        /* Enable the receive interrupt for the message object */
        DCANMsgObjIntEnable(SOC_DCAN_0_REGS, DCAN_RECEIVE_INT, ifReg);
    
        /* Enable the FIFO end of block */
        DCANFIFOEndOfBlockControl(SOC_DCAN_0_REGS, DCAN_END_OF_BLOCK_DISABLE, ifReg);
    
    	if(DCANMsgValidStatusGet(SOC_DCAN_0_REGS, msgIndex)==0)
    	{
        	/* Configure the command register */
        	DCANCommandRegSet(SOC_DCAN_0_REGS, (DCAN_ACCESS_CTL_BITS | DCAN_MSG_WRITE |
                          	DCAN_ACCESS_MSK_BITS | DCAN_ACCESS_ARB_BITS),
                          	msgIndex, ifReg);
    	}
    }
    

    该函数的调用如下:

    CANRemoteObjectConfig(FuncId_NMTERR+NodeId,MsgNum_ReceiveTop+(msgindex++),DCAN_IF2_REG);

    我们尝试打开和关闭 RmtEn 位以确保 RmtEn = '0'。目前情况如下,使用调试器PCAN发送远程帧时,AM335X无法接收远程帧,也无法进入接收中断,消息对象中也没有消息。

    谢谢并恭祝安康。

  • Hello,

    I'm sorry, but TI has stopped supporting TI-RTOS(SYS/BIOS) based SW development for AM335x. Please refer to this announcement and find consolidated resources there. 

    Regards

    Jianzhong
  • Hello,Jianzhong

    The question I am consulting is about CAN driver configuration, which has nothing to do with SYSBIOS. Can you try to help me answer it?

    Thanks and regards.

  • Hello,

    I understand and apologize for not making it clear. We actually do not support any non-Linux SW for AM335x. That includes both SYSBIOS based and baremetal development. Your case falls in the baremetal development category. 

    I would recommend you to look at the CAN examples in the PDK. Please follow AM335x/AM437x TI-RTOS based SW development resources -> Getting started with RTOS or Bare-metal Development:

    After you generate the PDK example projects, you should be able to find DCAN_LoopbackExample_evmAM335x_armTestProject. This project shows how CAN driver should be configured.

    Hope this helps.

    Regards,

    Jianzhong