我目前使用am335x CPU 遇到了LINUX 内核里 CAN接收不到远程帧的问题
波特率为250K....外接了2个USB CAN设备...2个USBcan 设备发送远程帧给AM335X 而linux 内核接收不到....
查看IFXMCTL 寄存器..第9位一直都是0....这个是为什么?
而2个USB CAN设备都是正常的.
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.
经过测试..当我USB CAN发送远程帧的时候..IFXARB 的寄存器第29位会为1
而linux源码中
arb_val = d_can_read(priv, D_CAN_IFARB(iface));
mctl_val = d_can_read(priv, D_CAN_IFMCTL(iface));
if (arb_val & D_CAN_IF_ARB_MSGXTD)
frame->can_id = (arb_val & CAN_EFF_MASK) | CAN_EFF_FLAG;
else
frame->can_id = (arb_val >> 18) & CAN_SFF_MASK;
if (mctl_val & D_CAN_IF_MCTL_RMTEN) 使用了CTL寄存器来判断....是否要改成arb寄存器的第29位来判断..
frame->can_id |= CAN_RTR_FLAG;
else {
dataA = d_can_read(priv, D_CAN_IFDATA(iface));
dataB = d_can_read(priv, D_CAN_IFDATB(iface));
for (i = 0; i < frame->can_dlc; i++) {
/* Writing MO higher 4 data bytes to skb */
if (frame->can_dlc <= 4)
frame->data[i] = dataA >> (8 * i);
else {
if (i < 4)
frame->data[i] = dataA >> (8 * i);
else
frame->data[i] = dataB >> (8 * (i-4));
}
}
}
望解答