2018-01-17 04:00 AM
Hello,
i am using STM32F429IIT controller.I am trying communicate between CAN1 and CAN2 but yet not success.can you please provide any reference code for the CAN communication.
Thanks
#stm32f429-can-communication2018-01-19 10:54 PM
You should get an example going first with a CAN-dongle.
I used the CanDo unit, made it transmit every 10mS and worked on my receiver first.
Using HAL drivers and examples, sets 'your' code aside from the 'processor' code.
It is the best methodology if you want transportable code.but if you want to use the direct method, this will only work with BxCan hardware, and not recommended.
here is a snippet from transmit mailbox 2..
if ((CAN->TSR & CAN_TSR_TME2) == CAN_TSR_TME2) // (1)
CAN->sTxMailBox[2].TDTR = canTxMsgLength[canTxMsgOUT]; // (2) length
CAN->sTxMailBox[2].TDLR = canTxMsgBottomWord[canTxMsgOUT]; // (3) 4bytes
CAN->sTxMailBox[2].TDHR = canTxMsgTopWord[canTxMsgOUT]; // (3) 4bytes
CAN->sTxMailBox[2].TIR = ((uint32_t) canTxMsgID[canTxMsgOUT] << 21 | CAN_TI2R_TXRQ); // (4) send it now if the line is idle
�?�?�?�?�?�?�?�?�?�?�?