From dc18c18c6eaaa37d7a53895f80655e76fe2a9c2c Mon Sep 17 00:00:00 2001 From: wangxujie Date: Wed, 25 Jun 2025 18:53:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E4=BB=BD-=E4=BD=BF=E8=83=BD=E7=BD=91?= =?UTF-8?q?=E7=BA=BF=E9=80=9A=E6=96=AD=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/freertos.c | 30 ++++---- LWIP/Target/lwipopts.h | 4 ++ MDK-ARM/remote_dido_unit.uvoptx | 48 ++++++------- MDK-ARM/remote_dido_unit.uvprojx | 115 +++++++++++++++---------------- remote_dido_unit.ioc | 4 +- 5 files changed, 101 insertions(+), 100 deletions(-) diff --git a/Core/Src/freertos.c b/Core/Src/freertos.c index 6971562..7612d50 100644 --- a/Core/Src/freertos.c +++ b/Core/Src/freertos.c @@ -70,15 +70,15 @@ extern ETH_HandleTypeDef heth; extern struct tcp_pcb *server_pcb_control; /* USER CODE END FunctionPrototypes */ -void start_tcp_task(void const *argument); -void start_gpio_di_do_task(void const *argument); -void start_leds_task(void const *argument); +void start_tcp_task(void const * argument); +void start_gpio_di_do_task(void const * argument); +void start_leds_task(void const * argument); extern void MX_LWIP_Init(void); void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ /* GetIdleTaskMemory prototype (linked to static allocation support) */ -void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize); +void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ); /* USER CODE BEGIN GET_IDLE_TASK_MEMORY */ static StaticTask_t xIdleTaskTCBBuffer; @@ -94,12 +94,11 @@ void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer, StackTyp /* USER CODE END GET_IDLE_TASK_MEMORY */ /** - * @brief FreeRTOS initialization - * @param None - * @retval None - */ -void MX_FREERTOS_Init(void) -{ + * @brief FreeRTOS initialization + * @param None + * @retval None + */ +void MX_FREERTOS_Init(void) { /* USER CODE BEGIN Init */ /* USER CODE END Init */ @@ -136,6 +135,7 @@ void MX_FREERTOS_Init(void) /* USER CODE BEGIN RTOS_THREADS */ /* add threads, ... */ /* USER CODE END RTOS_THREADS */ + } /* USER CODE BEGIN Header_start_tcp_task */ @@ -145,7 +145,7 @@ void MX_FREERTOS_Init(void) * @retval None */ /* USER CODE END Header_start_tcp_task */ -void start_tcp_task(void const *argument) +void start_tcp_task(void const * argument) { /* init code for LWIP */ MX_LWIP_Init(); @@ -187,7 +187,7 @@ void start_tcp_task(void const *argument) * @retval None */ /* USER CODE END Header_start_gpio_di_do_task */ -void start_gpio_di_do_task(void const *argument) +void start_gpio_di_do_task(void const * argument) { /* USER CODE BEGIN start_gpio_di_do_task */ /* Infinite loop */ @@ -198,8 +198,8 @@ void start_gpio_di_do_task(void const *argument) uint8_t tx_data[32] = {0}; tx_data[0] = FRAME_HEAD; // 帧头 tx_data[1] = COM_OK; // 状�?? - tx_data[2] = DEVICE_NUM; // 设备�? - tx_data[3] = SEND_STATE_CMD; // 命令�? + tx_data[2] = DEVICE_NUM; // 设备?? + tx_data[3] = SEND_STATE_CMD; // 命令?? tx_data[4] = DI_MAX; // 数据长度 for (di_ch = 0; di_ch < DI_MAX; di_ch++) { @@ -234,7 +234,7 @@ void start_gpio_di_do_task(void const *argument) * @retval None */ /* USER CODE END Header_start_leds_task */ -void start_leds_task(void const *argument) +void start_leds_task(void const * argument) { /* USER CODE BEGIN start_leds_task */ /* Infinite loop */ diff --git a/LWIP/Target/lwipopts.h b/LWIP/Target/lwipopts.h index f23adbc..61f456f 100644 --- a/LWIP/Target/lwipopts.h +++ b/LWIP/Target/lwipopts.h @@ -63,6 +63,10 @@ #define TCP_SNDQUEUELOWAT 5 /*----- Value in opt.h for TCP_WND_UPDATE_THRESHOLD: LWIP_MIN(TCP_WND/4, TCP_MSS*4) -----*/ #define TCP_WND_UPDATE_THRESHOLD 536 +/*----- Default Value for LWIP_NETIF_STATUS_CALLBACK: 0 ---*/ +#define LWIP_NETIF_STATUS_CALLBACK 1 +/*----- Default Value for LWIP_NETIF_EXT_STATUS_CALLBACK: 0 ---*/ +#define LWIP_NETIF_EXT_STATUS_CALLBACK 1 /*----- Value in opt.h for LWIP_NETIF_LINK_CALLBACK: 0 -----*/ #define LWIP_NETIF_LINK_CALLBACK 1 /*----- Value in opt.h for TCPIP_THREAD_STACKSIZE: 0 -----*/ diff --git a/MDK-ARM/remote_dido_unit.uvoptx b/MDK-ARM/remote_dido_unit.uvoptx index 8451f46..a936f77 100644 --- a/MDK-ARM/remote_dido_unit.uvoptx +++ b/MDK-ARM/remote_dido_unit.uvoptx @@ -1,4 +1,4 @@ - + 1.0 @@ -45,7 +45,7 @@ 79 66 8 - + 1 @@ -104,16 +104,16 @@ 0 0 6 - - - - - - - - - - + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll @@ -130,7 +130,7 @@ 0 ARMDBGFLAGS - + 0 @@ -148,7 +148,7 @@ -U-O142 -O2254 -SF10000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP (ARM Core") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407VGTx$CMSIS\Flash\STM32F4xx_1024.FLM) - + 0 @@ -185,19 +185,19 @@ 0 0 - - + + 0 0 0 - - - - - - - - + + + + + + + + 1 0 diff --git a/MDK-ARM/remote_dido_unit.uvprojx b/MDK-ARM/remote_dido_unit.uvprojx index eb3cd7c..96350e4 100644 --- a/MDK-ARM/remote_dido_unit.uvprojx +++ b/MDK-ARM/remote_dido_unit.uvprojx @@ -1,10 +1,7 @@ - - - + + 2.1 -
### uVision Project, (C) Keil Software
- remote_dido_unit @@ -19,28 +16,28 @@ Keil.STM32F4xx_DFP.2.12.0 http://www.keil.com/pack IRAM(0x20000000-0x2001BFFF) IRAM2(0x2001C000-0x2001FFFF) IROM(0x8000000-0x80FFFFF) CLOCK(25000000) FPU2 CPUTYPE("Cortex-M4") TZ - - - + + + 0 - - - - - - - - - - + + + + + + + + + + $$Device:STM32F407VGTx$CMSIS\SVD\STM32F40x.svd 0 0 - - - - - + + + + + 0 0 @@ -55,15 +52,15 @@ 0 1 0 - + 1 0 0 0 0 - - + + 0 0 0 @@ -72,8 +69,8 @@ 0 0 - - + + 0 0 0 @@ -82,15 +79,15 @@ 0 0 - - + + 0 0 0 0 1 - + 0 @@ -104,8 +101,8 @@ 0 0 3 - - + + 0 @@ -139,10 +136,10 @@ 1 BIN\UL2V8M.DLL "" () - - - - + + + + 0 @@ -175,7 +172,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -309,7 +306,7 @@ 0x4000 - + 1 @@ -336,9 +333,9 @@ 0 0 - + USE_HAL_DRIVER,STM32F407xx - + ../Core/Inc;../LWIP/App;../LWIP/Target;../Middlewares/Third_Party/LwIP/src/include;../Middlewares/Third_Party/LwIP/system;../Drivers/STM32F4xx_HAL_Driver/Inc;../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy;../Middlewares/Third_Party/FreeRTOS/Source/include;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM4F;../Drivers/BSP/Components/lan8742;../Middlewares/Third_Party/LwIP/src/include/netif/ppp;../Drivers/CMSIS/Device/ST/STM32F4xx/Include;../Middlewares/Third_Party/LwIP/src/include/lwip;../Middlewares/Third_Party/LwIP/src/include/lwip/apps;../Middlewares/Third_Party/LwIP/src/include/lwip/priv;../Middlewares/Third_Party/LwIP/src/include/lwip/prot;../Middlewares/Third_Party/LwIP/src/include/netif;../Middlewares/Third_Party/LwIP/src/include/compat/posix;../Middlewares/Third_Party/LwIP/src/include/compat/posix/arpa;../Middlewares/Third_Party/LwIP/src/include/compat/posix/net;../Middlewares/Third_Party/LwIP/src/include/compat/posix/sys;../Middlewares/Third_Party/LwIP/src/include/compat/stdc;../Middlewares/Third_Party/LwIP/system/arch;../Drivers/CMSIS/Include;../User/application/inc;../User/system;../User/board/inc @@ -354,9 +351,9 @@ 0 1 - - - + + + ../Core/Inc @@ -367,15 +364,15 @@ 0 1 0 - - - - - - - - - + + + + + + + + + @@ -1066,20 +1063,18 @@ - - + - + - + - + - @@ -1088,5 +1083,5 @@ -
+ diff --git a/remote_dido_unit.ioc b/remote_dido_unit.ioc index 90f436c..796506a 100644 --- a/remote_dido_unit.ioc +++ b/remote_dido_unit.ioc @@ -17,9 +17,11 @@ KeepUserPlacement=false LWIP.BSP.number=1 LWIP.CMSIS_VERSION-Enabled=1 LWIP.GATEWAY_ADDRESS=192.168.001.027 -LWIP.IPParameters=LWIP_DHCP,IP_ADDRESS,NETMASK_ADDRESS,GATEWAY_ADDRESS,LWIP_UDP,CMSIS_VERSION-Enabled +LWIP.IPParameters=LWIP_DHCP,IP_ADDRESS,NETMASK_ADDRESS,GATEWAY_ADDRESS,LWIP_UDP,CMSIS_VERSION-Enabled,LWIP_NETIF_STATUS_CALLBACK,LWIP_NETIF_EXT_STATUS_CALLBACK LWIP.IP_ADDRESS=192.168.001.101 LWIP.LWIP_DHCP=0 +LWIP.LWIP_NETIF_EXT_STATUS_CALLBACK=1 +LWIP.LWIP_NETIF_STATUS_CALLBACK=1 LWIP.LWIP_UDP=0 LWIP.NETMASK_ADDRESS=255.255.255.000 LWIP.Version=v2.1.2_Cube