STM32Cube  Version 2.0
Create Projects for STM32F7 Series with STM32Cube HAL and STM32CubeMX
 All Files Pages
CMSIS-Driver Ethernet MAC Setup

The CMSIS-Driver EMAC requires:

  • Setup of HCLK to 25MHz or higher
  • Optional setup of SYSCLK to 50MHz or higher, when Ethernet PTP is used
  • Setup of ETH in MII or RMII mode
  • Optional configuration for software controlled SMI:
    • Ethernet MDIO pin: configure arbitrary pin in GPIO_Output mode and add User Label: Ethernet_MDIO
    • Ethernet MDC pin: configure arbitrary pin in GPIO_Output mode and add User Label: Ethernet_MDC
Note
The User Label name is used to connect the CMSIS-Driver to the GPIO pin.

The example below uses correct settings for STM32F746G-Discovery:

  • ETH Mode: RMII

For different boards, refer to the hardware schematics to reflect correct setup values.

The STM32CubeMX configuration steps for Pinout, Clock, and System Configuration are listed below. Enter the values that are marked bold.

Pinout tab

  1. Configure ETH mode
    • Peripherals ETH: Mode=RMII

Clock Configuration tab

  1. Configure HCLK Clock: HCLK (MHz) = 25 or higher

Configuration tab

  1. Under Connectivity open ETH Configuration:

    • GPIO Settings: review settings, no changes required
      Pin Name Signal on Pin GPIO mode GPIO Pull-up/Pull..Maximum out User Label
      PA1 ETH_REF_CLK Alternate No pull-up and no..High .
      PA2 ETH_MDIO Alternate No pull-up and no..High .
      PA7 ETH_CRS_DV Alternate No pull-up and no..High .
      PC1 ETH_MDC Alternate No pull-up and no..High .
      PC4 ETH_RXD0 Alternate No pull-up and no..High .
      PC5 ETH_RXD1 Alternate No pull-up and no..High .
      PG11 ETH_TX_EN Alternate No pull-up and no..High .
      PG13 ETH_TXD0 Alternate No pull-up and no..High .
      PG14 ETH_TXD1 Alternate No pull-up and no..High .
    • NVIC Settings: enable interrupts
      Interrupt Table Enable Preemption Priority Sub Priority
      Ethernet global interrupt ON 0 0
    • Parameter Settings: not used
    • User Constants: not used

    Click OK to close the ETH Configuration dialog