选取芯片设备ID其中三位作为网口MAC地址后三位

This commit is contained in:
王绪洁 2025-03-03 10:10:52 +08:00
parent 2b5868bfff
commit 472ebda0a7
2 changed files with 250 additions and 228 deletions

View File

@ -2,7 +2,7 @@
/**
******************************************************************************
* File Name : ethernetif.c
* Description : This file provides code for the configuration
* @file ethernetif.c
* of the ethernetif.c MiddleWare.
******************************************************************************
* @attention
@ -202,7 +202,10 @@ static void low_level_init(struct netif *netif)
heth.Init.RxBuffLen = 1536;
/* USER CODE BEGIN MACADDRESS */
MACAddr[3] = (uint8_t)HAL_GetUIDw0();
MACAddr[4] = (uint8_t)HAL_GetUIDw1();
MACAddr[5] = (uint8_t)HAL_GetUIDw2();
heth.Init.MACAddr = &MACAddr[0];
/* USER CODE END MACADDRESS */
hal_eth_init_status = HAL_ETH_Init(&heth);
@ -312,7 +315,6 @@ static void low_level_init(struct netif *netif)
/* USER CODE END PHY_POST_CONFIG */
}
}
else
{
@ -458,7 +460,6 @@ static err_t low_level_output_arp_off(struct netif *netif, struct pbuf *q, const
/* USER CODE END 5 */
return errval;
}
#endif /* LWIP_ARP */
@ -871,4 +872,3 @@ void HAL_ETH_TxFreeCallback(uint32_t * buff)
/* USER CODE BEGIN 8 */
/* USER CODE END 8 */

View File

@ -148,7 +148,24 @@
<Name>-US -O2254 -SF1800 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407VGTx$CMSIS\Flash\STM32F4xx_1024.FLM)</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Breakpoint>
<Bp>
<Number>0</Number>
<Type>0</Type>
<LineNumber>208</LineNumber>
<EnabledFlag>1</EnabledFlag>
<Address>134254976</Address>
<ByteObject>0</ByteObject>
<HtxType>0</HtxType>
<ManyObjects>0</ManyObjects>
<SizeOfObject>0</SizeOfObject>
<BreakByAccess>0</BreakByAccess>
<BreakIfRCount>1</BreakIfRCount>
<Filename>../LWIP/Target/ethernetif.c</Filename>
<ExecCommand></ExecCommand>
<Expression>\\semi_finished_product_testing\../LWIP/Target/ethernetif.c\208</Expression>
</Bp>
</Breakpoint>
<WatchWindow1>
<Ww>
<count>0</count>
@ -270,12 +287,17 @@
<WinNumber>1</WinNumber>
<ItemText>tcp_rx_data</ItemText>
</Ww>
<Ww>
<count>24</count>
<WinNumber>1</WinNumber>
<ItemText>MACAddr</ItemText>
</Ww>
</WatchWindow1>
<MemoryWindow1>
<Mm>
<WinNumber>1</WinNumber>
<SubType>0</SubType>
<ItemText>\\semi_finished_product_testing\../LWIP/Target/ethernetif.c\heth.Init.MACAddr</ItemText>
<ItemText>0x1fff7a10</ItemText>
<AccSizeX>0</AccSizeX>
</Mm>
</MemoryWindow1>