Skip to main content
Visitor II
May 20, 2022
Question

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

  • May 20, 2022
  • 5 replies
  • 6048 views

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

    This topic has been closed for replies.

    5 replies

    Super User
    May 20, 2022

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

    Can you use each one separately?

    KHyun.1Author
    Visitor II
    May 20, 2022

    yes

    It is okey to use ​can1 and can2 separately!

    Super User
    May 20, 2022

    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

    Graduate II
    May 20, 2022

    >can1 and can2 at the same time

    You mean with sepparated canbus transceivers?

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

    Super User
    May 20, 2022

    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 ... ?

    KHyun.1Author
    Visitor II
    May 20, 2022

    0693W00000NqL0SQAV.pngI will share the circuit diagram

    Graduate II
    May 20, 2022

    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.

    KHyun.1Author
    Visitor II
    May 20, 2022

    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..​

    Graduate
    July 8, 2025

    Same. The master-slave filter bank. You can start any one of the CAN peripherals with any filter bank (0 or 1, etc.), it will work. The slave filter may start from anywhere, doesnt matter, it wont work. I dont understand why

    Graduate II
    May 20, 2022

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

    Visitor II
    December 11, 2024

    Sorry, please ignore my comments. I posted in the wrong thread! Have a similar one open in another tab and thought it was replies to that one. Can a moderator please delete my answers in this thread. Thanks.