Skip to content

Commit

Permalink
Merge pull request #17828 from aabadie/pr/boards/nucleo-f429zi-eth
Browse files Browse the repository at this point in the history
boards/nucleo-f429zi: add support for ethernet
  • Loading branch information
maribu authored Mar 19, 2022
2 parents 7501098 + b9b6465 commit c4c50c5
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions boards/nucleo-f429zi/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ config BOARD_NUCLEO_F429ZI
# Put defined MCU peripherals here (in alphabetical order)
select HAS_PERIPH_ADC
select HAS_PERIPH_DMA
select HAS_PERIPH_ETH
select HAS_PERIPH_I2C
select HAS_PERIPH_PWM
select HAS_PERIPH_RTC
Expand Down
4 changes: 4 additions & 0 deletions boards/nucleo-f429zi/Makefile.dep
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
ifneq (,$(filter netdev_default,$(USEMODULE)))
USEMODULE += stm32_eth
endif

include $(RIOTBOARD)/common/nucleo/Makefile.dep
1 change: 1 addition & 0 deletions boards/nucleo-f429zi/Makefile.features
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ CPU_MODEL = stm32f429zi
# Put defined MCU peripherals here (in alphabetical order)
FEATURES_PROVIDED += periph_adc
FEATURES_PROVIDED += periph_dma
FEATURES_PROVIDED += periph_eth
FEATURES_PROVIDED += periph_i2c
FEATURES_PROVIDED += periph_pwm
FEATURES_PROVIDED += periph_rtc
Expand Down
29 changes: 29 additions & 0 deletions boards/nucleo-f429zi/include/periph_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "cfg_i2c1_pb8_pb9.h"
#include "cfg_timer_tim5.h"
#include "cfg_usb_otg_fs.h"
#include "mii.h"

#ifdef __cplusplus
extern "C" {
Expand All @@ -46,10 +47,12 @@ extern "C" {
static const dma_conf_t dma_config[] = {
{ .stream = 11 }, /* DMA2 Stream 3 - SPI1_TX */
{ .stream = 10 }, /* DMA2 Stream 2 - SPI1_RX */
{ .stream = 8 }, /* DMA2 Stream 0 - ETH_TX */
};

#define DMA_0_ISR isr_dma2_stream3
#define DMA_1_ISR isr_dma2_stream2
#define DMA_2_ISR isr_dma2_stream0

#define DMA_NUMOF ARRAY_SIZE(dma_config)
/** @} */
Expand Down Expand Up @@ -193,6 +196,32 @@ static const adc_conf_t adc_config[] = {
#define ADC_NUMOF ARRAY_SIZE(adc_config)
/** @} */

/**
* @name ETH configuration
* @{
*/
static const eth_conf_t eth_config = {
.mode = RMII,
.speed = MII_BMCR_SPEED_100 | MII_BMCR_FULL_DPLX,
.dma = 2,
.dma_chan = 8,
.phy_addr = 0x00,
.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_DMA_ISR isr_dma2_stream0
/** @} */

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions dist/tools/doccheck/exclude_patterns
Original file line number Diff line number Diff line change
Expand Up @@ -14919,3 +14919,6 @@ boards/adafruit\-pybadge/include/periph_conf\.h:[0-9]+: warning: Member ADC_DEV
boards/adafruit\-pybadge/include/periph_conf\.h:[0-9]+: warning: Member ADC_NUMOF \(macro definition\) of file periph_conf\.h is not documented\.
boards/adafruit\-pybadge/include/periph_conf\.h:[0-9]+: warning: Member adc_channels\[\] \(variable\) of file periph_conf\.h is not documented\.
boards/adafruit\-pybadge/include/periph_conf\.h:[0-9]+: warning: Member sam_usbdev_config\[\] \(variable\) of file periph_conf\.h is not documented\.
boards/nucleo\-f429zi/include/periph_conf\.h:[0-9]+: warning: Member DMA_2_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/nucleo\-f429zi/include/periph_conf\.h:[0-9]+: warning: Member ETH_DMA_ISR \(macro definition\) of file periph_conf\.h is not documented\.
boards/nucleo\-f429zi/include/periph_conf\.h:[0-9]+: warning: Member eth_config \(variable\) of file periph_conf\.h is not documented\.
1 change: 1 addition & 0 deletions tests/Makefile.boards.netif
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ BOARD_PROVIDES_NETIF := \
nrf52dk \
nrf6310 \
nucleo-f207zg \
nucleo-f429zi \
nucleo-f767zi \
openlabs-kw41z-mini \
openlabs-kw41z-mini-256kib \
Expand Down

0 comments on commit c4c50c5

Please sign in to comment.