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.