2018-05-25 12:34 AM
Hello Everyone,
I,am having a issue with my can node.
The communication bw two can nodes built on STM32L4 works perfectly fine. But that's just for testing purpose. I don't intend to use it that way.
When I introduce it to an existing CAN bus, TX stops. Node is able to read the messages on the bus.
Please let me know what all things i can try or i might be missing.
Hope someone has already been down this road and can help me out..
CAN settings are as follow
hcan1.Instance = CAN1;
hcan1.Init.Prescaler = 6; hcan1.Init.Mode =CAN_MODE_NORMAL
; hcan1.Init.SyncJumpWidth = CAN_SJW_1TQ; hcan1.Init.TimeSeg1 = CAN_BS1_13TQ; hcan1.Init.TimeSeg2 = CAN_BS2_2TQ; hcan1.Init.TimeTriggeredMode = DISABLE; hcan1.Init.AutoBusOff = DISABLE; hcan1.Init.AutoWakeUp = DISABLE; hcan1.Init.AutoRetransmission = ENABLE; hcan1.Init.ReceiveFifoLocked = DISABLE; hcan1.Init.TransmitFifoPriority = DISABLE;#can #can-interface #can-examples #problem-can2018-05-25 01:00 AM
Probably some clock mismatch.
Check generated bitrate, and also the balance between TimeSeg1 and TimeSeg2.
2018-05-25 02:10 AM
GONZALEZ.Laurent
Thanks for the response.
I intend to generate 500K bit rate and m able to decode that on an analyser when testing the node separately and with other stm32L4 node.
On the other bus (obd2 can bus ) too, i am able to receive the messages from ecu but not transmit.
I say so as my transmitted msgs are not visible on analyzer but on the other hand the messages sent by obd2 port is received on analyer and stm32L4 node too.
Please let me know if this still can be a clock issue.
and I exactly don't know much about
TimeSeg1 and TimeSeg2. i just copied the configuration from ''
http://www.bittiming.can-wiki.info/#STMicro
''Have attached the picture of the same. Please suggest if any changes are required in this area.
2018-05-25 02:22 AM
Proper bus termination ?
CANH/CANL polarity correct ? Swapping both pins usually don't work.
Does any node go into Error-Passive or Bus-Off ?
2018-05-25 02:29 AM
you should have AutoBusOff enabled.
you should check the wires with a scope to see what is really going on.
2018-05-25 04:51 AM
you should check the wires with a scope to see what is really going on.
If a CANbus analyzer shows no traffic you should definitely.
2018-05-25 06:21 AM
On CANbus analyser i can see the internal communication bw other nodes but not able to see the msg which is supposed to be transmitted by my node(STM32L4). Ican read the msges on my node too. so the traffic is there.It just tht the STM32L4 node is not transitting once on the bus.
I have read that CAN controller waits for the bus to get idle before transmitting.
So I,am suspecting that something is being missed on those lines in configuration.
Please suggest or correct me if I,am thinking on wrong lines.
2018-05-25 03:09 PM
work on your receiver first, to get the baud rate correct, then work the transmitter.
ABOM must be enabled.
2018-05-25 11:32 PM
I have this disabled,
AutoRetransmission = DISABLE;
2018-05-26 01:19 AM
Sure I would try with ABOM enabled.
The receiving part is working perfectly fine. Have verified , the messages received on analyser and by the node are same. Let me know if there is still something else to be looked at receiver end.