[PATCH] Correct NUCLEO-H743ZI Ethernet Pins

Robin Mueller robin.mueller.m at gmail.com
Thu Apr 22 17:35:09 UTC 2021


The nucleo BSP has different pins for the Ethernet configuration.
This patch adds support for this.
 
---
 bsps/arm/stm32h7/start/stm32h7-hal-eth.c      | 18 +++++++++++++++++-
 spec/build/bsps/arm/stm32h7/grp.yml           |  2 ++
 .../bsps/arm/stm32h7/optethgpiogregs.yml      | 19 +++++++++++++++++++
 3 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 spec/build/bsps/arm/stm32h7/optethgpiogregs.yml

diff --git a/bsps/arm/stm32h7/start/stm32h7-hal-eth.c b/bsps/arm/stm32h7/start/stm32h7-hal-eth.c
index 46475f4316..0a128e4e5a 100644
--- a/bsps/arm/stm32h7/start/stm32h7-hal-eth.c
+++ b/bsps/arm/stm32h7/start/stm32h7-hal-eth.c
@@ -31,10 +31,12 @@
 
 #include <stm32h7/hal.h>
 
+#include <bspopts.h>
+
 static const stm32h7_gpio_config gpiog = {
   .regs = GPIOG,
   .config = {
-    .Pin = GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13,
+    .Pin = STM32H7_ETH_GPIOG_PINS,
     .Mode = GPIO_MODE_AF_PP,
     .Pull = GPIO_NOPULL,
     .Speed = GPIO_SPEED_FREQ_LOW,
@@ -64,6 +66,17 @@ static const stm32h7_gpio_config gpioa = {
   }
 };
 
+static const stm32h7_gpio_config gpiob = {
+  .regs = GPIOB,
+  .config = {
+    .Pin = GPIO_PIN_13,
+    .Mode = GPIO_MODE_AF_PP,
+    .Pull = GPIO_NOPULL,
+    .Speed = GPIO_SPEED_FREQ_LOW,
+    .Alternate = GPIO_AF11_ETH
+  }
+};
+
 void
 HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
 {
@@ -73,4 +86,7 @@ HAL_ETH_MspInit(ETH_HandleTypeDef *heth)
   stm32h7_gpio_init(&gpiog);
   stm32h7_gpio_init(&gpioc);
   stm32h7_gpio_init(&gpioa);
+#if RTEMS_BSP == nucleo-h743zi
+  stm32h7_gpio_init(&gpiob);
+#endif
 }
diff --git a/spec/build/bsps/arm/stm32h7/grp.yml b/spec/build/bsps/arm/stm32h7/grp.yml
index 2147cdec88..9e35cb49ac 100644
--- a/spec/build/bsps/arm/stm32h7/grp.yml
+++ b/spec/build/bsps/arm/stm32h7/grp.yml
@@ -83,6 +83,8 @@ links:
   uid: optusart3gpioregs
 - role: build-dependency
   uid: optvariant
+- role: build-dependency
+  uid: optethgpiogregs
 - role: build-dependency
   uid: ../../optconsolebaud
 - role: build-dependency
diff --git a/spec/build/bsps/arm/stm32h7/optethgpiogregs.yml b/spec/build/bsps/arm/stm32h7/optethgpiogregs.yml
new file mode 100644
index 0000000000..b76e19eb36
--- /dev/null
+++ b/spec/build/bsps/arm/stm32h7/optethgpiogregs.yml
@@ -0,0 +1,19 @@
+actions:
+- get-string: null
+- define-unquoted: null
+build-type: option
+default: ( GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13 )
+default-by-variant:
+- value: ( GPIO_PIN_2 | GPIO_PIN_11 | GPIO_PIN_13 )
+  variants:
+  - arm/nucleo-h743zi
+enabled-by: true
+format: '{}'
+links: []
+name: STM32H7_ETH_GPIOG_PINS
+description: |
+  GPIO pins used for the ETH pin configuration.
+type: build
+SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
+copyrights:
+- Copyright (C) 2021 embedded brains GmbH (http://www.embedded-brains.de)
-- 
2.25.1



More information about the devel mailing list