Skip to content

Commit 21b7bd9

Browse files
projectgusdpgeorge
authored andcommitted
stm32/fdcan: Fix extended CAN ID filtering for stm32g4.
The memory bank addresses used for these are independent, can (and must) enable both. Also looks like no need to shrink these if FDCAN2 is added, the Reference Manual is a bit unclear but looks like the peripheral's RAM multiplies out for each additional controller. Signed-off-by: Angus Gratton <[email protected]>
1 parent 3a60f32 commit 21b7bd9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ports/stm32/fdcan.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ bool can_init(pyb_can_obj_t *can_obj, uint32_t mode, uint32_t prescaler, uint32_
8686
init->DataSyncJumpWidth = 1;
8787
init->DataTimeSeg1 = 1;
8888
init->DataTimeSeg2 = 1;
89-
init->StdFiltersNbr = 28; // /2 ? if FDCAN2 is used !!?
90-
init->ExtFiltersNbr = 0; // Not used
89+
init->StdFiltersNbr = 28;
90+
init->ExtFiltersNbr = 8;
9191
init->TxFifoQueueMode = FDCAN_TX_FIFO_OPERATION;
9292
#elif defined(STM32H7)
9393
// The dedicated FDCAN RAM is 2560 32-bit words and shared between the FDCAN instances.

0 commit comments

Comments
 (0)