2008-08-21 03:17 AM
CAN with stm32
2011-05-17 03:42 AM
Hello,
I succeed to send a CAN message in LoopBack mode. But when I try to communicate with an other microcontroller in Normal mode, TransmitMailbox is always equal to CANTXPENDING. My code : /* CAN cell init */ CAN_InitStructure.CAN_TTCM = DISABLE; CAN_InitStructure.CAN_ABOM = DISABLE; CAN_InitStructure.CAN_AWUM = DISABLE; CAN_InitStructure.CAN_NART = DISABLE; CAN_InitStructure.CAN_RFLM = DISABLE; CAN_InitStructure.CAN_TXFP = DISABLE; CAN_InitStructure.CAN_Mode = CAN_Mode_Normal; CAN_InitStructure.CAN_SJW = CAN_SJW_1tq; CAN_InitStructure.CAN_BS1 = CAN_BS1_8tq; CAN_InitStructure.CAN_BS2 = CAN_BS2_7tq; CAN_InitStructure.CAN_Prescaler = 1; CAN_Init(&CAN_InitStructure); /* transmit */ TxMessage.StdId = 0x01; TxMessage.RTR = CAN_RTR_DATA; TxMessage.IDE = CAN_ID_STD; TxMessage.DLC = 2; TxMessage.Data[0] = 0x01; TxMessage.Data[1] = 0x00; TransmitMailbox = CAN_Transmit(&TxMessage); What are the other changes that I should do to pass in Normal mode?2011-05-17 03:42 AM
Sorry, the problem is hardware.
Bye