diff --git a/configs/stm32f4discovery/include/board.h b/configs/stm32f4discovery/include/board.h index e63a4455be..4d0720fa36 100644 --- a/configs/stm32f4discovery/include/board.h +++ b/configs/stm32f4discovery/include/board.h @@ -237,13 +237,18 @@ #define BUTTON_USER_BIT (1 << BUTTON_USER) /* Alternate function pin selections ************************************************/ -/* CAN1 */ +/* CAN */ #ifndef CONFIG_STM32_FSMC # define GPIO_CAN1_RX GPIO_CAN1_RX_3 # define GPIO_CAN1_TX GPIO_CAN1_TX_3 #endif +#ifndef CONFIG_STM32_ETHMAC +# define GPIO_CAN2_RX GPIO_CAN2_RX_1 +# define GPIO_CAN2_TX GPIO_CAN2_TX_1 +#endif + /* UART2: * * The STM32F4 Discovery has no on-board serial devices, but the console is diff --git a/configs/stm32f4discovery/src/stm32_boot.c b/configs/stm32f4discovery/src/stm32_boot.c index fd4840da2d..44c3b71188 100644 --- a/configs/stm32f4discovery/src/stm32_boot.c +++ b/configs/stm32f4discovery/src/stm32_boot.c @@ -107,6 +107,10 @@ void stm32_boardinitialize(void) #ifdef CONFIG_CANUTILS_UAVCAN (void)stm32_configgpio(GPIO_CAN1_RX); (void)stm32_configgpio(GPIO_CAN1_TX); +# if CONFIG_UAVCAN_STM32_NUM_IFACES > 1 + (void)stm32_configgpio(GPIO_CAN2_RX); + (void)stm32_configgpio(GPIO_CAN2_TX); +# endif #endif #ifdef CONFIG_ARCH_LEDS