cancel
Showing results for 
Search instead for 
Did you mean: 

What is a CAN slave? (STM32F2xx)

mmensch
Associate II
Posted on August 27, 2015 at 09:52

Hi,

I want to design CAN as an option into a new project. While working with STM32CubeMX I get offered to use CAN1 as master or CAN2 as slave. Also ref manu says this.

From my earlier experience with CAN I don't know anything about a CAN slave and in fact CAN specs 2.0 don't have a single occurance of the word slave.

So what is it about with STM32's CAN slave?

I want to put two CAN pins on an board header to have them available for later use. This option should be as flexible as possible ie everything concerning CAN should be possible with it. Should I choose CAN1 or CAN2?

Thanks for any info

Martin

3 REPLIES 3
Posted on August 27, 2015 at 13:28

It's not a ''CAN'' thing, it relates to how the peripheral is built, the CAN1 is a full implementation, whereas CAN2 uses a lot of the resources of CAN1 to reduce the silicon/power footprint.

It would allow you to have two CAN buses, connected to different things.

If the pin routing permits, use CAN1. CAN2 is usable, but requires that CAN1 is fully powered.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jpeacock
Associate III
Posted on August 27, 2015 at 14:07

All the SRAM used for receive filters is in CAN1, with a register setting to place the boundary between CAN1 and CAN2 filter groups.  So as Clive points out CAN1 has to be enabled for the filter SRAM if you use CAN2, but CAN1 doesn't have to be assigned pins.

CAN is inherently a peer-to-peer network so there is no bus master per se controlling traffic, unlike what you normally find in an RS-485 network where one master controls line turnaround and slaves only respond to unicast requests. 

However if you look for ''flying bus master'' in the CANopen protocol there is a bus master/slave pattern where the bus master coordinates system data object (SDO) transfers from many requesters to many responders.  This has nothing to do with hardware.

Some CAN protocols also support redundant links (a big selling point for ST parts, many other vendors only put in one CAN interface).  The CAN1 ''master'' is the primary link and CAN2 ''slave'' the redundant backup in case the CAN1 bus fails (cable short or open, dead transceiver, etc.).  This can be critical where safety related processes are used.  It's tough losing brakes in your car because the connector came loose on one of the CAN buses.....

  Jack Peacock
mmensch
Associate II
Posted on August 27, 2015 at 15:55

Clive and Jack,

thanks a lot for your explanations

Martin