{"id":22614,"date":"2025-04-19T06:12:57","date_gmt":"2025-04-18T22:12:57","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/22614.html"},"modified":"2025-04-19T06:12:57","modified_gmt":"2025-04-18T22:12:57","slug":"stm32h7%e9%80%9a%e8%bf%87cubemx%e5%88%9d%e5%a7%8b%e5%8c%96%e7%a7%bb%e6%a4%8dlwip%ef%bc%8cdhcp%e5%bb%ba%e7%ab%8braw-tcp%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%8c%e4%b8%8d%e5%81%9c%e5%8f%91%e6%88%90%e5%8a%9f","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/22614.html","title":{"rendered":"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f"},"content":{"rendered":"<h2 style=\"margin-left:0;text-align:justify\"><\/h2>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5728H743\u548cH723\u6d4b\u8bd5\u6210\u529f\u3002<\/span><\/p>\n<h2 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">1\u3001\u9488\u5bf9H743\u7684MPU\u914d\u7f6e<\/span><\/h2>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">MPU_InitStruct.Enable &#061; MPU_REGION_ENABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30040000;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_256B;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.SubRegionDisable &#061; 0x0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.TypeExtField &#061; MPU_TEX_LEVEL0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.AccessPermission &#061; MPU_REGION_FULL_ACCESS;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.DisableExec &#061; MPU_INSTRUCTION_ACCESS_ENABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsShareable &#061; MPU_ACCESS_NOT_SHAREABLE;\/\/\u00a0 MPU_ACCESS_SHAREABLE<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsCacheable &#061; MPU_ACCESS_NOT_CACHEABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_BUFFERABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 HAL_MPU_ConfigRegion(&amp;MPU_InitStruct);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 \/** Initializes and configures the Region and the memory to be protected<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER1;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30044000;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_16KB;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.TypeExtField &#061; MPU_TEX_LEVEL1;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_NOT_BUFFERABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\">\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">TX Descriptor\u00a0\u00a0 length 4<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">First TX Descriptor address 0x3004 0080<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\">\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">RX Descriptor length 4<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">First RX Descriptor address 0x3004 0000<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\">\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">Rx\u00a0\u00a0 Buffers Address 0x3004 0100<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">Rx Buffers length 1536<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:0;text-align:justify\">\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:346.5pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">LWIP RAM HEAP\u00a0\u00a0 POINTER (RAM Heap Pointer) 0x3004 4000<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:346.5pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">MEM SIZE (Heap Memory Size) 14336 Byte(s)<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">#define TCP_MSS 1460<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\">\n<h2 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">2\u3001\u9488\u5bf9H723\u7684\u521d\u59cb\u5316\u914d\u7f6e<\/span><\/h2>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">MPU_InitStruct.Enable &#061; MPU_REGION_ENABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER1;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30000000;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_256B;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.SubRegionDisable &#061; 0x0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.TypeExtField &#061; MPU_TEX_LEVEL0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.AccessPermission &#061; MPU_REGION_FULL_ACCESS;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.DisableExec &#061; MPU_INSTRUCTION_ACCESS_ENABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsShareable &#061; MPU_ACCESS_SHAREABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsCacheable &#061; MPU_ACCESS_NOT_CACHEABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_BUFFERABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\/\/MPU_ACCESS_NOT_BUFFERABLE<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 HAL_MPU_ConfigRegion(&amp;MPU_InitStruct);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 \/** Initializes and configures the Region and the memory to be protected<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30004000;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_16KB;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsCacheable &#061; MPU_ACCESS_CACHEABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_NOT_BUFFERABLE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 HAL_MPU_ConfigRegion(&amp;MPU_InitStruct);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 \/* Enables the MPU *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\">\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">TX Descriptor\u00a0\u00a0 length 4<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">First TX Descriptor address 0x3000 0080<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\">\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">RX Descriptor length 4<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">First RX Descriptor address 0x3000 0000<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\">\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">Rx\u00a0\u00a0 Buffers Address 0x3000 0100<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:276.75pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">Rx Buffers length 1536<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:0;text-align:justify\">\n<table border=\"1\" cellspacing=\"0\">\n<tbody>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:346.5pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">LWIP RAM HEAP\u00a0\u00a0 POINTER (RAM Heap Pointer) 0x3000 4000<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"border-color:#000000;vertical-align:bottom;width:346.5pt\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">MEM SIZE (Heap Memory Size) 14336 Byte(s)<\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">#define TCP_MSS 1460<\/span><\/p>\n<h2 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">3\u3001\u5b9e\u73b0\u8fc7\u7a0b<\/span><\/h2>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u4e2d\u95f4\u8d70\u4e86\u5f88\u591a\u5f2f\u8def&#xff0c;\u786e\u5b9e\u4e0d\u5bb9\u6613&#xff0c;\u770b\u4e86\u6b63\u70b9\u539f\u5b50\u7684\u601d\u8def\u7ed9\u4e86\u542f\u53d1\u3002<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u529f\u80fd\u5b9e\u73b0\u6b65\u9aa4&#xff1a;\u5148\u521d\u59cb\u5316\u5185\u6838&#xff0c;\u67e5\u770b\u7f51\u7ebf\u8fde\u63a5\u72b6\u6001&#xff0c;\u63a5\u7740DHCP\u83b7\u53d6IP\u5730\u5740,\u63a5\u7740\u5efa\u7acbpcb&#xff0c;\u7ed1\u5b9a&#xff0c;\u76d1\u542c\u3002\u5bf9\u5ba2\u6237\u7aef&#xff08;\u5373\u4e0a\u4f4d\u673a&#xff09;\u53d1\u9001\u6570\u636e\u3002<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">3.1\u6b63\u70b9\u539f\u5b50\u7684\u4ee3\u7801\u903b\u8f91<\/span><\/h3>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">lwip_comm_init()\/\/lwIP\u521d\u59cb\u5316(lwIP\u542f\u52a8\u7684\u65f6\u5019\u4f7f\u7528)<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5305\u542b\u4ee5\u4e0b\u51fd\u6570&#xff1a;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">{<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">ethernet_init(); \u00a0\/* \u521d\u59cb\u5316\u4ee5\u592a\u7f51IO *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">lwip_init();\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u521d\u59cb\u5316LWIP\u5185\u6838 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netif_set_default(&amp;g_lwip_netif);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u8bbe\u7f6enetif\u4e3a\u9ed8\u8ba4\u7f51\u53e3 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lwip_link_status_updated(&amp;g_lwip_netif);\u00a0\u00a0\u00a0 \/* DHCP\u94fe\u63a5\u72b6\u6001\u66f4\u65b0\u51fd\u6570 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 netif_set_link_callback(&amp;g_lwip_netif, lwip_link_status_updated); \/\/DHCP\u94fe\u63a5\u72b6\u6001\u66f4\u65b0\u7684\u56de\u8c03\u51fd\u6570<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">#if LWIP_DHCP\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5982\u679c\u4f7f\u7528DHCP\u7684\u8bdd *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 g_lwipdev.dhcpstatus &#061; 0;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* DHCP\u72b6\u6001\u6807\u8bb0\u4e3a0 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">}<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">dhcp_supplied_address(netif)) \/\/\u83b7\u53d6IP\u5730\u5740\u540e&#xff0c;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">g_lwipdev.dhcpstatus &#061; 2;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* DHCP\u72b6\u6001\u6807\u8bb0\u4e3a2 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5f00\u59cb\u5faa\u73af\u8c03\u7528&#xff0c;\u53ea\u8981DHCP\u662f\u8fde\u63a5\u4e0a\u7684\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">while{<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">lwip_pkt_handle();\u5305\u542b\u4e00\u4e2a\u51fd\u6570 ethernetif_input(&amp;g_lwip_netif);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\/* \u4ece\u7f51\u7edc\u7f13\u51b2\u533a\u4e2d\u8bfb\u53d6\u63a5\u6536\u5230\u7684\u6570\u636e\u5305\u5e76\u5c06\u5176\u53d1\u9001\u7ed9LWIP\u5904\u7406 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0 Ethernet_Link_Periodic_Handle()\u5305\u542b\u4e00\u4e2a\u51fd\u6570<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0sys_check_timeouts();<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5468\u671f\u6027\u68c0\u6d4b\u7f51\u7ebf\u8fde\u63a5\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">}<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u63a5\u7740lwip_demo(void)<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5305\u542b\u4e0b\u9762\u51fd\u6570<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0struct tcp_pcb *tcppcbnew;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5b9a\u4e49\u4e00\u4e2aTCP\u670d\u52a1\u5668\u63a7\u5236\u5757 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 struct tcp_pcb *tcppcbconn;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5b9a\u4e49\u4e00\u4e2aTCP\u670d\u52a1\u5668\u63a7\u5236\u5757 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0 tcppcbnew &#061; tcp_new();\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u521b\u5efa\u4e00\u4e2a\u65b0\u7684pcb *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 if (tcppcbnew)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u521b\u5efa\u6210\u529f *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 {<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 err &#061; tcp_bind(tcppcbnew, IP_ADDR_ANY, LWIP_DEMO_PORT); \/* \u5c06\u672c\u5730IP\u4e0e\u6307\u5b9a\u7684\u7aef\u53e3\u53f7\u7ed1\u5b9a\u5728\u4e00\u8d77,IP_ADDR_ANY\u4e3a\u7ed1\u5b9a\u672c\u5730\u6240\u6709\u7684IP\u5730\u5740 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if (err &#061;&#061; ERR_OK)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u7ed1\u5b9a\u5b8c\u6210 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcppcbconn &#061; tcp_listen(tcppcbnew);\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u8bbe\u7f6etcppcb\u8fdb\u5165\u76d1\u542c\u72b6\u6001 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_accept(tcppcbconn, lwip_tcp_server_accept);\u00a0\u00a0\u00a0\u00a0 \/* \u521d\u59cb\u5316LWIP\u7684tcp_accept\u7684\u56de\u8c03\u51fd\u6570 *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else res &#061; 1;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 else res &#061; 1;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 g_point_color &#061; BLUE;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 while (res &#061;&#061; 0)<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">3.2\u5bf9\u6bd4\u4e0bstm32cubemx\u751f\u6210\u7684\u4ee3\u7801\u3002<\/span><\/h3>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">MX_LWIP_Init(void)<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">{<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0 lwip_init();\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/lwip\u5185\u6838\u521d\u59cb\u5316<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 ipaddr.addr &#061; 0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netmask.addr &#061; 0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 gw.addr &#061; 0;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netif_add(&amp;gnetif, &amp;ipaddr, &amp;netmask, &amp;gw, NULL, &amp;ethernetif_init, &amp;ethernet_input);\/\/\u6dfb\u52a0\u7f51\u5361<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netif_set_default(&amp;gnetif); \/\/\u8bbe\u7f6e\u9ed8\u8ba4\u7f51\u5361<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netif_set_up(&amp;gnetif);\/\/<span style=\"background-color:#FFFFFF\"><span style=\"color:#666666\">\u542f\u52a8\u4e00\u4e2a\u7f51\u7edc\u63a5\u53e3&#xff0c;\u5e76\u4f7f\u5176\u53ef\u4ee5\u5904\u7406\u7f51\u7edc\u6570\u636e\u5305\u3002<\/span><\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 netif_set_link_callback(&amp;gnetif, ethernet_link_status_updated);\/\/\u7f51\u5361\u8fde\u63a5\u56de\u8c03\u51fd\u6570<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 dhcp_start(&amp;gnetif);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">}<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u8fd9\u91cc\u6211\u53d1\u73b0\u56de\u8c03\u51fd\u6570\u66f4\u65b0IP\u5730\u5740\u5f88\u6162&#xff0c;\u6240\u4ee5\u6dfb\u52a0\u4e00\u4e2awhile\u5faa\u73af\u3002\u7528\u6765\u5224\u5b9aIP\u5730\u5740\u66f4\u65b0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0 {<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ethernetif_input(&amp;gnetif);<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/sys_check_timeouts();<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">MX_LWIP_Process();<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0 }<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6700\u540e\u770b\u4e0b&#xff0c;MX_LWIP_Process\u5305\u542b<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">void MX_LWIP_Process(void)<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">{<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 ethernetif_input(&amp;gnetif);\u00a0 \/\/\u63a5\u6536\u6570\u636e<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 \/* Handle timeouts *\/<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 sys_check_timeouts();\/\/time\u8868\u793a\u5f53\u524d\u5b9a\u65f6\u4e8b\u4ef6\u6210\u4e3a\u94fe\u8868\u7b2c\u4e00\u4e2a\u8282\u70b9\u540e&#xff0c;\u5b83\u8fd8\u9700\u8981\u7b49\u5f85\u591a\u4e45&#xff08;\u6beb\u79d2&#xff09;\u624d\u4f1a\u88ab\u6267\u884c<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0 Ethernet_Link_Periodic_Handle(&amp;gnetif);\/\/\u5468\u671f\u6027\u68c0\u67e5\u7f51\u7ebf\u8fde\u63a5\u72b6\u6001<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">}<\/span><\/p>\n<h2 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">4\u3001\u5b8c\u6574\u4ee3\u7801<\/span><\/h2>\n<p>main.c<\/p>\n<p>\/* USER CODE BEGIN Header *\/<\/p>\n<p>\/**<\/p>\n<p>\u00a0 ******************************************************************************<\/p>\n<p>\u00a0 * &#064;file\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : main.c<\/p>\n<p>\u00a0 * &#064;brief\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 : Main program body<\/p>\n<p>\u00a0 ******************************************************************************<\/p>\n<p>\u00a0 * &#064;attention<\/p>\n<p>\u00a0 *<\/p>\n<p>\u00a0 * Copyright (c) 2025 STMicroelectronics.<\/p>\n<p>\u00a0 * All rights reserved.<\/p>\n<p>\u00a0 *<\/p>\n<p>\u00a0 * This software is licensed under terms that can be found in the LICENSE file<\/p>\n<p>\u00a0 * in the root directory of this software component.<\/p>\n<p>\u00a0 * If no LICENSE file comes with this software, it is provided AS-IS.<\/p>\n<p>\u00a0 *<\/p>\n<p>\u00a0 ******************************************************************************<\/p>\n<p>\u00a0 *\/<\/p>\n<p>\/* USER CODE END Header *\/<\/p>\n<p>\/* Includes &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>#include &#034;main.h&#034;<\/p>\n<p>#include &#034;lwip.h&#034;<\/p>\n<p>#include &#034;memorymap.h&#034;<\/p>\n<p>#include &#034;usart.h&#034;<\/p>\n<p>#include &#034;gpio.h&#034;<\/p>\n<p>\/* Private includes &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*\/<\/p>\n<p>\/* USER CODE BEGIN Includes *\/<\/p>\n<p>#include &#034;stdio.h&#034;<\/p>\n<p>#include &#034;lwip\/tcp.h&#034;<\/p>\n<p>#include &#034;string.h&#034;<\/p>\n<p>\/* USER CODE END Includes *\/<\/p>\n<p>\/* Private typedef &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*\/<\/p>\n<p>\/* USER CODE BEGIN PTD *\/<\/p>\n<p>uint32_t num;<\/p>\n<p>uint8_t newipaddress[4];<\/p>\n<p>err_t status_server, status_new;<\/p>\n<p>\/* USER CODE END PV *\/<\/p>\n<p>char rxbuff[2048];<\/p>\n<p>uint32_t address &#061; 0;<\/p>\n<p>uint32_t rx_flag &#061; 0;<\/p>\n<p>uint32_t count &#061; 0;<\/p>\n<p>char sendbuffer[] &#061; &#034;20250106hel20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/p>\n<p>\/\/char sendbuffer[] &#061; &#034;20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/p>\n<p>\/\/char sendbuffer[] &#061; &#034;20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/p>\n<p>\/\/char sendbuffer[] &#061; &#034;20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/p>\n<p>\/* Private macro &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*\/<\/p>\n<p>\/* USER CODE BEGIN PM *\/<\/p>\n<p>extern struct netif gnetif;<\/p>\n<p>struct tcp_pcb *tcp_server_pcb;\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5b9a\u4e49\u4e00\u4e2aTCP\u670d\u52a1\u5668\u63a7\u5236\u5757 *\/<\/p>\n<p>struct tcp_pcb *tcppcbnew;\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5b9a\u4e49\u4e00\u4e2aTCP\u670d\u52a1\u5668\u63a7\u5236\u5757 *\/<\/p>\n<p>\/* Private function prototypes &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*\/<\/p>\n<p>void SystemClock_Config(void);<\/p>\n<p>static void MPU_Config(void);<\/p>\n<p>int new_flag &#061; 1;<\/p>\n<p>\/* USER CODE BEGIN PFP *\/<\/p>\n<p>\/* USER CODE END PFP *\/<\/p>\n<p>\/* Private user code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\/* USER CODE BEGIN 0 *\/<\/p>\n<p>int fputc(int c, FILE *stream)\u00a0\u00a0\u00a0 \/\/\u91cd\u5199fputc\u51fd\u6570<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 \/*<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 huart1\u662f\u5de5\u5177\u751f\u6210\u4ee3\u7801\u5b9a\u4e49\u7684UART1\u7ed3\u6784\u4f53&#xff0c;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u5982\u679c\u4ee5\u540e\u8981\u4f7f\u7528\u5176\u4ed6\u4e32\u53e3\u6253\u5370&#xff0c;\u53ea\u9700\u8981\u628a\u8fd9\u4e2a\u7ed3\u6784\u4f53\u6539\u6210\u5176\u4ed6UART\u7ed3\u6784\u4f53\u3002<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_UART_Transmit(&amp;huart1, (unsigned char *)&amp;c, 1, 1000);<\/p>\n<p>\u00a0\u00a0\u00a0 return 1;<\/p>\n<p>}<\/p>\n<p>\/* USER CODE END PTD *\/<\/p>\n<p>static err_t TCPServerCallback(void *arg, struct tcp_pcb *pcb, struct pbuf *tcp_recv_pbuf, err_t err)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 struct pbuf *tcp_send_pbuf;<\/p>\n<p>\/\/\u00a0\u00a0\u00a0 char echoString[]&#061;&#034;This is the client content echo:\\\\r\\\\n&#034;;<\/p>\n<p>\u00a0\u00a0\u00a0 char echoString[] &#061; &#034;9999\\\\r\\\\n&#034;;<\/p>\n<p>\u00a0\u00a0\u00a0 rx_flag &#061; 1;<\/p>\n<p>\u00a0\u00a0\u00a0 if (tcp_recv_pbuf !&#061; NULL)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u66f4\u65b0\u63a5\u6536\u7a97\u53e3 *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_recved(pcb, tcp_recv_pbuf-&gt;tot_len);<\/p>\n<p>\/\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0 \/* \u5c06\u63a5\u6536\u7684\u6570\u636e\u62f7\u8d1d\u7ed9\u53d1\u9001\u7ed3\u6784\u4f53 *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_send_pbuf &#061; tcp_recv_pbuf;<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 address&#061;&amp;rxbuff;<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 memcpy(rxbuff, tcp_recv_pbuf-&gt;payload, 100);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status &#061; tcp_write(pcb, echoString, strlen(echoString), 1);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 count &#061; tcp_sndbuf(pcb); \/\/\u67e5\u8be2\u5269\u4f59buf\u5927\u5c0f<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;before payload buffer is %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;before payload status is\u00a0 %d\\\\r\\\\n&#034;, status);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034; payload length\u00a0 is\u00a0 %d\\\\r\\\\n&#034;, tcp_send_pbuf-&gt;len);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u5c06\u63a5\u6536\u5230\u7684\u6570\u636e\u518d\u8f6c\u53d1\u51fa\u53bb *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status_server &#061; tcp_write(pcb, tcp_send_pbuf-&gt;payload, tcp_send_pbuf-&gt;len, 1);<\/p>\n<p>\/\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 count &#061; tcp_sndbuf(pcb); \/\/\u67e5\u8be2\u5269\u4f59buf\u5927\u5c0f<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;after payload buffer is\u00a0 %d\\\\r\\\\n&#034;, status);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rx_flag &#061; 1;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;after payload buffer is %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 pbuf_free(tcp_recv_pbuf);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_close(pcb);<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\/\/\u00a0\u00a0 else if (err &#061;&#061; ERR_OK)<\/p>\n<p>\/\/\u00a0\u00a0 {<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0 return tcp_close(pcb);<\/p>\n<p>\/\/\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 return ERR_OK;<\/p>\n<p>}<\/p>\n<p>static err_t TCPServerAccept(void *arg, struct tcp_pcb *pcb, err_t err)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 \/* \u786e\u8ba4\u76d1\u542c\u4e0e\u8fde\u63a5 *\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0 tcp_arg(pcb, mem_calloc(sizeof(struct name), 1));<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u53d1\u9001\u4e00\u4e2a\u5efa\u7acb\u8fde\u63a5\u7684\u5b57\u7b26\u4e32 *\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_write(pcb, &#034;hello my dream \\\\n\\\\r&#034;,strlen(&#034;hello my dream \\\\n\\\\r\u00a0 &#034;)-2,1);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u914d\u7f6e\u63a5\u6536\u56de\u8c03\u51fd\u6570 *\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_recv(pcb, tcp_server_recv);<\/p>\n<p>\u00a0\u00a0\u00a0 tcp_recv(pcb, TCPServerCallback);<\/p>\n<p>\u00a0\u00a0\u00a0 return ERR_OK;<\/p>\n<p>}<\/p>\n<p>\/* Private define &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\/* USER CODE BEGIN PD *\/<\/p>\n<p>\/* USER CODE END PD *\/<\/p>\n<p>\/* Private macro &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-*\/<\/p>\n<p>\/* USER CODE BEGIN PM *\/<\/p>\n<p>\/* USER CODE END PM *\/<\/p>\n<p>\/* Private variables &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\/* USER CODE BEGIN PV *\/<\/p>\n<p>\/* USER CODE END PV *\/<\/p>\n<p>\/* Private function prototypes &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*\/<\/p>\n<p>void SystemClock_Config(void);<\/p>\n<p>static void MPU_Config(void);<\/p>\n<p>\/* USER CODE BEGIN PFP *\/<\/p>\n<p>\/* USER CODE END PFP *\/<\/p>\n<p>\/* Private user code &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\/* USER CODE BEGIN 0 *\/<\/p>\n<p>\/* USER CODE END 0 *\/<\/p>\n<p>\/**<\/p>\n<p>\u00a0 * &#064;brief\u00a0 The application entry point.<\/p>\n<p>\u00a0 * &#064;retval int<\/p>\n<p>\u00a0 *\/<\/p>\n<p>int main(void)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN 1 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END 1 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* MPU Configuration&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*\/<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_Config();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Enable the CPU Cache *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Enable I-Cache&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\u00a0\u00a0\u00a0 SCB_EnableICache();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Enable D-Cache&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;*\/<\/p>\n<p>\u00a0\u00a0\u00a0 SCB_EnableDCache();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* MCU Configuration&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;*\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Reset of all peripherals, Initializes the Flash interface and the Systick. *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_Init();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN Init *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END Init *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Configure the system clock *\/<\/p>\n<p>\u00a0\u00a0\u00a0 SystemClock_Config();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN SysInit *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END SysInit *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Initialize all configured peripherals *\/<\/p>\n<p>\u00a0\u00a0\u00a0 MX_GPIO_Init();<\/p>\n<p>\u00a0\u00a0\u00a0 MX_USART1_UART_Init();<\/p>\n<p>\u00a0\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN 2 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_Delay(50);<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_RESET);<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_Delay(50);<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8, GPIO_PIN_SET);<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_Delay(50);<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END 2 *\/<\/p>\n<p>\u00a0MX_LWIP_Init();<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Infinite loop *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN WHILE *\/<\/p>\n<p>\u00a0 while (gnetif.ip_addr.addr &#061;&#061; 0)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ethernetif_input(&amp;gnetif);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 sys_check_timeouts();<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MX_LWIP_Process();<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 *(uint32_t *)newipaddress &#061; (gnetif.ip_addr.addr);<\/p>\n<p>\u00a0\u00a0\u00a0 if (new_flag)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 new_flag &#061; 0;<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcppcbnew &#061; tcp_new();<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 err_t res &#061; tcp_bind(tcppcbnew, IP_ADDR_ANY, 8080);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;743 ipaddress is %d.%d.%d.%d\\\\r\\\\n&#034;, newipaddress[0], newipaddress[1], newipaddress[2], newipaddress[3]);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034; tcp_bind res is %d\\\\r\\\\n&#034;, res);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u76d1\u542c\u4e4b\u524d\u521b\u5efa\u7684\u7ed3\u6784\u4f53tcp_server_pcb *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_server_pcb &#061; tcp_listen(tcppcbnew);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* \u521d\u59cb\u5316\u7ed3\u6784\u4f53\u63a5\u6536\u56de\u8c03\u51fd\u6570 *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_accept(tcp_server_pcb, TCPServerAccept);<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Infinite loop *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN WHILE *\/<\/p>\n<p>\u00a0\u00a0\u00a0 while (1)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* USER CODE END WHILE *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/* USER CODE BEGIN 3 *\/<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 MX_LWIP_Process();<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 num&#043;&#043;;<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HAL_Delay(1);<\/p>\n<p>\/\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(num% 100000 &#061;&#061;0)<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;ipaddress is %d.%d.%d.%d\\\\r\\\\n&#034;, newipaddress[0], newipaddress[1], newipaddress[2], newipaddress[3]);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 count &#061; tcp_sndbuf(tcppcbnew); \/\/\u67e5\u8be2\u5269\u4f59buf\u5927\u5c0f<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HAL_Delay(2500);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;before payload buffer is\u00a0 %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if ((count \/ TCP_MSS) &gt; 1)<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0{<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_write(tcppcbnew, sendbuffer, strlen(sendbuffer), 1);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_output(tcppcbnew);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 count &#061; tcp_sndbuf(tcppcbnew); \/\/\u67e5\u8be2\u5269\u4f59buf\u5927\u5c0f<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;after payload buffer is\u00a0 %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0HAL_Delay(2500);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 else<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HAL_Delay(1);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_write(tcppcbnew, sendbuffer, strlen(sendbuffer), 1);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 tcp_output(tcppcbnew);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 count &#061; tcp_sndbuf(tcppcbnew); \/\/\u67e5\u8be2\u5269\u4f59buf\u5927\u5c0f<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;after payload buffer is\u00a0 %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 HAL_Delay(2500);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;after payload buffer is\u00a0 %d\\\\r\\\\n&#034;, count);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0HAL_Delay(1000);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if(rx_flag&#061;&#061;1)<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 status_new&#061;\u00a0\u00a0\u00a0 tcp_write(tcppcbnew, sendbuffer, strlen(sendbuffer), 1);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 printf(&#034;tcppcbnew status is %d\\\\r\\\\n&#034;,status_new);<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 rx_flag&#061;0;<\/p>\n<p>\/\/<\/p>\n<p>\/\/\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END 3 *\/<\/p>\n<p>}<\/p>\n<p>\/**<\/p>\n<p>\u00a0 * &#064;brief System Clock Configuration<\/p>\n<p>\u00a0 * &#064;retval None<\/p>\n<p>\u00a0 *\/<\/p>\n<p>void SystemClock_Config(void)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitTypeDef RCC_OscInitStruct &#061; {0};<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitTypeDef RCC_ClkInitStruct &#061; {0};<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Supply configuration update enable<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Configure the main internal regulator output voltage<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);<\/p>\n<p>\u00a0\u00a0\u00a0 while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}<\/p>\n<p>\u00a0\u00a0\u00a0 __HAL_RCC_SYSCFG_CLK_ENABLE();<\/p>\n<p>\u00a0\u00a0\u00a0 __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE0);<\/p>\n<p>\u00a0\u00a0\u00a0 while (!__HAL_PWR_GET_FLAG(PWR_FLAG_VOSRDY)) {}<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Initializes the RCC Oscillators according to the specified parameters<\/p>\n<p>\u00a0\u00a0\u00a0 * in the RCC_OscInitTypeDef structure.<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.OscillatorType &#061; RCC_OSCILLATORTYPE_HSE;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.HSEState &#061; RCC_HSE_ON;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLState &#061; RCC_PLL_ON;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLSource &#061; RCC_PLLSOURCE_HSE;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLM &#061; 1;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLN &#061; 120;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLP &#061; 2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLQ &#061; 2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLR &#061; 2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLRGE &#061; RCC_PLL1VCIRANGE_3;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLVCOSEL &#061; RCC_PLL1VCOWIDE;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_OscInitStruct.PLL.PLLFRACN &#061; 0;<\/p>\n<p>\u00a0\u00a0\u00a0 if (HAL_RCC_OscConfig(&amp;RCC_OscInitStruct) !&#061; HAL_OK)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Error_Handler();<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Initializes the CPU, AHB and APB buses clocks<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.ClockType &#061; RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 | RCC_CLOCKTYPE_D3PCLK1 | RCC_CLOCKTYPE_D1PCLK1;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.SYSCLKSource &#061; RCC_SYSCLKSOURCE_PLLCLK;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.SYSCLKDivider &#061; RCC_SYSCLK_DIV1;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.AHBCLKDivider &#061; RCC_HCLK_DIV2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.APB3CLKDivider &#061; RCC_APB3_DIV2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.APB1CLKDivider &#061; RCC_APB1_DIV2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.APB2CLKDivider &#061; RCC_APB2_DIV2;<\/p>\n<p>\u00a0\u00a0\u00a0 RCC_ClkInitStruct.APB4CLKDivider &#061; RCC_APB4_DIV2;<\/p>\n<p>\u00a0\u00a0\u00a0 if (HAL_RCC_ClockConfig(&amp;RCC_ClkInitStruct, FLASH_LATENCY_4) !&#061; HAL_OK)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Error_Handler();<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 __HAL_RCC_D2SRAM1_CLK_ENABLE();<\/p>\n<p>\u00a0__HAL_RCC_D2SRAM2_CLK_ENABLE();<\/p>\n<p>\u00a0__HAL_RCC_D2SRAM3_CLK_ENABLE();<\/p>\n<p>\u00a0<\/p>\n<p>\u00a0__HAL_RCC_BKPRAM_CLKAM_ENABLE();\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>\u00a0__HAL_RCC_D3SRAM1_CLKAM_ENABLE();<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>}<\/p>\n<p>\/* USER CODE BEGIN 4 *\/<\/p>\n<p>\/* USER CODE END 4 *\/<\/p>\n<p>\/* MPU Configuration *\/<\/p>\n<p>void MPU_Config(void)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_Region_InitTypeDef MPU_InitStruct &#061; {0};<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Disables the MPU *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_MPU_Disable();<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Initializes and configures the Region and the memory to be protected<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.Enable &#061; MPU_REGION_ENABLE;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER0;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30040000;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_256B;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.SubRegionDisable &#061; 0x0;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.TypeExtField &#061; MPU_TEX_LEVEL0;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.AccessPermission &#061; MPU_REGION_FULL_ACCESS;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.DisableExec &#061; MPU_INSTRUCTION_ACCESS_ENABLE;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.IsShareable &#061; MPU_ACCESS_NOT_SHAREABLE;\/\/\u00a0 MPU_ACCESS_SHAREABLE<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.IsCacheable &#061; MPU_ACCESS_NOT_CACHEABLE;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_BUFFERABLE;<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_MPU_ConfigRegion(&amp;MPU_InitStruct);<\/p>\n<p>\u00a0\u00a0\u00a0 \/** Initializes and configures the Region and the memory to be protected<\/p>\n<p>\u00a0\u00a0\u00a0 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.Number &#061; MPU_REGION_NUMBER1;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.BaseAddress &#061; 0x30044000;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.Size &#061; MPU_REGION_SIZE_16KB;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.TypeExtField &#061; MPU_TEX_LEVEL1;<\/p>\n<p>\u00a0\u00a0\u00a0 MPU_InitStruct.IsBufferable &#061; MPU_ACCESS_NOT_BUFFERABLE;<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_MPU_ConfigRegion(&amp;MPU_InitStruct);<\/p>\n<p>\u00a0\u00a0\u00a0 \/* Enables the MPU *\/<\/p>\n<p>\u00a0\u00a0\u00a0 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);<\/p>\n<p>}<\/p>\n<p>\/**<\/p>\n<p>\u00a0 * &#064;brief\u00a0 This function is executed in case of error occurrence.<\/p>\n<p>\u00a0 * &#064;retval None<\/p>\n<p>\u00a0 *\/<\/p>\n<p>void Error_Handler(void)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN Error_Handler_Debug *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* User can add his own implementation to report the HAL error return state *\/<\/p>\n<p>\u00a0\u00a0\u00a0 __disable_irq();<\/p>\n<p>\u00a0\u00a0\u00a0 while (1)<\/p>\n<p>\u00a0\u00a0\u00a0 {<\/p>\n<p>\u00a0\u00a0\u00a0 }<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END Error_Handler_Debug *\/<\/p>\n<p>}<\/p>\n<p>#ifdef\u00a0 USE_FULL_ASSERT<\/p>\n<p>\/**<\/p>\n<p>\u00a0 * &#064;brief\u00a0 Reports the name of the source file and the source line number<\/p>\n<p>\u00a0 *\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 where the assert_param error has occurred.<\/p>\n<p>\u00a0 * &#064;param\u00a0 file: pointer to the source file name<\/p>\n<p>\u00a0 * &#064;param\u00a0 line: assert_param error line source number<\/p>\n<p>\u00a0 * &#064;retval None<\/p>\n<p>\u00a0 *\/<\/p>\n<p>void assert_failed(uint8_t *file, uint32_t line)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE BEGIN 6 *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* User can add his own implementation to report the file name and line number,<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ex: printf(&#034;Wrong parameters value: file %s on line %d\\\\r\\\\n&#034;, file, line) *\/<\/p>\n<p>\u00a0\u00a0\u00a0 \/* USER CODE END 6 *\/<\/p>\n<p>}<\/p>\n<p>#endif \/* USE_FULL_ASSERT *\/<\/p>\n<p>LWIP.c\u4e2d<\/p>\n<p>\u8fd8\u6709&#xff0c;\u5728lwip.c \u7f51\u7edc\u8fde\u63a5\u72b6\u6001\u66f4\u65b0\u56de\u8c03\u51fd\u6570\u91cc\u4fee\u6539\u3002<\/p>\n<p>static void ethernet_link_status_updated(struct netif *netif)<\/p>\n<p>{<\/p>\n<p>\u00a0\u00a0printf(&#034;\\\\r\\\\nenter netif_status_updated func\\\\r\\\\n&#034;);<\/p>\n<p>\u00a0\u00a0HAL_Delay(1000);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if (netif_is_up(netif))<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034;link available\\\\r\\\\n&#034;);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034;IP:%hhu.%hhu.%hhu.%hhu\\\\r\\\\n&#034;,ip4_addr1_val(netif-&gt;ip_addr),ip4_addr2_val(netif-&gt;ip_addr),<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ip4_addr3_val(netif-&gt;ip_addr),ip4_addr4_val(netif-&gt;ip_addr));<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034;NM:%hhu.%hhu.%hhu.%hhu\\\\r\\\\n&#034;,ip4_addr1_val(netif-&gt;netmask),ip4_addr2_val(netif-&gt;netmask),<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ip4_addr3_val(netif-&gt;netmask),ip4_addr4_val(netif-&gt;netmask));<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034;GW:%hhu.%hhu.%hhu.%hhu\\\\r\\\\n&#034;,ip4_addr1_val(netif-&gt;gw),ip4_addr2_val(netif-&gt;gw),<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ip4_addr3_val(netif-&gt;gw),ip4_addr4_val(netif-&gt;gw));<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0else<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0{<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0printf(&#034;link unavailable\\\\r\\\\n&#034;);<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<\/p>\n<p>\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0}<\/p>\n<p>} <\/p>\n<h2 style=\"background-color:transparent;margin-left:0px;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">5\u3001<\/span><\/span><span style=\"color:#333333\"><span style=\"color:#000000\">LWIP\u5b9e\u6218\u9a8c\u8bc1\u6d4b\u8bd5<\/span><\/span><\/h2>\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">\u00a05.1<span style=\"color:#000000\">\u4f7f\u7528\u6b63\u70b9\u539f\u5b50\u7684\u7f51\u7edc\u52a9\u624b\u6d4b\u8bd5<\/span><\/span><\/h3>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u7b2c\u4e00\u6b21\u6d4b\u8bd5<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u4fee\u6539TCP_SND_QUEUELEN 9 <\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define TCP_SND_BUF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (4* TCP_MSS)\u00a0\u00a0 \/\/(2 * TCP_MSS)<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">TCP_MSS\u00a0\u00a0 536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u2460\u3001Sendbuf<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">20250106hello<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">1<\/span><span style=\"color:#000000\">\u5206\u949f\u53d1\u9001453300B<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u901f\u73877.5KB\/S<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u2461\u3001Sendbuf <\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">1<\/span><span style=\"color:#000000\">\u5206\u949f\u53d1\u90011162 000B<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u901f\u738719KB\/S<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"673\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221253-6802ce65aa5a8.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u2462\u3001Sendbuf <\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">1<\/span><span style=\"color:#000000\">\u5206\u949f\u53d1\u9001366 788<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u901f\u73876.1KB\/S<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"689\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221253-6802ce65f185f.png\" width=\"866\" \/><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u7b2c\u4e8c\u6b21\u6d4b\u8bd5<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0<span style=\"color:#000000\">\u4fee\u6539TCP_SND_QUEUELEN 12 \/\/9<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define TCP_SND_BUF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (6 * TCP_MSS)\u00a0\u00a0 \/\/(2 * TCP_MSS)<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">TCP_MSS 536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u2460<\/span><span style=\"color:#000000\">\u3001Sendbuf <\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">1<\/span><span style=\"color:#000000\">\u5206\u949f\u53d1\u900197 3824<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u901f\u738716KB\/S<\/span><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"674\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221254-6802ce6647b96.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u7b2c\u4e09\u6b21\u6d4b\u8bd5<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u4fee\u6539TCP_SND_QUEUELEN 6\/\/9<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define TCP_SND_BUF\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (3 * TCP_MSS)\u00a0\u00a0 \/\/(2 * TCP_MSS)<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u6d4b\u8bd520s\u53d1\u9001302 924<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u901f\u738715KB\/S<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"684\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221254-6802ce6690985.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0\u00a0\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u589e\u52a0<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">tcp_output(tcppcbnew);<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define TCP_MSS\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 1460\u00a0 \/\/536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define TCP_WND_UPDATE_THRESHOLD\u00a0 1460\/\/536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#if TCP_MSS &gt; 536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">#define INITIAL_MSS TCP_MSS \/\/536<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">\u53d1\u90011\u5206\u949f<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#000000\">15 739 425<\/span><span style=\"color:#000000\">&#xff0c;\u901f\u7387\u8fbe\u52300.25MB\/s<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u00a0\u00a0<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"688\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221254-6802ce66d698d.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u4e0d\u663e\u793a\u63a5\u6536\u6570\u636e&#xff0c;\u518d\u6d4b\u8bd5\u80fd\u52303Mb\/s<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">5.2\u7136\u540e\u7528netassist\u6d4b\u8bd5\u3002<\/span><\/h3>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u2460char sendbuffer[] &#061; &#034;20250106hel20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6d4b\u8bd5\u65f6\u95f4&#xff1a;1\u5206\u949f<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u53d1\u9001\u6570\u636e&#xff1a;143 631 765 B<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5bf9\u5e94\u7684\u7f51\u901f\u4e3a&#xff1a;19.150902 Mb\/s<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"824\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221255-6802ce6722ebc.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#FF0000\">\u2461\u4fee\u6539<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">char sendbuffer[] &#061; &#034;20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6d4b\u8bd5\u65f6\u95f4&#xff1a;1\u5206\u949f<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u53d1\u9001\u6570\u636e&#xff1a;143 658 285<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5bf9\u5e94\u7684\u7f51\u901f\u4e3a&#xff1a;19.154438 Mb\/s<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"895\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221255-6802ce6769916.png\" width=\"831\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\"><span style=\"color:#FF0000\">\u2462\u4fee\u6539\u6d4b\u8bd5\u65f6\u95f4\u3002<\/span><\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">char sendbuffer[] &#061; &#034;20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello20250106hello\\\\r\\\\n&#034;;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6d4b\u8bd5\u65f6\u95f4&#xff1a;100\u79d2<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u53d1\u9001\u6570\u636e&#xff1a;325 879 580<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5bf9\u5e94\u7684\u7f51\u901f\u4e3a&#xff1a;26.070366 Mb\/s&#xff08;\u8d85\u8fc725Mb\/s&#xff09;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u5bf9\u5e94\u7684\u4ee5\u592a\u7f51\u5e27\u6570\u76ee&#xff1a;218867<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6bcf\u4e2a\u5e27\u957f&#xff1a;1489<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"940\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221255-6802ce67b67cf.png\" width=\"866\" \/><\/p>\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">5.3\u7528\u7535\u8111\u6d4b\u8bd5<\/span><\/h3>\n<p style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">\u540e\u6765\u77e5\u9053&#xff0c;\u7528\u7535\u8111\u4e5f\u80fd\u6d4b\u8bd5\u7f51\u901f&#xff0c;<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u6253\u5f00\u4efb\u52a1\u7ba1\u7406\u5668\u2014\u2014\u6027\u80fd\u2014\u2014\u4ee5\u592a\u7f51<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"402\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221256-6802ce6811c79.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u770b\u5230\u53d1\u9001\u901f\u5ea6\u80fd\u8fbe\u523034Mbps\u3002<\/span><\/p>\n<p style=\"margin-left:0;text-align:justify\">\n<h3 style=\"margin-left:0px;text-align:justify\"><span style=\"color:#333333\">5.4\u5bf9H723\u518d\u6b21\u6d4b\u8bd5<\/span><\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"457\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221256-6802ce6846628.png\" width=\"866\" \/><\/p>\n<p style=\"margin-left:0;text-align:justify\"><span style=\"color:#333333\">\u53d1\u9001\u901f\u5ea6\u80fd\u8fbe\u523038Mbps\u3002<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf29\u6b21\u3002\u672c\u7bc7\u6587\u7ae0\u8bb2\u8ff0stm32H7\u7cfb\u5217\u5355\u7247\u673a\u3002STM32CUBEMX\u521d\u59cb\u5316\uff0c\u5b9e\u73b0LWIP\u79fb\u690d\uff0cRAW TCP\u670d\u52a1\u5668\u7aef\uff0cDHCP\u83b7\u53d6\u5730\u5740\uff0c\u4e0d\u505c\u53d1\u6570\u636e\u6d4b\u8bd5\u3002_stm32h7 eth cubemx<\/p>\n","protected":false},"author":2,"featured_media":22604,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[217,205,270,219,269,43,78],"topic":[],"class_list":["post-22614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-stm32","tag-tcp-ip","tag-270","tag-219","tag-269","tag-43","tag-78"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/22614.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf29\u6b21\u3002\u672c\u7bc7\u6587\u7ae0\u8bb2\u8ff0stm32H7\u7cfb\u5217\u5355\u7247\u673a\u3002STM32CUBEMX\u521d\u59cb\u5316\uff0c\u5b9e\u73b0LWIP\u79fb\u690d\uff0cRAW TCP\u670d\u52a1\u5668\u7aef\uff0cDHCP\u83b7\u53d6\u5730\u5740\uff0c\u4e0d\u505c\u53d1\u6570\u636e\u6d4b\u8bd5\u3002_stm32h7 eth cubemx\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/22614.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-04-18T22:12:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221253-6802ce65aa5a8.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22614.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/22614.html\",\"name\":\"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-04-18T22:12:57+00:00\",\"dateModified\":\"2025-04-18T22:12:57+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/22614.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/22614.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/22614.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/22614.html","og_locale":"zh_CN","og_type":"article","og_title":"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb1.4k\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf29\u6b21\u3002\u672c\u7bc7\u6587\u7ae0\u8bb2\u8ff0stm32H7\u7cfb\u5217\u5355\u7247\u673a\u3002STM32CUBEMX\u521d\u59cb\u5316\uff0c\u5b9e\u73b0LWIP\u79fb\u690d\uff0cRAW TCP\u670d\u52a1\u5668\u7aef\uff0cDHCP\u83b7\u53d6\u5730\u5740\uff0c\u4e0d\u505c\u53d1\u6570\u636e\u6d4b\u8bd5\u3002_stm32h7 eth cubemx","og_url":"https:\/\/www.wsisp.com\/helps\/22614.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-04-18T22:12:57+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/04\/20250418221253-6802ce65aa5a8.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"13 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/22614.html","url":"https:\/\/www.wsisp.com\/helps\/22614.html","name":"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-04-18T22:12:57+00:00","dateModified":"2025-04-18T22:12:57+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/22614.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/22614.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/22614.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"STM32H7\u901a\u8fc7CUBEMX\u521d\u59cb\u5316\u79fb\u690dLWIP\uff0cDHCP\u5efa\u7acbRAW TCP\u670d\u52a1\u5668\uff0c\u4e0d\u505c\u53d1\u6210\u529f"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/22614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=22614"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/22614\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/22604"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=22614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=22614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=22614"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=22614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}