diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig index 1561aa6b..60a30365 100644 --- a/src/stm32/Kconfig +++ b/src/stm32/Kconfig @@ -473,7 +473,7 @@ choice depends on HAVE_STM32_CANBUS && MACH_STM32F4 config STM32_CMENU_CANBUS_PB5_PB6 bool "CAN bus (on PB5/PB6)" - depends on HAVE_STM32_CANBUS && MACH_STM32F4 + depends on (HAVE_STM32_CANBUS && MACH_STM32F4) || (HAVE_STM32_FDCANBUS && MACH_STM32G0B1) config STM32_CMENU_CANBUS_PB12_PB13 bool "CAN bus (on PB12/PB13)" depends on (HAVE_STM32_CANBUS && MACH_STM32F4) || HAVE_STM32_FDCANBUS diff --git a/src/stm32/fdcan.c b/src/stm32/fdcan.c index 9198c7dc..a1624f8c 100644 --- a/src/stm32/fdcan.c +++ b/src/stm32/fdcan.c @@ -46,6 +46,10 @@ DECL_CONSTANT_STR("RESERVE_PINS_CAN", "PC2,PC3"); #define GPIO_Rx GPIO('C', 2) #define GPIO_Tx GPIO('C', 3) +#elif CONFIG_STM32_CANBUS_PB5_PB6 + DECL_CONSTANT_STR("RESERVE_PINS_CAN", "PB5,PB6"); + #define GPIO_Rx GPIO('B', 5) + #define GPIO_Tx GPIO('B', 6) #elif CONFIG_STM32_CANBUS_PB12_PB13 DECL_CONSTANT_STR("RESERVE_PINS_CAN", "PB12,PB13"); #define GPIO_Rx GPIO('B', 12) @@ -53,7 +57,7 @@ #endif #if !(CONFIG_STM32_CANBUS_PB0_PB1 || CONFIG_STM32_CANBUS_PC2_PC3 \ - || CONFIG_STM32_CANBUS_PB12_PB13) + || CONFIG_STM32_CANBUS_PB5_PB6 ||CONFIG_STM32_CANBUS_PB12_PB13) #define SOC_CAN FDCAN1 #define MSG_RAM (((struct fdcan_ram_layout*)SRAMCAN_BASE)->fdcan1) #else