From 69858916c7ce291de13584fcfd2b4d4a55ccc21f Mon Sep 17 00:00:00 2001 From: millotp Date: Mon, 27 Jul 2020 14:34:10 +0200 Subject: [PATCH] boards: enable CAN bus on nucleo-f446re & nucleo-f446ze Changed the pinout for the CAN bus: CAN RX: PB8 CAN TX: PB9 And added periph_can to FEATURES_PROVIDED and to Kconfig files --- boards/nucleo-f446re/Kconfig | 1 + boards/nucleo-f446re/Makefile.features | 1 + boards/nucleo-f446ze/Kconfig | 1 + boards/nucleo-f446ze/Makefile.features | 1 + cpu/stm32/include/can_params.h | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/nucleo-f446re/Kconfig b/boards/nucleo-f446re/Kconfig index 75496672fa..569b2f51af 100644 --- a/boards/nucleo-f446re/Kconfig +++ b/boards/nucleo-f446re/Kconfig @@ -18,6 +18,7 @@ config BOARD_NUCLEO_F446RE select HAS_PERIPH_ADC select HAS_PERIPH_DMA select HAS_PERIPH_I2C + select HAS_PERIPH_CAN select HAS_PERIPH_PWM select HAS_PERIPH_RTC select HAS_PERIPH_SPI diff --git a/boards/nucleo-f446re/Makefile.features b/boards/nucleo-f446re/Makefile.features index 4a5adf60b4..da373b85b3 100644 --- a/boards/nucleo-f446re/Makefile.features +++ b/boards/nucleo-f446re/Makefile.features @@ -5,6 +5,7 @@ CPU_MODEL = stm32f446re FEATURES_PROVIDED += periph_adc FEATURES_PROVIDED += periph_dma FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_can FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_spi diff --git a/boards/nucleo-f446ze/Kconfig b/boards/nucleo-f446ze/Kconfig index 63be2b01a7..631d23d4d9 100644 --- a/boards/nucleo-f446ze/Kconfig +++ b/boards/nucleo-f446ze/Kconfig @@ -17,6 +17,7 @@ config BOARD_NUCLEO_F446ZE # Put defined MCU peripherals here (in alphabetical order) select HAS_PERIPH_DMA select HAS_PERIPH_I2C + select HAS_PERIPH_CAN select HAS_PERIPH_PWM select HAS_PERIPH_RTC select HAS_PERIPH_SPI diff --git a/boards/nucleo-f446ze/Makefile.features b/boards/nucleo-f446ze/Makefile.features index 4629889f01..5fccb4ede6 100644 --- a/boards/nucleo-f446ze/Makefile.features +++ b/boards/nucleo-f446ze/Makefile.features @@ -4,6 +4,7 @@ CPU_MODEL = stm32f446ze # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_dma FEATURES_PROVIDED += periph_i2c +FEATURES_PROVIDED += periph_can FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc FEATURES_PROVIDED += periph_spi diff --git a/cpu/stm32/include/can_params.h b/cpu/stm32/include/can_params.h index a5a927fe9e..e0f2408f14 100644 --- a/cpu/stm32/include/can_params.h +++ b/cpu/stm32/include/can_params.h @@ -51,7 +51,7 @@ static const can_conf_t candev_conf[] = { #if defined(CPU_FAM_STM32F1) .rx_pin = GPIO_PIN(PORT_A, 11), .tx_pin = GPIO_PIN(PORT_A, 12), -#elif defined(CPU_FAM_STM32L4) +#elif defined(CPU_FAM_STM32L4) || defined(CPU_FAM_STM32F4) .rx_pin = GPIO_PIN(PORT_B, 8), .tx_pin = GPIO_PIN(PORT_B, 9), .af = GPIO_AF9,