From 1c0ffc5afd688bfa9b11e7fa305c6f9c866dff02 Mon Sep 17 00:00:00 2001 From: wangxujie Date: Wed, 12 Mar 2025 16:18:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Core/Src/freertos.c | 53 ++++---- ...shed_product_testing_STM32F407VGTx.dbgconf | 48 -------- MDK-ARM/semi-finished_product_testing.uvoptx | 48 ++++---- MDK-ARM/semi-finished_product_testing.uvprojx | 115 +++++++++--------- .../semi-finished_product_testing.hex | 2 +- 5 files changed, 113 insertions(+), 153 deletions(-) delete mode 100644 MDK-ARM/DebugConfig/semi-finished_product_testing_STM32F407VGTx.dbgconf diff --git a/Core/Src/freertos.c b/Core/Src/freertos.c index 9c93d6b..1b44691 100644 --- a/Core/Src/freertos.c +++ b/Core/Src/freertos.c @@ -73,18 +73,18 @@ uint8_t di_state_last[DI_MAX] = {0}; uint8_t di_state_now[DI_MAX] = {0}; /* USER CODE END FunctionPrototypes */ -void start_tcp_task(void const * argument); -void start_led_toggle_task(void const * argument); -void start_dac_task(void const * argument); -void start_adc_task(void const * argument); -void start_gpio_di_do_task(void const * argument); -void start_ec11_task(void const * argument); +void start_tcp_task(void const *argument); +void start_led_toggle_task(void const *argument); +void start_dac_task(void const *argument); +void start_adc_task(void const *argument); +void start_gpio_di_do_task(void const *argument); +void start_ec11_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; @@ -100,11 +100,12 @@ 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 */ @@ -153,7 +154,6 @@ void MX_FREERTOS_Init(void) { /* USER CODE BEGIN RTOS_THREADS */ /* add threads, ... */ /* USER CODE END RTOS_THREADS */ - } /* USER CODE BEGIN Header_start_tcp_task */ @@ -163,7 +163,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(); @@ -172,7 +172,8 @@ void start_tcp_task(void const * argument) /* Infinite loop */ for (;;) { - uart_lcd_draw_ipaddr(); + uart_lcd_draw_ipaddr(); // 更新LCD显示的IP地址 + osThreadTerminate(NULL); } /* USER CODE END start_tcp_task */ @@ -185,7 +186,7 @@ void start_tcp_task(void const * argument) * @retval None */ /* USER CODE END Header_start_led_toggle_task */ -void start_led_toggle_task(void const * argument) +void start_led_toggle_task(void const *argument) { /* USER CODE BEGIN start_led_toggle_task */ /* Infinite loop */ @@ -204,14 +205,14 @@ void start_led_toggle_task(void const * argument) * @retval None */ /* USER CODE END Header_start_dac_task */ -void start_dac_task(void const * argument) +void start_dac_task(void const *argument) { /* USER CODE BEGIN start_dac_task */ dac161s997_init(); /* Infinite loop */ for (;;) { - osThreadSuspend(adc_taskHandle); + osThreadSuspend(adc_taskHandle); // 暂停DAC任务,防止ADC采集时产生干扰,因为ADC和DAC采用的是同一路SPI,但是时序不同 dac161s997_output(DAC161S997_1, current_buff[0]); dac161s997_output(DAC161S997_2, current_buff[1]); osThreadResume(adc_taskHandle); @@ -227,20 +228,22 @@ void start_dac_task(void const * argument) * @retval None */ /* USER CODE END Header_start_adc_task */ -void start_adc_task(void const * argument) +void start_adc_task(void const *argument) { /* USER CODE BEGIN start_adc_task */ ad7124_setup(); /* Infinite loop */ for (;;) { - osThreadSuspend(dac_taskHandle); + osThreadSuspend(dac_taskHandle); // 暂停DAC任务,防止ADC采集时产生干扰,因为ADC和DAC采用的是同一路SPI,但是时序不同 uint8_t ch = 0; for (ch = STOP_NC_ADC; ch < AD7124_CHANNEL_EN_MAX; ch++) { ad7124_get_analog(ch); } HAL_GPIO_TogglePin(LED2_Y_GPIO_Port, LED2_Y_Pin); + + /*此部分是因为通讯过程中会产生通讯中断并无法恢复的情况*/ if (huart5.RxState == HAL_UART_STATE_READY) { HAL_UARTEx_ReceiveToIdle_DMA(&huart5, hart1_uart5.rx_data_temp, ARRAY_LEN(hart1_uart5.rx_data_temp)); @@ -262,7 +265,7 @@ void start_adc_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 */ @@ -273,9 +276,9 @@ void start_gpio_di_do_task(void const * argument) uint8_t tx_data_len = 7 + DI_MAX; 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[1] = COM_OK; // 状�?�码 + 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++) { @@ -310,7 +313,7 @@ void start_gpio_di_do_task(void const * argument) * @retval None */ /* USER CODE END Header_start_ec11_task */ -void start_ec11_task(void const * argument) +void start_ec11_task(void const *argument) { /* USER CODE BEGIN start_ec11_task */ /* Infinite loop */ diff --git a/MDK-ARM/DebugConfig/semi-finished_product_testing_STM32F407VGTx.dbgconf b/MDK-ARM/DebugConfig/semi-finished_product_testing_STM32F407VGTx.dbgconf deleted file mode 100644 index 1df0a1b..0000000 --- a/MDK-ARM/DebugConfig/semi-finished_product_testing_STM32F407VGTx.dbgconf +++ /dev/null @@ -1,48 +0,0 @@ -// File: STM32F405_415_407_417_427_437_429_439.dbgconf -// Version: 1.0.0 -// Note: refer to STM32F405/415 STM32F407/417 STM32F427/437 STM32F429/439 reference manual (RM0090) -// refer to STM32F40x STM32F41x datasheets -// refer to STM32F42x STM32F43x datasheets - -// <<< Use Configuration Wizard in Context Menu >>> - -// Debug MCU configuration register (DBGMCU_CR) -// DBG_STANDBY Debug Standby Mode -// DBG_STOP Debug Stop Mode -// DBG_SLEEP Debug Sleep Mode -// -DbgMCU_CR = 0x00000007; - -// Debug MCU APB1 freeze register (DBGMCU_APB1_FZ) -// Reserved bits must be kept at reset value -// DBG_CAN2_STOP CAN2 stopped when core is halted -// DBG_CAN1_STOP CAN2 stopped when core is halted -// DBG_I2C3_SMBUS_TIMEOUT I2C3 SMBUS timeout mode stopped when core is halted -// DBG_I2C2_SMBUS_TIMEOUT I2C2 SMBUS timeout mode stopped when core is halted -// DBG_I2C1_SMBUS_TIMEOUT I2C1 SMBUS timeout mode stopped when core is halted -// DBG_IWDG_STOP Independent watchdog stopped when core is halted -// DBG_WWDG_STOP Window watchdog stopped when core is halted -// DBG_RTC_STOP RTC stopped when core is halted -// DBG_TIM14_STOP TIM14 counter stopped when core is halted -// DBG_TIM13_STOP TIM13 counter stopped when core is halted -// DBG_TIM12_STOP TIM12 counter stopped when core is halted -// DBG_TIM7_STOP TIM7 counter stopped when core is halted -// DBG_TIM6_STOP TIM6 counter stopped when core is halted -// DBG_TIM5_STOP TIM5 counter stopped when core is halted -// DBG_TIM4_STOP TIM4 counter stopped when core is halted -// DBG_TIM3_STOP TIM3 counter stopped when core is halted -// DBG_TIM2_STOP TIM2 counter stopped when core is halted -// -DbgMCU_APB1_Fz = 0x00000000; - -// Debug MCU APB2 freeze register (DBGMCU_APB2_FZ) -// Reserved bits must be kept at reset value -// DBG_TIM11_STOP TIM11 counter stopped when core is halted -// DBG_TIM10_STOP TIM10 counter stopped when core is halted -// DBG_TIM9_STOP TIM9 counter stopped when core is halted -// DBG_TIM8_STOP TIM8 counter stopped when core is halted -// DBG_TIM1_STOP TIM1 counter stopped when core is halted -// -DbgMCU_APB2_Fz = 0x00000000; - -// <<< end of configuration section >>> \ No newline at end of file diff --git a/MDK-ARM/semi-finished_product_testing.uvoptx b/MDK-ARM/semi-finished_product_testing.uvoptx index a153d80..a41bed1 100644 --- a/MDK-ARM/semi-finished_product_testing.uvoptx +++ b/MDK-ARM/semi-finished_product_testing.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 @@ -U090F00028316303030303032 -O2254 -SF1000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC800 -FN1 -FF0STM32F4xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F407VGTx$CMSIS\Flash\STM32F4xx_1024.FLM) - + 0 @@ -328,19 +328,19 @@ 0 0 - - + + 0 0 0 - - - - - - - - + + + + + + + + 0 0 diff --git a/MDK-ARM/semi-finished_product_testing.uvprojx b/MDK-ARM/semi-finished_product_testing.uvprojx index 0f3605d..0416912 100644 --- a/MDK-ARM/semi-finished_product_testing.uvprojx +++ b/MDK-ARM/semi-finished_product_testing.uvprojx @@ -1,7 +1,10 @@ - - + + + 2.1 +
### uVision Project, (C) Keil Software
+ semi-finished_product_testing @@ -16,28 +19,28 @@ Keil.STM32F4xx_DFP.2.17.1 https://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 @@ -52,15 +55,15 @@ 1 1 0 - + 1 0 0 0 0 - - + + 0 0 0 @@ -69,8 +72,8 @@ 0 0 - - + + 0 0 0 @@ -79,15 +82,15 @@ 0 0 - - + + 0 0 0 0 1 - + 0 @@ -101,8 +104,8 @@ 0 0 3 - - + + 0 @@ -136,10 +139,10 @@ 1 BIN\UL2V8M.DLL "" () - - - - + + + + 0 @@ -172,7 +175,7 @@ 0 0 "Cortex-M4" - + 0 0 0 @@ -306,7 +309,7 @@ 0x4000 - + 1 @@ -333,9 +336,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/board/inc;../User/driver;../User/system @@ -351,9 +354,9 @@ 0 1 - - - + + + ../Core/Inc @@ -364,15 +367,15 @@ 0 1 0 - - - - - - - - - + + + + + + + + + @@ -1133,18 +1136,20 @@ + - + - + - + - + + @@ -1153,5 +1158,5 @@ -
+
diff --git a/MDK-ARM/semi-finished_product_testing/semi-finished_product_testing.hex b/MDK-ARM/semi-finished_product_testing/semi-finished_product_testing.hex index 238eac7..bb0cde4 100644 --- a/MDK-ARM/semi-finished_product_testing/semi-finished_product_testing.hex +++ b/MDK-ARM/semi-finished_product_testing/semi-finished_product_testing.hex @@ -727,7 +727,7 @@ :102D50000846006800F48050009000BF00BF00BF2C :102D60000020009010481438006840F002000E491E :102D7000143908600846006800F00200009000BFA7 -:102D800000BF382001900220029000200390032011 +:102D800000BF382001900220029001200390032010 :102D900004900520059001A90448FFF777F906B0D3 :102DA00010BD0000003001404438024000040240E1 :102DB0002DE9FF5F0446884691461D460E9E012080