cancel
Showing results for 
Search instead for 
Did you mean: 

NUCLEO-F767ZI CAN bus example

Vaclav Zajic
Associate II
Posted on March 27, 2018 at 12:17

Hello, is there a working example for CAN bus on NUCLEO-F767ZI board? I tried to search the STM32F7-Cube and was not successful. Thank you in advance! Vaclav

#can-interface #stm32f7
9 REPLIES 9
Vladislav Kaloerov
Associate
Posted on March 29, 2018 at 09:41

Hello Vaclav, in my experience, you can use any can bus example, even for other mcu series like f4 or f3, bxCAN modules works the same. Baud rate calc for your project simple with 

http://www.bittiming.can-wiki.info/

 .
Vaclav Zajic
Associate II
Posted on March 29, 2018 at 09:49

Hello Vladislav, thank you! Vaclav

Bob Boys
Senior
Posted on April 03, 2018 at 22:08

Hello

There is a CAN example in the Keil examples for the STM32756-EVAL board.

You might try this.  There is a good chance it will work fro your processor.

You can use the free Keil MDK eval version to compile and evaluate this example if you turn the graphics off in Ui.c

.

http://www.keil.com/support/man/docs/uv4/uv4_ca_packinstaller.htm

 

Bob

Posted on April 03, 2018 at 22:46

It is not a board that ships with a CAN interface, find a board that comes with CAN and then port it to the NUCLEO, and configure the circuit/transceiver in an equivalent fashion

STM32Cube_FW_F7_V1.9.0\Projects\STM32756G_EVAL\Examples\CAN\CAN_Networking

STM32Cube_FW_F7_V1.9.0\Projects\STM32F769I_EVAL\Examples\CAN\CAN_Networking

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 04, 2018 at 03:40

Yes - this is true....but there is a CAN ''cheat'' you can use - it isn't CAN physical layer compliant: but for two (and maybe a few more) nodes - it is simple to add to any board. Diodes are 1N914 or 1N4148 or similar.

You can't connect to a real CAN network because the voltages are different and there is no differential signal.

0690X0000060APeQAM.png

There are not many boards with the CAN transceiver installed - the Keil MCB series and the  ST EVAL boards usually have them.  Maybe there are more ?

There are low cost external transceiver boards available:  search for can transceiver breakout board

There are many ST boards with two CAN controllers on them - remember you need at least 2 CAN nodes for a CAN network to work.

There are some more details on my CAN Primer

http://www.keil.com/appnotes/docs/apnt_236.asp

 

I have version 2.9 available - I will try to get it up on the Keil website Wednesday.

Thanks

Bob Boys

Vaclav Zajic
Associate II
Posted on April 04, 2018 at 15:06

So my setup is Nucleo-F767ZI connected to CAN transceiver MCP2551. CAN on MCP2551 is connected to USB to CAN converter, I have 120 Ohm resistor between CAN_H and CAN_L. I can not see anything on the bus. I used example 'CAN networking' from example for STM32F769I-eval, where I changed the pin configuration of CAN1 according to pin description of Nucleo-F767ZI. Any ideas? Thank you for help. Vaclav

Posted on April 04, 2018 at 15:50

Your device needs to communicate with other nodes on the bus.

You could try using loop-back mode to see if that works, seem to remember there is some signal bleed through on to the bus which can be seen on a scope.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 04, 2018 at 20:01

Hello

You have several places that can cause a problem.  I recommend using a scope on CAN out on the processor CAN_Out to see if there is any action.  To see signals on a CAN analyzer or on another node - you have to have so many things set properly - with a scope many things can be wrong and a signal of some sort can be visible with a scope.  Cheap scopes work quite well.

If your CAN speed is not the same as set on your analyzer - you will see nothing.  If your CAN speed is not what you think it is, the scope will still see any activity.

If you do not have another node connected (or working) - your CAN controller will send out the first message forever - it is waiting for the ACK signal.  A scope will be able to see this activity.

If a stand-alone CAN controller is trying to send out messages and no transceiver is connected or not conected correctly  - no signals will be output on CAN_Out.  Not even a scope will see anything.

It is imperative that CAN_Out and CAN_IN are connected together via a CAN transceiver chip.  Then a scope will see any activity.  Somehow, CAN_OUT and CAN_IN must be connected in this fashion.

Here is another CAN trick: I have seen where without a transceiver if you short CAN_Out to CAN_In: the transceiver can then output a signal and a scope can see it.  can't guarantee this happens on ST controllers.  maybe I should try it sometime.

You might have issues with your CAN software - but using a scope (IMHO) is a very good idea.

Bob

Vaclav Zajic
Associate II
Posted on April 12, 2018 at 10:04

It finally works, the MCP2551 was dead. Vaclav