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 = {
157
157
158
158
/*
159
159
* PORTG
160
+ * PG2 - ETH_RMII_RXER
160
161
* PG11 - ETH_RMII_TXEN
161
162
* PG13 - ETH_RMII_TXD0
162
163
*/
163
- .sec_port_mask [6 ] = (1 << 11 ) | (1 << 13 ),
164
+ .sec_port_mask [6 ] = (1 << 2 ) | ( 1 << 11 ) | (1 << 13 ),
164
165
.sec_phy_type = LAN_8742_RMII ,
165
166
.sec_phy_irq = -1
166
167
};
Original file line number Diff line number Diff line change @@ -131,6 +131,42 @@ const struct stm32_hal_i2c_cfg os_bsp_i2c3_cfg = {
131
131
};
132
132
#endif
133
133
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
+
134
170
static const struct hal_bsp_mem_dump dump_cfg [] = {
135
171
[0 ] = {
136
172
.hbmd_start = _ram_start ,
Original file line number Diff line number Diff line change 31
31
#include <bsp/stm32f7xx_hal_conf.h>
32
32
#include <mcu/stm32f7_bsp.h>
33
33
#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
34
48
35
49
#include <netif/etharp.h>
36
50
#include <netif/ethernet.h>
@@ -338,10 +352,15 @@ stm32_lwip_init(struct netif *nif)
338
352
ses -> st_tx_cfg .Attributes = ETH_TX_PACKETS_FEATURES_CSUM | ETH_TX_PACKETS_FEATURES_CRCPAD ;
339
353
ses -> st_tx_cfg .ChecksumCtrl = ETH_CHECKSUM_IPHDR_PAYLOAD_INSERT_PHDR_CALC ;
340
354
ses -> st_tx_cfg .CRCPadCtrl = ETH_CRC_PAD_INSERT ;
355
+
341
356
/*
342
357
* XXX pass all multicast traffic for now
343
358
*/
359
+ #if MYNEWT_VAL (MCU_STM32H7 )
360
+ ses -> st_eth .Instance -> MACPFR |= ETH_MACPFR_PM ;
361
+ #else
344
362
ses -> st_eth .Instance -> MACFFR |= ETH_MULTICASTFRAMESFILTER_NONE ;
363
+ #endif
345
364
346
365
if (HAL_ETH_Init (& ses -> st_eth ) == HAL_ERROR ) {
347
366
return ERR_IF ;
You can’t perform that action at this time.
0 commit comments