{"id":9151,"date":"2024-05-10T22:01:01","date_gmt":"2024-05-10T14:01:01","guid":{"rendered":""},"modified":"2024-05-10T22:01:01","modified_gmt":"2024-05-10T14:01:01","slug":"stm32cube+lwip+DP8384,PING\u4e0d\u901a\u7684\u76f8\u5173\u89e3\u51b3\u65b9\u6cd5(\u8f6c\u8f7d)","status":"publish","type":"post","link":"https:\/\/mushiming.com\/9151.html","title":{"rendered":"stm32cube+lwip+DP8384,PING\u4e0d\u901a\u7684\u76f8\u5173\u89e3\u51b3\u65b9\u6cd5(\u8f6c\u8f7d)"},"content":{"rendered":"

Wireshare\u6293\u5305\u5de5\u5177\u8c03\u8bd5<\/p>\n

 <\/p>\n

1<\/p>\n\n\n\n
\n

\u4f7f\u7528STM32CubeMX\u751f\u6210\u5e26\u7cfb\u7edf\u7684Lwip\u5de5\u7a0b\u3002\u751f\u6210\u540e\uff0c\u600e\u4e48\u90fdPing\u4e0d\u901a\u3002<\/span>
\u5728\u4e0d\u4f7f\u7528FreeRTOS\u65f6\uff0c<\/span>\u8981\u5728main\u91cc\u7684while(1)\u4e2d\u6dfb\u52a0MX_LWIP_Process();\u5c31\u53ef\u4ee5Ping\u901a<\/strong><\/span><\/strong>\u3002<\/span>
\u4f46\u662f\u5728\u4f7f\u7528FreeRTOS\u65f6\uff0cMX_LWIP_Init();\u5728\u9ed8\u8ba4\u7684\u4efb\u52a1\u4e2d\u3002\u4f7f\u7528 tcpip_init( NULL, NULL );    \u8fdb\u884c\u4e86\u521d\u59cb\u5316\u3002\u5728\u5176\u4e2d\u4f7f\u7528sys_thread_new\u65b0\u5efa\u4e86tcpip_thread\u7ebf\u7a0b\u3002<\/span>
\u4f46\u662fPing\u4e0d\u901a\u554a\u3002\u6709\u6ca1\u6709\u5927\u795e\u5e2e\u52a9\u4e00\u4e0b\u3002\u6216\u662f\u6709\u6ca1\u6709\u7528CubeMX\u751f\u6210\u7684\u5de5\u7a0b\u6837\u7248\uff1f<\/span>
CubMX\u7248\u672c\u662f4.18<\/span>
\u914d\u7f6e\u6587\u4ef6\uff1a<\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

2\\\u4f60\u68c0\u67e5\u4e00\u4e0b PHY\u7684\u914d\u7f6e\uff0c\u9700\u8981\u914d\u7f6e\u6210\u548c\u4f60\u7684\u677f\u5b50\u4e00\u6837\u7684\u5bc4\u5b58\u5668\u53c2\u6570...<\/span><\/p>\n

\u901a\u5e38\u60c5\u51b5\u4e0b\uff0cCube\u5df2\u7ecf\u6574\u7684\u5f88\u4eba\u6027\u5316\uff0c\u4e0d\u4f1a\u6709\u5927\u95ee\u9898\uff0c\u68c0\u67e5\u786c\u4ef6\u7f51\u7ebf\u3001\u8fd8\u6709\u5355\u6b65\u8c03\u8bd5\uff0c\u770b\u770b\u662f\u4e0d\u662f\u54ea\u513f\u5d29\u6e83\u4e86<\/span><\/p>\n

\u4e2a\u4eba\u5efa\u8bae\uff0c\u5148\u4e0d\u7528 OS\uff0c\u88f8\u673a\u8dd1\u6216\u8005\u4f7f\u7528\u5176\u4ed6\u65b9\u5f0f\u4ee5\u786e\u5b9a\u786c\u4ef6\u5b8c\u5168\u6ca1\u95ee\u9898\uff0c\u518d\u5f00\u59cb\u8c03\u8f6f\u4ef6<\/span><\/p>\n

freertos \u7684\u5806\u6808\u8bbe\u7f6e\u5c0f\u4e86\uff0c\u5c06freertos\u7684\u5806\u6808\u8bbe\u7f6e\u5927\u4e00\u4e9b\u5c31\u53ef\u4ee5\u4e86<\/span><\/p>\n

 <\/p>\n

 <\/p>\n

3<\/span>\u8c03\u8bd5\u7ec6\u8282\u95ee\u9898\uff1a<\/span>
1. \/\/\u8bb0\u5f97\u5728void MX_GPIO_Init(void)\u4e2d\u4f7f\u80fdRMII\u6240\u7528\u5230\u7684IO\u7684\u7aef\u53e3\u65f6\u949f\uff0c<\/span>
    \/\/\u56e0\u4e3a\u5728ethernetif.c\u4e2d\u7684void HAL_ETH_MspInit(ETH_HandleTypeDef* ethHandle)\u51fd\u6570\u91cc\u53ea\u5f00\u4e86\u4ee5\u592a\u7f51\u65f6\u949f__HAL_RCC_ETH_CLK_ENABLE();<\/span>
  
2. \/\/\u7528STM32CubeMX\u76f4\u63a5\u751f\u6210\u7684RMII\u63a5\u53e3\u7684IO\u53e3\u548c\u5b9e\u9645\u7684\u6709\u90e8\u5206\u4e0d\u4e00\u81f4<\/span><\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

https:\/\/blog.csdn.net\/kmsmg\/article\/details\/78271221<\/p>\n

\u56db\u3001\u7528STM32CubeMX  V4.22.1 \u751f\u6210\u4e86\u4e00\u4e2a\u5305\u542b EHT \uff0cLwip \u7684\u9879\u76ee\uff0c\u8c03\u8bd5\u4e00\u76f4\u4e0d\u6b63\u5e38\uff0c\u7ecf\u4ed4\u7ec6\u68c0\u67e5\u5b58\u5728\u4ee5\u4e0b\u95ee\u9898\uff1a<\/p>\n

 <\/p>\n

1.\u786c\u4ef6\u91c7\u7528\u4e86LAN8720A \uff0c\u4f46\u662fSTM32CubeMX \u751f\u6210\u7684\u662f LAN8742A\u7684\u4ee3\u7801\uff0c\u5fc5\u987b\u6839\u636e\u786c\u4ef6\u8fde\u63a5\u66f4\u6539\u5730\u5740\u3002 <\/p>\n

 <\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a \u5728 ..\\Src\\ethernetif.c<\/strong><\/strong> \u4fee\u6539\u5982\u4e0b\uff1a<\/p>\n

 <\/p>\n

heth.Instance = ETH;<\/p>\n

heth.Init.AutoNegotiation = ETH_AUTONEGOTIATION_ENABLE;<\/p>\n

\/\/ heth.Init.PhyAddress = LAN8742A_PHY_ADDRESS;<\/p>\n

heth.Init.PhyAddress = LAN8720A_PHY_ADDRESS<\/strong><\/strong>; \/\/ modify by kmsmg\uff0c LAN8720A_PHY_ADDRESS=0<\/strong><\/strong>\uff0c LAN8742A_PHY_ADDRESS=1<\/p>\n

 <\/p>\n

2.\u521d\u59cb\u5316\u65f6\u5fc5\u987b\u5bf9  LAN8720A \u8fdb\u884c\u786c\u4ef6\u590d\u4f4d<\/strong><\/strong>\u3002<\/p>\n

 <\/p>\n

\u89e3\u51b3\u529e\u6cd5\uff1a<\/p>\n

 <\/p>\n

\u5206\u914d\u4e00\u4e2a GPIO \u8fde\u63a5  LAN8720A\u7684\u590d\u4f4d\u7aef\uff0c \u5728 ..\\Src\\ethernetif.c \u4fee\u6539\u5982\u4e0b\uff1a<\/p>\n

 <\/p>\n

heth.Init.ChecksumMode = ETH_CHECKSUM_BY_HARDWARE;<\/p>\n

heth.Init.MediaInterface = ETH_MEDIA_INTERFACE_RMII;<\/p>\n

 <\/p>\n

\/* USER CODE BEGIN MACADDRESS *\/<\/p>\n

 <\/p>\n

\/* USER CODE END MACADDRESS *\/<\/p>\n

LAN8720_RESET(); \/\/ modify by kmsmg<\/p>\n

hal_eth_init_status = HAL_ETH_Init(&heth);<\/p>\n

 <\/p>\n

 ............<\/p>\n

 <\/p>\n

\/\/-----------------------------------------------<\/p>\n

 <\/p>\n

void LAN8720_RESET(void)<\/p>\n

{
\n <\/p>\n

 <\/p>\n

HAL_GPIO_WritePin(GPIOD, GP_EHT_REST_Pin, GPIO_PIN_RESET);<\/p>\n

 <\/p>\n

HAL_Delay(55);<\/p>\n

 <\/p>\n

HAL_GPIO_WritePin(GPIOD, GP_EHT_REST_Pin, GPIO_PIN_SET);<\/p>\n

 <\/p>\n

}<\/p>\n

---------------------<\/p>\n

\u4f5c\u8005\uff1akmsmg<\/p>\n

\u6765\u6e90\uff1aCSDN<\/p>\n

\u539f\u6587\uff1ahttps:\/\/blog.csdn.net\/kmsmg\/article\/details\/78271221<\/p>\n

\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3a\u535a\u4e3b\u539f\u521b\u6587\u7ae0\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u535a\u6587\u94fe\u63a5\uff01<\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

 <\/p>\n

\u516d\u3001<\/p>\n

\n

 <\/p>\n

 <\/p>\n

\u4e03\u3001\u597d<\/p>\n

http:\/\/www.cnblogs.com\/54zorb\/p\/9608066.html<\/p>\n

 <\/p>\n

    \n
  • http:\/\/www.stmcu.org.cn\/module\/forum\/thread-606233-1-1.html<\/li>\n<\/ul>\n

     <\/p>\n

      \n
    • ip\u5730\u5740\u5728lwip\u90a3\u8bbe\u7f6e\uff0c\u4e00\u706f\u5e38\u4eae\u8868\u793a100M\uff0c\u53e6\u4e00\u706f3-8\u79d2\u95ea\u70c1\u4e00\u6b21\u662f\u4f60\u7684\u5c40\u57df\u7f51\u51853-8\u79d2\u6709\u4e00\u4e2a\u5e7f\u64ad\u6570\u636e\u5305\uff0c\u6709\u6570\u636e\u6536\u53d1\u5c31\u4f1a\u95ea\u70c1\uff0c\u5373\u4f7f\u4f60\u7684\u7a0b\u5e8f\u4e0d\u6b63\u786e\uff0cPHY\u5728\u68c0\u6d4b\u5230\u6570\u636e\u5305\u65f6\u4e5f\u4f1a\u95ea\u70c1\u6307\u793a\u706f\u3002\u5148\u641e\u5b9aip\u518dping\uff0c\u6ca1\u6709ip\u4f60ping\u8c01\u5462\uff1fCubeMX\u751f\u6210\u7684\u5de5\u7a0b\u9ed8\u8ba4\u662fDHCP\u7684\uff0c\u5982\u679c\u662fDHCP\uff0c\u4f60\u8981\u767b\u5f55\u8def\u7531\u5668\u6765\u67e5\u770b\u4f60\u7684\u8bbe\u5907IP\u3002<\/span><\/li>\n<\/ul>\n

      http:\/\/www.stmcu.org.cn\/module\/forum\/thread-610516-1-1.html<\/p>\n

       <\/p>\n

       <\/p>\n

       <\/p>\n

       <\/p>\n

      OK<\/p>\n

      https:\/\/blog.csdn.net\/qingwufeiyang12346\/article\/details\/84892397<\/p>\n

      https:\/\/blog.csdn.net\/qingwufeiyang12346\/article\/details\/85107007<\/p>\n

      \n","protected":false},"excerpt":{"rendered":"stm32cube+lwip+DP8384,PING\u4e0d\u901a\u7684\u76f8\u5173\u89e3\u51b3\u65b9\u6cd5(\u8f6c\u8f7d)Wireshare\u6293\u5305\u5de5\u5177\u8c03\u8bd51\t\t\t\u4f7f\u7528STM32CubeMX\u751f\u6210\u5e26\u7cfb\u7edf\u7684Lwip\u5de5\u7a0b","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/9151"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=9151"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/9151\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=9151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=9151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=9151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}