This driver requires the STM32 device specific HAL and STM32CubeMX (CubeMX) initialization code generator. The driver instance is mapped to hardware as shown in the table below:
| CMSIS Driver Instance | STM32 Hardware Resource |
|---|---|
| Driver_ETH_MAC0 | EMAC |
This driver has the following deviations from the CMSIS-Driver specification:
Conceptual deviations:
main.c.Functional deviations:
This driver requires the following configuration in CubeMX:
Notes
- configuration information in the MX_Device.h file is based on CubeMX configuration.
- for devices with cache, ensure that ETH DMA descriptors (DMARxDscrTab and DMATxDscrTab) are located in non-cacheable and non-shareable device memory.
- for devices with cache, ensure that ETH data buffers (eth_mac0_rx_buf and eth_mac0_tx_buf) are located in non-cacheable and non-shareable normal memory.
| Pin | Functionality |
|---|---|
| PA1 | ETH_REF_CLK |
| PA2 | ETH_MDIO |
| PA7 | ETH_CRS_DV |
| PC1 | ETH_MDC |
| PC4 | ETH_RXD0 |
| PC5 | ETH_RXD1 |
| PG11 | ETH_TX_EN |
| PG12 | ETH_TXD1 |
| PG13 | ETH_TXD0 |
Under Categories: Connectivity select ETH:
Mode:
Configuration:
| General: Ethernet Configuration | Value |
|---|---|
| Ethernet MAC Address | unused |
| Tx Descriptor Length | 4 |
| First Tx Descriptor Address | 0x30040060 |
| Rx Descriptor Length | 4 |
| First Rx Descriptor Address | 0x30040000 |
| Rx Buffers Length | 1524 |
| Pin Name | Signal on Pin | Pin Context.. | GPIO output.. | GPIO mode | GPIO Pull-up/Pull.. | Maximum out.. | Fast Mode | User Label |
|---|---|---|---|---|---|---|---|---|
| PA1 | ETH_REF_CLK | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PA2 | ETH_MDIO | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PA7 | ETH_CRS_DV | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PC1 | ETH_MDC | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PC4 | ETH_RXD0 | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PC5 | ETH_RXD1 | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PG11 | ETH_TX_EN | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PG12 | ETH_TXD1 | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
| PG13 | ETH_TXD0 | n/a | n/a | Alternate Function Push Pull | No pull-up and no.. | High | n/a | . |
Under Categories: System Core select NVIC:
Configuration:
| NVIC Interrupt Table | Enabled | Preemption Priority | Sub Priority |
|---|---|---|---|
| Ethernet global interrupt | checked | 0 | 0 |
| Enabled interrupt table | Select for.. | Generate Enable in.. | Generate IRQ h.. | Call HAL handler |
|---|---|---|---|---|
| Ethernet global interrupt | unchecked | checked | checked | checked |
Under Categories: System Core select CORTEX_M7:
Configuration:
| Speculation default mode Settings | Value |
|---|---|
| Speculation default mode | Disabled |
| Cortex Interface Settings | Value |
|---|---|
| CPU ICache | Enabled |
| CPU DCache Length | Enabled |
| Cortex Memory Protection Unit Control Settings | Value |
|---|---|
| MPU Control Mode | Background Region Privileged accesses only + MPU disabled during hard fault |
| Cortex Memory Protection Unit Region 0 Settings | Value |
|---|---|
| MPU Region | Enabled |
| MPU Region Base Address | 0x24000000 |
| MPU Region Size | 512kB |
| MPU SubRegion Disable | 0x0 |
| MPU TEX field level | level 1 |
| MPU Access Permission | ALL ACCESS PERMITTED |
| MPU Instruction Access | DISABLE |
| MPU Shareability Permission | DISABLE |
| MPU Cacheable Permission | ENABLE |
| MPU Bufferable Permission | ENABLE |
| Cortex Memory Protection Unit Region 1 Settings | Value |
|---|---|
| MPU Region | Enabled |
| MPU Region Base Address | 0x30000000 |
| MPU Region Size | 512kB |
| MPU SubRegion Disable | 0x0 |
| MPU TEX field level | level 1 |
| MPU Access Permission | ALL ACCESS PERMITTED |
| MPU Instruction Access | DISABLE |
| MPU Shareability Permission | DISABLE |
| MPU Cacheable Permission | DISABLE |
| MPU Bufferable Permission | DISABLE |
| Cortex Memory Protection Unit Region 2 Settings | Value |
|---|---|
| MPU Region | Enabled |
| MPU Region Base Address | 0x30040000 |
| MPU Region Size | 256B |
| MPU SubRegion Disable | 0x0 |
| MPU TEX field level | level 0 |
| MPU Access Permission | ALL ACCESS PERMITTED |
| MPU Instruction Access | DISABLE |
| MPU Shareability Permission | DISABLE |
| MPU Cacheable Permission | DISABLE |
| MPU Bufferable Permission | DISABLE |
Under Advanced Settings:
Generated Function Calls:
| Generate Code | Function Name | Peripheral Inst.. | Do not generate .. | Visibility (Static) |
|---|---|---|---|---|
| checked | MX_ETH_Init | ETH | unchecked | checked |
Add RxDecripSection, TxDecripSection, .driver.eth_mac0_rx_buf and .driver.eth_mac0_tx_buf sections to the Scatter file if GNU Compiler or Arm Compiler 6 is used.
Example: