cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 CAN in slave mode. Is it possible?

serkodog
Associate II
Posted on January 19, 2015 at 07:42

Hello everyone!

Help me, please.

I've got STM32F042K6T6.

Can I use it in an

endpoint

device?

Here is only CAN interface, is it possible to use it as slave?

Thanks!

#slave #bxcan #stm32f0 #slave #bus #can #can
7 REPLIES 7
jpeacock
Associate III
Posted on January 19, 2015 at 14:07

CAN is a peer to peer network, not sure what you mean by ''slave mode''.  Some CAN software protocols do use a bus master to control startup and configure other nodes, but there is no hardware mode for a bus master other than having the highest priority.

Endpoints are in USB, not CAN.  All CAN nodes support the same 11 bit or 29 bit object address space.  Anything equivalent to an endpoint is entirely software dependent for the protocol used.

  Jack Peacock

serkodog
Associate II
Posted on January 20, 2015 at 07:59

I had some

doubts

because of the

settings

of the

CAN-BUS in STM Cube. There only master mode could be selected.

Thanks for your answer!

________________

Attachments :

CAN_STM_Cube.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0ua&d=%2Fa%2F0X0000000bfT%2F2AcOiTazzjRgy_roghtQHZhEjvGP.KoR.4pwL7yjAxU&asPdf=false
rohanne
Associate II
Posted on January 20, 2015 at 15:22

Hello Sergey,

have you by any chance tried to initialize USB for VCP communication with STM32F042K6T6? I am quite stuck on it.
gerhard2
Associate
Posted on January 18, 2016 at 10:04

Hi Sergey and others!

I have the same problem with STM32L476RG. To Select CAN I must Select Master, but I want a slave!

Did you find a solution?

Regards,

Gerhard

PS. ScreenShot attached

________________

Attachments :

CubeMX_Selecting_Slave_CAN.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0uL&d=%2Fa%2F0X0000000bfR%2FgVGO4RUtN7E6pEj0TnOd3RNFvqpGcN_wMSoLo0IJx1E&asPdf=false
Posted on January 18, 2016 at 14:54

But what does ''Slave'' even mean in your context? The CAN device can listen to device traffic in it's standard configuration. Whether you send messages onto the bus is entirely up to you, so just listen and don't send anything.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
gerhard2
Associate
Posted on January 21, 2016 at 13:02

I thought slave was an ordinary term in CAN, even though they use several concepts:  Master / Slave, Client / Server, Producer / Consumer.

The slave will typically be a sensor. The Master requests data from the sensor.

However, I didn’t expect the master / slave to have any influence at this low level. At this level I expected an driver and receiver and no difference between master and slave.

Regards,

Gerhard

P.S. Sorry for the late answer. I am used to e-mail warnings when I get reply in forums. I realized I needed to select it here.

AvaTar
Lead
Posted on January 21, 2016 at 13:34

The basic CAN does not have master/slave devices, just address based arbitration. OTOH, higher level protocols like CANopen --do-- have a master/slave concept.

I never used the STM32 CAN peripheral, so I'm not sure if ST mixed in such a concept. I recommend to read the reference manual here.