2017-11-30 01:57 AM
Hello ,
I am working on STM32F4xx CAN interface with Busmaster . Here is my initialization code:
/* CAN cell init */CAN_InitStructure.CAN_Mode = CAN_Mode_Normal;
CAN_InitStructure.CAN_SJW = CAN_SJW_1tq;/* CAN Baudrate = 500KBps (CAN clocked at 24 MHz) */
CAN_InitStructure.CAN_BS1 = CAN_BS1_10tq; CAN_InitStructure.CAN_BS2 = CAN_BS2_5tq; CAN_InitStructure.CAN_Prescaler = 3;I have taken the example code from peripheral library, the CAN seems to work fine in loop-back mode, however in the normal mode, I am not able to transmit messages. It updates the transmission mailbox, but when the transmission request is made, ALST0 bit is set CAN_TSR register and LEC[2:0]: Last error code is 100 in (CAN_ESR).
Could you help me figure out the issue, thanks..
#stm32f4xx-can-bus-error2017-11-30 05:50 AM
Hi all,
I got it working by lowing the baud rate to 125kbps. both at MCU and Busmaster.
/* CAN Baudrate = 125 MBps (CAN clocked at 24 MHz) */
CAN_InitStructure.CAN_BS1 = CAN_BS1_9tq; CAN_InitStructure.CAN_BS2 = CAN_BS2_6tq; CAN_InitStructure.CAN_Prescaler = 12; CAN_Init(CANx, &CAN_InitStructure);2017-11-30 09:04 AM
Consider if there is an issue with the transceiver or termination on the bus.