Skip to content

Commit 1720397

Browse files
authored
Merge pull request #15447 from josephduchesne/stm32g473-fdcan3-irq-crash
Fix crash when using FDCAN3 RX IRQ on STM32G473 (and others)
2 parents 13f43cc + 02b5737 commit 1720397

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

targets/TARGET_STM/can_api.c

+6
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@
2424
#include "PeripheralPins.h"
2525
#include "mbed_error.h"
2626

27+
// Some STM32G4 series (and others) have 3 FDCAN devices
28+
// while others have 2
29+
#ifdef FDCAN3
30+
static uintptr_t can_irq_contexts[3] = {0};
31+
#else
2732
static uintptr_t can_irq_contexts[2] = {0};
33+
#endif
2834
static can_irq_handler irq_handler;
2935

3036
/** Call all the init functions

0 commit comments

Comments
 (0)