2007-04-24 12:53 AM
2011-05-17 12:41 AM
Hi all,. In function CAN_ReceiveMessage returns bad parametr Id in mode extended, in mode std is OK
I look in library function, in file 91x_can.c from ST site (stdlib) : pCanMsg->IdType = CAN_EXT_ID; pCanMsg->Id = ((CAN->sMsgObj[1].A2R >> 2) & 0x07FF); pCanMsg->Id |= ((u32)CAN->sMsgObj[1].A1R << 11); pCanMsg->Id |= (((u32)CAN->sMsgObj[1].A2R & 0x0003) << 27); if I read diretctly from register: CAN->sMsgObj[1].A2R & 0x01FFF) CAN->sMsgObj[1].A1R Id is correct I have a problem with function CAN_SendMessage (frame not recieved to destination target, propabability id message is corrupted. May be smoebody have correct library to can-bus?2011-05-17 12:41 AM
I is correct code in function - return 29 bit id in recievied message
/* extended ID*/ pCanMsg->IdType = CAN_EXT_ID; pCanMsg->Id = (CAN->sMsgObj[1].A1R); pCanMsg->Id |= ((u32)((CAN->sMsgObj[1].A2R)&0x1fff) << 16);