Skip to content

Commit cc913eb

Browse files
author
fpr
committed
Enables HAL Ethernet module.
Changes PHY configuration to match with the good one. Signed-off-by: fpr <[email protected]>
1 parent 1414e47 commit cc913eb

File tree

1 file changed

+11
-16
lines changed

1 file changed

+11
-16
lines changed

Diff for: variants/NUCLEO_F429ZI/stm32f4xx_hal_conf.h

+11-16
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
// #define HAL_DCMI_MODULE_ENABLED
6363
#define HAL_DMA_MODULE_ENABLED
6464
// #define HAL_DMA2D_MODULE_ENABLED
65-
// #define HAL_ETH_MODULE_ENABLED
65+
#define HAL_ETH_MODULE_ENABLED
6666
#define HAL_FLASH_MODULE_ENABLED
6767
// #define HAL_NAND_MODULE_ENABLED
6868
// #define HAL_NOR_MODULE_ENABLED
@@ -186,13 +186,12 @@
186186
/* Definition of the Ethernet driver buffers size and count */
187187
#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
188188
#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
189-
#define ETH_RXBUFNB 4U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
190-
#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
189+
#define ETH_RXBUFNB (5U) /* 5 Rx buffers of size ETH_RX_BUF_SIZE */
190+
#define ETH_TXBUFNB (5U) /* 5 Tx buffers of size ETH_TX_BUF_SIZE */
191191

192192
/* Section 2: PHY configuration section */
193-
194-
/* DP83848 PHY Address*/
195-
#define DP83848_PHY_ADDRESS 0x01U
193+
/* LAN8742A PHY Address*/
194+
#define LAN8742A_PHY_ADDRESS 0x00U
196195
/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
197196
#define PHY_RESET_DELAY 0x000000FFU
198197
/* PHY Configuration delay */
@@ -223,19 +222,15 @@
223222

224223
/* Section 4: Extended PHY Registers */
225224

226-
#define PHY_SR ((uint16_t)0x0010) /*!< PHY status register Offset */
227-
#define PHY_MICR ((uint16_t)0x0011) /*!< MII Interrupt Control Register */
228-
#define PHY_MISR ((uint16_t)0x0012) /*!< MII Interrupt Status and Misc. Control Register */
225+
#define PHY_SR ((uint16_t)0x1F) /*!< PHY special control/ status register Offset */
229226

230-
#define PHY_LINK_STATUS ((uint16_t)0x0001) /*!< PHY Link mask */
231-
#define PHY_SPEED_STATUS ((uint16_t)0x0002) /*!< PHY Speed mask */
232-
#define PHY_DUPLEX_STATUS ((uint16_t)0x0004) /*!< PHY Duplex mask */
227+
#define PHY_SPEED_STATUS ((uint16_t)0x0004) /*!< PHY Speed mask */
228+
#define PHY_DUPLEX_STATUS ((uint16_t)0x0010) /*!< PHY Duplex mask */
233229

234-
#define PHY_MICR_INT_EN ((uint16_t)0x0002) /*!< PHY Enable interrupts */
235-
#define PHY_MICR_INT_OE ((uint16_t)0x0001) /*!< PHY Enable output interrupt events */
236230

237-
#define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /*!< Enable Interrupt on change of link status */
238-
#define PHY_LINK_INTERRUPT ((uint16_t)0x2000) /*!< PHY link status interrupt mask */
231+
#define PHY_ISFR ((uint16_t)0x1D) /*!< PHY Interrupt Source Flag register Offset */
232+
#define PHY_IMR ((uint16_t)0x1E) /*!< PHY Interrupt Mask register Offset */
233+
#define PHY_ISFR_INT4 ((uint16_t)0x0010) /*!< PHY Link down inturrupt */
239234

240235
/* ################## SPI peripheral configuration ########################## */
241236

0 commit comments

Comments
 (0)