cancel
Showing results for 
Search instead for 
Did you mean: 

how to use stm32f407 dual can communication(can1 & can2)

KHyun.1
Associate II

Hello.

I'm currently researching can communication with stm32f407vg

currently, i want to use can1 and can2 at the same time, but only one of them works.​

canfilter is used, and the test is currently in progress through timer interupt.​

maybe the can filter part is wrong, but i couldn't find the answer, so I want to ask for help.

thanks you for your help

0693W00000NqK9JQAV.png0693W00000NqK8gQAF.png0693W00000NqK9TQAV.png0693W00000NqK9UQAV.png

9 REPLIES 9
Andrew Neil
Evangelist III

"i want to use can1 and can2 at the same time"

Can you use each one separately?

yes

It is okey to use ​can1 and can2 separately!

So compare what's different between when you use them separately, and when you use both together.

Look for Where does it stop working ...

Instrument your code so you can see & compare what's happening in both (all 3?) cases

Javier1
Principal

>can1 and can2 at the same time

You mean with sepparated canbus transceivers?

Or are you just wiring canbus1+cabus2 to the same transceiver

we dont need to firmware by ourselves, lets talk

Good point!

People often seem to look only at the software - and forget that the hardware also needs to be right!

@KHyun.1​ - post a schematic; maybe also some photos of your setup.

Have you also checked the hardware with scope/analyser/whatever ... ?

0693W00000NqL0SQAV.pngI will share the circuit diagram

The filter banks need to be split, there are 28 slots, the lower 14 typically to CAN1 and the upper 14 to CAN2, but you can select the mid/split point.

I've previously posted working examples of dual CAN for the RedDragon F407 board, but those admittedly used the SPL, rather than HAL, as the former was in active development then.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Masking/Compare doesn't strike me as getting ANY hits.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

It is determined that the filterbank part is the problem.

There are filterbanks in can1 and can2 respectively.

Only the can that gives 0 to the filterbank value works normally.

I don't understand why..​