Other Parts Discussed in Thread: C2000WARE
On our CAN Bus mixed identifiers are used. To our surprise the masking is not working when the Identifier is zero and a extended identifier is received.
We suing the following source from TI:
//###########################################################################
//
// FILE: can.c
//
// TITLE: F2837xD CAN Initialization & Support Functions.
//
// NOTE: The CAN bus bridge uses a different addressing scheme in order to
// allow byte accesses. Because of this, 32-bit reads/writes can execute
// abnormally at higher optimization levels. The CAN driver functions
// have been adjusted to explicitly use two 16-bit read/writes to access
// the full 32-bit register where HWREGH(base + offset) represents the
// lower 16-bits and HWREGH(base + offset + 2) represents the upper
// 16-bits.
//
//###########################################################################
// $TI Release: F2837xD Support Library v200 $
// $Release Date: Tue Jun 21 13:00:02 CDT 2016 $
// $Copyright: Copyright (C) 2013-2016 Texas Instruments Incorporated -
// http://www.ti.com/ ALL RIGHTS RESERVED $
//###########################################################################

// Configure the Mask Registers.
if(pMsgObject->ui32Flags & MSG_OBJ_USE_ID_FILTER)
{
if(bUseExtendedID)
{
// Set the 29 bits of Identifier mask that were requested.
ui32MaskReg = pMsgObject->ui32MsgIDMask & CAN_IF1MSK_MSK_M;
}
else
{
// Put the 11 bit Mask Identifier into the upper bits of the field
// in the register.
ui32MaskReg = ((pMsgObject->ui32MsgIDMask << CAN_IF1ARB_STD_ID_S) & CAN_IF1ARB_STD_ID_M);
ui32MaskReg = ui32MaskReg | 0x3ffff;
}
}
When adding line 1213 the masking is working also when the identifier 0 is used.
Is it an issue with the processor?
Reto