Page 2 of 2
Re: Problem with CanBus (STM32F407) when alone on bus.
Posted: Tue Feb 02, 2016 8:17 am
by jkozien
I add CAN_MCR_ABOM to my configuration and now everything is working properly.
Thank you very much.
Jaroslaw
Re: Problem with CanBus (STM32F407) when alone on bus.
Posted: Sun Feb 07, 2016 6:39 pm
by rew
I don't know by heart what ABOM is, but reading your problem description I had the impression that you configured your 407 to wait for confirmation from the CANBUS, and then somehow things don't start working again after you've connected other devices, probably because you don't clear the error.
Re: Problem with CanBus (STM32F407) when alone on bus.
Posted: Sat Feb 13, 2016 9:19 am
by avrhack
rew wrote:I don't know by heart what ABOM is, but reading your problem description I had the impression that you configured your 407 to wait for confirmation from the CANBUS, and then somehow things don't start working again after you've connected other devices, probably because you don't clear the error.
ABOM = Automatic Bus Off Management
CAN bus devices need to sync with the bus so there's a very specific protocol defined by the standard about new devices joining the bus and watching for xxxx cycles before being allowed to transmit. A single device on a bus is an unusual and special case of course - any transmission by such a device will error as there is nothing else on the bus. ABOM ensures that this (or indeed an error for any other reason with multiple devices on the bus) is automatically restarted by the CAN hardware in the STM32 rather than needing manual restart.
Quote from the CAN spec on this single-node case.....
Code: Select all
If during start-up only 1 node is online, and if this node transmits some message, it will get no acknowledgment, detect an error and repeat the message. It can become ’error passive’ but not ’bus off’ due to this reason.
In other words, with one device on the bus, it will always get an error and turn off. The OP's original stopCAN/startCAN effectively reset the CAN hardware which is necessary if ABOM is not set. If ABOM is set, it automatically does that for you and tries again.
Re: Problem with CanBus (STM32F407) when alone on bus.
Posted: Sat Feb 13, 2016 8:15 pm
by rew
Thanks for your explanation. So I was right in that the STM detected the error and, without ABOM, was waiting for a "manual" restart.
Re: Problem with CanBus (STM32F407) when alone on bus.
Posted: Sat Feb 13, 2016 11:45 pm
by avrhack
rew wrote:Thanks for your explanation. So I was right in that the STM detected the error and, without ABOM, was waiting for a "manual" restart.
Exactly