cancel
Showing results for 
Search instead for 
Did you mean: 

Can CAN slave acknowledge CAN master message and vice versa?

Uwe Bonnes
Principal III

A CAN device when sending a message needs an external device to acknowledge the message for successfull transmission. A device will not acknowledge its own message. What about CAN master and slave in a single e.g. the STM32F303? Can the slave acknowledge the message from the master and vice versa?

7 REPLIES 7
Ozone
Lead II

I didn't really work with the STM32 CAN, but the terminology is confusing.

There are no masters and slaves in (basic) CAN. Only message priorities.

Higher-level protocols based on CAN (like CANopen) define a "master".

Uwe Bonnes
Principal III

But ST talks about master and slave with regard to their BX-CAN IP

Martin21
Associate II

CAN is a multi Master Bus, there are no slaves.

That means if there are at least two CAN Nodes on the network and correctly configured (Baudrates, etc) the ACK will be set by any other device except the sending one on the network.

Thats common for all CAN devices and has noting to do with the STM32F303 controller.

If you want to test the CAN Controller inside the ST with a single CAN Controller, there is a Loopback and Silent mode for tests and developement, you can find more about it in the reference Manual

Can you cite a document ?

Such a terminology would be clearly wrong if related to the standard CAN bus.

I was wrong. No talking of a slave but a second RX. Excuse my confusion.

Jack Peacock_2
Senior III

Reliable transmission in CAN is a function of the software protocol used on top of the CAN hardware. Think of Ethernet and TCP/IP: Ethernet hardware only sends and receives messages to an address; it requires the TCP protocol to ensure a message arrives at the intended destination. CAN works the same way; a node broadcasts a message with a header identifying the type of message. A CAN receiver processes the message if the header (i.e. the address) matches a filter mask.

You might want to look at either J1939 or CANopen protocols if you need to verify receipt of messages. In general the type of application where CAN is used is oriented toward multiple, autonomous nodes broadcasting their status at periodic or event driven intervals, as well as responding to object queries.

In CANopen you can configure a receipt by using the arrival of a remote PDO to trigger an event-driven local PDO transmit acknowledging the arrival. Essentially, have the receiving node echo back the message to the transmitting node. If the originator receives a matching message that's your receipt.

Jack Peacock

Karl Yamashita
Lead III

Yes ST does mention Master and Slave but in a sense that the Master does the managing for the Slave.

• CAN1: Master bxCAN for managing the communication between a Slave bxCAN and the 512-byte SRAM memory

• CAN2: Slave bxCAN, with no direct access to the SRAM memory.

• The two bxCAN cells share the 512-byte SRAM memory

Yes, as to your question, you can set up the CAN2 to acknowledge CAN1 messages and vise versa. I'm currently working on a CAN bus analyzer software and i've set up my hardware with an STM32F105 to loop physically using jumper wires. Just be sure you have terminating resistor(s);

Tips and Tricks with TimerCallback https://www.youtube.com/@eebykarl
If you find my solution useful, please click the Accept as Solution so others see the solution.