cancel
Showing results for 
Search instead for 
Did you mean: 

CAN bus not looping NUCLEO-F767zi

vFazzi
Associate

Hello!

I followed this video for CAN-bus https://www.youtube.com/watch?v=JfWlIY0zAIc&t=918s

but as simply as it looks, my configuration doesnt seem to work,

I'm working on the NUCLEO-F767zi, I started a new project with default config simply adding CAN1, no other pin configured or device added.

With the oscilloscope, I can see the CAN_TX pin toggling, but nothing received in LoopBack Mode.

I attached the main.c file and the .ioc file.

 

 

I read the discussion on this post but I cant use the same solution, not really sure why (I'm no expert in clock configuration).

Thank to whoever will give his opinion about it.

1 ACCEPTED SOLUTION

Accepted Solutions
SofLit
ST Employee

Hello @vFazzi and welcome to the community,

First, start with a pass all messages. At the moment and in your code, replace:

 

.FilterMaskIdHigh=0xFFF<<5,

 

by :

 

.FilterMaskIdHigh=0,

 

Second, set the internal pull-up on CAN_Rx pin:

SofLit_0-1730723905041.png

Hope it helps.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

View solution in original post

3 REPLIES 3
SofLit
ST Employee

Hello @vFazzi and welcome to the community,

First, start with a pass all messages. At the moment and in your code, replace:

 

.FilterMaskIdHigh=0xFFF<<5,

 

by :

 

.FilterMaskIdHigh=0,

 

Second, set the internal pull-up on CAN_Rx pin:

SofLit_0-1730723905041.png

Hope it helps.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Hello SofLit and thanks for the quick reply, it worked immediately.

 

Can you please describe the relationship between the TxHeader.StdId and the filterMaskIdHigh?

TxHeader.StdId is what you are transmitting. 

filterMaskIdHigh is a parameter of the filter. As you are in loopback mode, the trasmitted frame with TxHeader.StdId value needs to match the filter config.

and what I suggested is to set all to 0 to pass all the IDs, so you will receive all the sent message in loopback mode.

For filtering mechanism you need to refer to the reference manual of the product, section "40.7.4 Identifier filtering".

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.