AnsweredAssumed Answered

STM32f303 CAN bus approach

Question asked by David Pekin on Dec 19, 2017



I'm new to CAN bus and I'm trying to get my head wrapped around this protocol.  I'm looking at the CAN Networking sample code and don't really grasp how it is intended to work.  Here are some observations/questions.


The readme says copy to the templates directory and recompile.  Why can't I just specify the target MCU for the project and recompile in it's original directory?  I've done that with some other examples and it works fine. 


The readme says to compile and load the object code to both (or all) the eval boards on the bus.  Doing that will leave all the CAN addresses the same, right?  I've tried to find where in the code to specify the CAN device address but don't see a define or configuration item to specify the unique address.  What am I missing? Where would I find that?


The CAN receives are interrupt driven.  I've not been able to find the bus/address arbitration code.  Is it in the silicon?  I would expect somewhere to see logic comparing the broadcast packet address with my address and only processing that packet if it was coming to me.  As I said, maybe that's in the core and not exposed...


I've got the Nucleo-64 stm32f303re board but haven't found the schematics. The CAN configuration shows using Port D pins 0 and 1 for TX & RX, I think.  Are those wired to CN3 TX & RX pins? 


I assume that, since it's a bus, you wire TX on board1 to TX on board2 and the same w/ RX.


Suffice it to say that currently the whole CAN bus image is pretty opaque for me.  Any suggestions on the easiest path to clarity would be appreciated.  Thank,


- Dave