diff --git a/boards/nucleo-f207zg/Makefile.dep b/boards/nucleo-f207zg/Makefile.dep index 7294858272..b610f47b8e 100644 --- a/boards/nucleo-f207zg/Makefile.dep +++ b/boards/nucleo-f207zg/Makefile.dep @@ -1 +1,5 @@ +ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE))) + USEMODULE += stm32_eth +endif + include $(RIOTBOARD)/common/nucleo/Makefile.dep diff --git a/boards/nucleo-f207zg/Makefile.features b/boards/nucleo-f207zg/Makefile.features index 476f08f415..5d64a5ac77 100644 --- a/boards/nucleo-f207zg/Makefile.features +++ b/boards/nucleo-f207zg/Makefile.features @@ -3,6 +3,7 @@ CPU_MODEL = stm32f207zg # Put defined MCU peripherals here (in alphabetical order) FEATURES_PROVIDED += periph_dma +FEATURES_PROVIDED += periph_eth FEATURES_PROVIDED += periph_i2c FEATURES_PROVIDED += periph_pwm FEATURES_PROVIDED += periph_rtc diff --git a/boards/nucleo-f207zg/include/periph_conf.h b/boards/nucleo-f207zg/include/periph_conf.h index 3bdc1a4895..a1f39e0594 100644 --- a/boards/nucleo-f207zg/include/periph_conf.h +++ b/boards/nucleo-f207zg/include/periph_conf.h @@ -41,6 +41,7 @@ static const dma_conf_t dma_config[] = { { .stream = 4 }, /* DMA1 Stream 4 - SPI2_TX */ { .stream = 14 }, /* DMA2 Stream 6 - USART6_TX */ { .stream = 6 }, /* DMA1 Stream 6 - USART2_TX */ + { .stream = 8 }, /* DMA2 Stream 0 - ETH_TX */ }; #define DMA_0_ISR isr_dma2_stream2 @@ -49,6 +50,7 @@ static const dma_conf_t dma_config[] = { #define DMA_3_ISR isr_dma1_stream4 #define DMA_4_ISR isr_dma2_stream6 #define DMA_5_ISR isr_dma1_stream6 +#define DMA_6_ISR isr_dma2_stream0 #define DMA_NUMOF ARRAY_SIZE(dma_config) #endif @@ -249,6 +251,40 @@ static const spi_conf_t spi_config[] = { #define ADC_NUMOF (2) /** @} */ +/** + * @name ETH configuration + * @{ + */ +static const eth_conf_t eth_config = { + .mode = RMII, + .mac = { 0 }, + .speed = ETH_SPEED_100TX_FD, + .dma = 6, + .dma_chan = 8, + .phy_addr = 0x01, + .pins = { + GPIO_PIN(PORT_G, 13), + GPIO_PIN(PORT_B, 13), + GPIO_PIN(PORT_G, 11), + GPIO_PIN(PORT_C, 4), + GPIO_PIN(PORT_C, 5), + GPIO_PIN(PORT_A, 7), + GPIO_PIN(PORT_C, 1), + GPIO_PIN(PORT_A, 2), + GPIO_PIN(PORT_A, 1), + } +}; + +#define ETH_RX_BUFFER_COUNT (4) +#define ETH_TX_BUFFER_COUNT (4) + +#define ETH_RX_BUFFER_SIZE (1524) +#define ETH_TX_BUFFER_SIZE (1524) + +#define ETH_DMA_ISR isr_dma2_stream0 + +/** @} */ + #ifdef __cplusplus } #endif diff --git a/examples/default/Makefile b/examples/default/Makefile index 11bd9e1e05..10a712c63a 100644 --- a/examples/default/Makefile +++ b/examples/default/Makefile @@ -37,8 +37,8 @@ USEMODULE += saul_default BOARD_PROVIDES_NETIF := acd52832 airfy-beacon atmega256rfr2-xpro avr-rss2 b-l072z-lrwan1 cc2538dk fox \ hamilton iotlab-m3 iotlab-a8-m3 lobaro-lorabox lsn50 mulle microbit msba2 \ microduino-corerf native nrf51dk nrf51dongle nrf52dk nrf52840dk nrf52840-mdk nrf6310 \ - nucleo-f767zi openmote-b openmote-cc2538 pba-d-01-kw2x remote-pa remote-reva \ - ruuvitag samr21-xpro samr30-xpro spark-core telosb thingy52 yunjia-nrf51822 z1 + nucleo-f207zg nucleo-f767zi openmote-b openmote-cc2538 pba-d-01-kw2x remote-pa \ + remote-reva ruuvitag samr21-xpro samr30-xpro spark-core telosb thingy52 yunjia-nrf51822 z1 ifneq (,$(filter $(BOARD),$(BOARD_PROVIDES_NETIF))) # Use modules for networking