File tree Expand file tree Collapse file tree 3 files changed +57
-1
lines changed
drivers/lwip/stm32_eth/src Expand file tree Collapse file tree 3 files changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -157,10 +157,11 @@ const struct stm32_eth_cfg os_bsp_eth0_cfg = {
157157
158158 /*
159159 * PORTG
160+ * PG2 - ETH_RMII_RXER
160161 * PG11 - ETH_RMII_TXEN
161162 * PG13 - ETH_RMII_TXD0
162163 */
163- .sec_port_mask [6 ] = (1 << 11 ) | (1 << 13 ),
164+ .sec_port_mask [6 ] = (1 << 2 ) | ( 1 << 11 ) | (1 << 13 ),
164165 .sec_phy_type = LAN_8742_RMII ,
165166 .sec_phy_irq = -1
166167};
Original file line number Diff line number Diff line change @@ -131,6 +131,42 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c3_cfg = {
131131};
132132#endif
133133
134+ #if MYNEWT_VAL (ETH_0 )
135+ const struct stm32_eth_cfg os_bsp_eth0_cfg = {
136+ /*
137+ * PORTA
138+ * PA1 - ETH_RMII_REF_CLK
139+ * PA2 - ETH_RMII_MDIO
140+ * PA7 - ETH_RMII_CRS_DV
141+ */
142+ .sec_port_mask [0 ] = (1 << 1 ) | (1 << 2 ) | (1 << 7 ),
143+
144+ /*
145+ * PORTB
146+ * PB13 - ETH_RMII_TXD1
147+ */
148+ .sec_port_mask [1 ] = (1 << 13 ),
149+
150+ /*
151+ * PORTC
152+ * PC1 - ETH_RMII_MDC
153+ * PC4 - ETH_RMII_RXD0
154+ * PC5 - ETH_RMII_RXD1
155+ */
156+ .sec_port_mask [2 ] = (1 << 1 ) | (1 << 4 ) | (1 << 5 ),
157+
158+ /*
159+ * PORTG
160+ * PG2 - ETH_RMII_RXER
161+ * PG11 - ETH_RMII_TXEN
162+ * PG13 - ETH_RMII_TXD0
163+ */
164+ .sec_port_mask [6 ] = (1 << 2 ) | (1 << 11 ) | (1 << 13 ),
165+ .sec_phy_type = LAN_8742_RMII ,
166+ .sec_phy_irq = -1
167+ };
168+ #endif
169+
134170static const struct hal_bsp_mem_dump dump_cfg [] = {
135171 [0 ] = {
136172 .hbmd_start = _ram_start ,
Original file line number Diff line number Diff line change 3131#include <bsp/stm32f7xx_hal_conf.h>
3232#include <mcu/stm32f7_bsp.h>
3333#endif
34+ #if MYNEWT_VAL (MCU_STM32H7 )
35+ #include <bsp/stm32h7xx_hal_conf.h>
36+ #include <mcu/stm32h7_bsp.h>
37+
38+ #define ETH_RX_BUF_SIZE (ETH_MAX_PACKET_SIZE)
39+ #define PHY_BSR ((uint16_t)0x0001U)
40+ #define PHY_LINKED_STATUS ((uint16_t)0x0004U)
41+
42+ #define __HAL_RCC_ETH_CLK_ENABLE () do { \
43+ __HAL_RCC_ETH1MAC_CLK_ENABLE(); \
44+ __HAL_RCC_ETH1TX_CLK_ENABLE(); \
45+ __HAL_RCC_ETH1RX_CLK_ENABLE(); \
46+ } while (0)
47+ #endif
3448
3549#include <netif/etharp.h>
3650#include <netif/ethernet.h>
@@ -338,10 +352,15 @@ stm32_lwip_init(struct netif *nif)
338352 ses -> st_tx_cfg .Attributes = ETH_TX_PACKETS_FEATURES_CSUM | ETH_TX_PACKETS_FEATURES_CRCPAD ;
339353 ses -> st_tx_cfg .ChecksumCtrl = ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC ;
340354 ses -> st_tx_cfg .CRCPadCtrl = ETH_CRC_PAD_INSERT ;
355+
341356 /*
342357 * XXX pass all multicast traffic for now
343358 */
359+ #if MYNEWT_VAL (MCU_STM32H7 )
360+ ses -> st_eth .Instance -> MACPFR |= ETH_MACPFR_PM ;
361+ #else
344362 ses -> st_eth .Instance -> MACFFR |= ETH_MULTICASTFRAMESFILTER_NONE ;
363+ #endif
345364
346365 if (HAL_ETH_Init (& ses -> st_eth ) == HAL_ERROR ) {
347366 return ERR_IF ;
You can’t perform that action at this time.
0 commit comments