2021-03-09 01:52 AM
As we are using CAN 2.0 A (11 bit ID STANDARD FORMAT) in STM32L431RBTx MCU & it is working fine. Now we want to go for the CAN open protocol. Is there any sample code or document available or any algorithm to initiate CAN open code development for STM32L431RBTx MCU.
Solved! Go to Solution.
2021-03-09 04:06 AM
2021-03-09 04:06 AM
2021-03-09 04:09 AM
You might take a look at CANFestival (canfestival.org). It implements some of the basic CANopen protocols. I'm not sure if there are any STM32 specific drivers available for it.
I've found the CAN hardware in the STM32 works very well with CANopen. The filter entries map nicely to the 14 service groups in CANopen, though you do have to add some additional processing where a group implements more than one service, like SRDOs. If you need redundant operations or higher bandwidth the dual CAN bus on most STM32s adapts well to CANopen 4 multi-bus operation.
For drivers, if you do your own, implement both RX interrupts to handle CANopen priority messages, such as emergency, SRDO, and global alert. Map the fast response services to RX0 and normal traffic to RX1 queues. One of the more complicated CANopen features is processing out of order message reception to ensure the best response time, especially for heartbeats, hi-rel SRDOs and the global alert. An example is an implementation of multiple motor controllers, one per node, where in an emergency (like the panic button on a conveyor) every motor must stop as soon as possible, to to shut down all motors if one fails. I used the global alert to signal the panic button and SRDOs along with heartbeat to detect single point failures.
Jack Peacock
2021-03-09 05:09 AM
And www.can-cia.org, which manages the development and CANopen device profiles.
2021-03-12 03:01 AM
Hi @Ravi_STM32 ,
3 proposals here :) so up to you to select a Best Answer (click on "Select as Best").
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.