活动介绍

stm32f1xx_hal_msp.c是啥模块的代码

时间: 2025-07-10 10:40:23 浏览: 12
<think>好的,我现在要回答用户关于stm32f1xx_hal_msp.c的问题。首先,我需要回忆一下STM32开发中的相关知识,特别是HAL库的结构和各个文件的作用。 用户问的是这个文件属于哪个模块,所以我需要明确MSP的概念。MSP应该是MCU Support Package的缩写,对吧?记得在STM32的HAL库中,MSP函数用于底层硬件初始化,比如GPIO、DMA、中断等。这些函数通常由HAL库中的驱动初始化函数调用,用来完成特定于MCU的配置。 接下来,stm32f1xx_hal_msp.c这个文件具体是做什么的呢?这个文件是用户编写的,用来实现HAL库所需的MSP回调函数。比如HAL_UART_MspInit()这样的函数,里面会配置UART所需的GPIO引脚、时钟使能、中断设置等。这个文件并不是库本身的一部分,而是用户根据具体硬件配置来定制的。 然后需要确认这个文件所属的模块。因为MSP函数涉及到硬件抽象层的底层支持,应该属于HAL库的一部分,更具体地说,属于HAL库中的MCU支持包模块。这个模块负责处理与具体MCU相关的硬件初始化,与HAL驱动层(如UART、SPI等)配合工作。 还要注意区分HAL库中的其他文件,比如stm32f1xx_hal.c是核心的HAL初始化文件,而各个外设的HAL驱动文件如stm32f1xx_hal_uart.c则包含通用的外设操作函数。MSP文件则是这些外设驱动在初始化时需要调用的底层函数,属于用户需要根据硬件实现的部分。 可能需要进一步解释这个文件的作用,比如在CubeMX生成的代码中,这个文件会被自动创建,并根据用户的引脚配置生成相应的初始化代码。用户也可以手动修改这个文件,添加自定义的硬件设置。 总结来说,stm32f1xx_hal_msp.c属于STM32 HAL库中的MCU支持包模块,负责处理与具体硬件相关的初始化和配置,用户需要根据实际硬件情况在此文件中实现相应的函数。</think>stm32f1xx_hal_msp.c 是 **STM32 HAL库中与MCU底层硬件支持相关的代码模块**,属于硬件抽象层(HAL)的组成部分。以下是逐步说明: --- ### 1. **模块定位** - **所属层级**:硬件抽象层(HAL)的底层支持模块 - **核心作用**:实现与具体MCU硬件相关的初始化配置(如GPIO、时钟、中断等),为HAL库的上层外设驱动(如UART、SPI等)提供硬件支持。 --- ### 2. **代码功能详解** #### (1) **MSP 含义** - **MSP = MCU Support Package**(微控制器支持包) - 负责处理与芯片硬件直接相关的操作,例如: - 外设时钟使能(如 `__HAL_RCC_GPIOA_CLK_ENABLE()`) - GPIO引脚配置(复用功能、上下拉等) - 中断优先级设置(NVIC配置) - DMA通道分配 #### (2) **典型函数** - `HAL_<外设>_MspInit()`:外设硬件初始化(如 `HAL_UART_MspInit()`) - `HAL_<外设>_MspDeInit()`:外设硬件反初始化(复位硬件状态) - 示例: ```c void HAL_UART_MspInit(UART_HandleTypeDef *huart) { // 1. 使能USART1时钟 __HAL_RCC_USART1_CLK_ENABLE(); // 2. 配置GPIO引脚PA9(TX)和PA10(RX) GPIO_InitStruct.Pin = GPIO_PIN_9 | GPIO_PIN_10; GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); // 3. 配置中断优先级 HAL_NVIC_SetPriority(USART1_IRQn, 0, 0); HAL_NVIC_EnableIRQ(USART1_IRQn); } ``` --- ### 3. **与HAL库的关系** - **依赖调用**:HAL库的外设初始化函数(如 `HAL_UART_Init()`)会自动调用对应的 `HAL_UART_MspInit()`。 - **用户定制**:用户需在此文件中根据实际硬件设计配置具体引脚和参数,而HAL库的外设驱动(如 `stm32f1xx_hal_uart.c`)负责通用逻辑。 --- ### 4. **开发场景** - **CubeMX生成**:使用STM32CubeMX工具配置外设时,会自动生成此文件并填充硬件初始化代码。 - **手动修改**:若硬件设计变更(如更换引脚),需在此文件中调整GPIO或时钟配置。 --- ### 5. **文件结构特点** - **非标准库文件**:此文件需要用户自行实现,不属于HAL库的预编译代码。 - **工程中的位置**:通常位于用户代码目录(如 `Src` 文件夹)而非库目录。 --- ### 总结 `stm32f1xx_hal_msp.c` 是 **HAL库与具体MCU硬件之间的桥梁**,将通用的外设驱动与硬件细节解耦。用户通过此文件实现硬件相关的底层配置,确保HAL库的上层函数能够正确操作实际硬件。
阅读全文

相关推荐

*** Using Compiler 'V5.06 update 3 (build 300)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin' Rebuild target 'takeatry' assembling startup_stm32f103xe.s... compiling main.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/main.c(4): error: #20: identifier "TASK_IDLE" is undefined TaskMode current_task = TASK_IDLE; ../Core/Src/main.c(27): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(27): error: #20: identifier "KEY1_PIN" is undefined if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(27): error: #20: identifier "KEY1_PORT" is undefined if (Key_Scan(KEY1_PIN, KEY1_PORT) && !task_running) { ../Core/Src/main.c(32): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(32): error: #20: identifier "KEY2_PIN" is undefined if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(32): error: #20: identifier "KEY2_PORT" is undefined if (Key_Scan(KEY2_PIN, KEY2_PORT) && !task_running) { ../Core/Src/main.c(37): warning: #223-D: function "Key_Scan" declared implicitly if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(37): error: #20: identifier "KEY3_PIN" is undefined if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(37): error: #20: identifier "KEY3_PORT" is undefined if (Key_Scan(KEY3_PIN, KEY3_PORT) && !task_running) { ../Core/Src/main.c(147): error: #159: declaration is incompatible with previous "Key_Scan" (declared at line 27) uint8_t Key_Scan(uint16_t pin, GPIO_TypeDef *port) { ../Core/Src/main.c(168): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/main.c: 5 warnings, 8 errors compiling stm32f1xx_hal_rcc_ex.c... compiling stm32f1xx_it.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/stm32f1xx_it.c: 1 warning, 0 errors compiling buzzer.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ buzzer.c(26): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ buzzer.c: 2 warnings, 0 errors compiling stm32f1xx_hal_gpio_ex.c... compiling stm32f1xx_hal.c... compiling motor.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ motor.c(51): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ motor.c: 2 warnings, 0 errors compiling gpio.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/gpio.c: 1 warning, 0 errors compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal_tim_ex.c... compiling sensor.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ sensor.c(65): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ sensor.c: 2 warnings, 0 errors compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_tim.c... compiling tim.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/tim.c: 1 warning, 0 errors compiling stm32f1xx_hal_msp.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/stm32f1xx_hal_msp.c: 1 warning, 0 errors compiling stm32f1xx_hal_dma.c... compiling stm32f1xx_hal_cortex.c... compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_flash_ex.c... compiling system_stm32f1xx.c... ../Core/Inc/main.h(49): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/system_stm32f1xx.c(67): warning: #1-D: last line of file ends without a newline /* ?募?末尾???? */ ../Core/Src/system_stm32f1xx.c: 2 warnings, 0 errors compiling stm32f1xx_hal_exti.c... "takeatry\takeatry.axf" - 8 Error(s), 17 Warning(s). Target not created. Build Time Elapsed: 00:02:10

/* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.c * @brief : Main program body ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Includes ------------------------------------------------------------------*/ #include "main.h" #include "gpio.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ RGBColor ledStrip[4][LED_PER_CHAIN]; /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD */ /* USER CODE END PTD */ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM */ /* USER CODE END PM */ /* Private variables ---------------------------------------------------------*/ /* USER CODE BEGIN PV */ /* USER CODE END PV */ /* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); /* USER CODE BEGIN PFP */ /* USER CODE END PFP */ /* Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ /** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ } /** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; /** Initializes the RCC Oscillators according to the specified parameters * in the RCC_OscInitTypeDef structure. */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; RCC_OscInitStruct.HSEState = RCC_HSE_ON; RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1; RCC_OscInitStruct.HSIState = RCC_HSI_ON; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB buses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) { Error_Handler(); } } /* USER CODE BEGIN 4 */ /* USER CODE END 4 */ /** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ __disable_irq(); while (1) { } /* USER CODE END Error_Handler_Debug */ } #ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT */ /* USER CODE BEGIN Header */ /** ****************************************************************************** * @file : main.h * @brief : Header for main.c file. * This file contains the common defines of the application. ****************************************************************************** * @attention * * Copyright (c) 2025 STMicroelectronics. * All rights reserved. * * This software is licensed under terms that can be found in the LICENSE file * in the root directory of this software component. * If no LICENSE file comes with this software, it is provided AS-IS. * ****************************************************************************** */ /* USER CODE END Header */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __MAIN_H #define __MAIN_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f1xx_hal.h" /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ /* Exported types ------------------------------------------------------------*/ /* USER CODE BEGIN ET */ /* USER CODE END ET */ /* Exported constants --------------------------------------------------------*/ /* USER CODE BEGIN EC */ /* USER CODE END EC */ /* Exported macro ------------------------------------------------------------*/ /* USER CODE BEGIN EM */ /* USER CODE END EM */ /* Exported functions prototypes ---------------------------------------------*/ void Error_Handler(void); /* USER CODE BEGIN EFP */ /* USER CODE END EFP */ /* Private defines -----------------------------------------------------------*/ /* USER CODE BEGIN Private defines */ /* USER CODE END Private defines */ #ifdef __cplusplus } #endif #endif /* __MAIN_H */ #ifndef WS2812_H#include "ws2812.h" #include "math.h" // 亮度调整参数 static uint8_t global_brightness = 100; // 亮度因子 static float brightness_factor = 1.0f; // 占空比定义 (72MHz时钟@ARR=71) #define PWM_HIGH 50 // 0.7µs高电平 #define PWM_LOW 25 // 0.35µs高电平 #define PWM_RESET 0 // 复位电平 // PWM数据缓冲区(按通道分组) static uint16_t pwmData[4][PWM_BUFFER_SIZE]; // Timer和DMA句柄 static TIM_HandleTypeDef* htim; static DMA_HandleTypeDef* hdma; static volatile uint8_t dma_busy = 0; // 通道配置 const WS2812_Channel channels[4] = { {NULL, TIM_CHANNEL_1, GPIO_PIN_0, GPIOA}, // PA0 {NULL, TIM_CHANNEL_2, GPIO_PIN_1, GPIOA}, // PA1 {NULL, TIM_CHANNEL_3, GPIO_PIN_2, GPIOA}, // PA2 {NULL, TIM_CHANNEL_4, GPIO_PIN_3, GPIOA} // PA3 }; // 初始化WS2812控制器 void WS2812_Init(TIM_HandleTypeDef* htim, DMA_HandleTypeDef* hdma) { htim = htim; hdma = hdma; // 设置所有通道初始状态 for (int i = 0; i < 4; i++) { HAL_GPIO_WritePin(channels[i].port, channels[i].pin, GPIO_PIN_RESET); } // 清除DMA状态 dma_busy = 0; } // 设置LED颜色(带亮度调整) void WS2812_SetColor(uint8_t ch, uint16_t index, RGBColor color) { if (ch >= 4 || index >= LED_PER_CHAIN) return; // 应用全局亮度 RGBColor adjColor = { .r = (uint8_t)(color.r * brightness_factor), .g = (uint8_t)(color.g * brightness_factor), .b = (uint8_t)(color.b * brightness_factor) }; // 转换为GRB格式 uint32_t grb = ((adjColor.g << 16) | (adjColor.r << 8) | adjColor.b); uint16_t* buf = pwmData[ch] + index * BIT_PER_LED; // 生成波形数据(高位先出) for(int i = 0; i < BIT_PER_LED; i++) { buf[i] = (grb & 0x800000) ? PWM_HIGH : PWM_LOW; grb <<= 1; } } // 设置全局亮度 (0-100) void WS2812_SetBrightness(uint8_t brightness) { if (brightness > 100) brightness = 100; global_brightness = brightness; // 亮度调整公式: // $$ \text{brightness_factor} = \sqrt{\frac{\text{brightness}}{100}} $$ brightness_factor = sqrtf((float)brightness / 100.0f); } // 启动DMA传输 void WS2812_StartDMATransfer(void) { // 配置DMA传输(TIM2_CCR寄存器连续地址) HAL_DMA_Start_IT( hdma, (uint32_t)&pwmData[0][0], (uint32_t)&htim->Instance->CCR1, DMA_TRANSFER_SIZE ); // 启用DMA请求 __HAL_TIM_ENABLE_DMA(htim, TIM_DMA_CC1 | TIM_DMA_CC2 | TIM_DMA_CC3 | TIM_DMA_CC4); __HAL_TIM_ENABLE(htim); dma_busy = 1; } // 更新LED显示 void WS2812_Update(void) { if (dma_busy) return; WS2812_StartDMATransfer(); } // 检查是否忙状态 uint8_t WS2812_IsBusy(void) { return dma_busy; } // DMA传输完成回调 void WS2812_DMACompleteCallback(void) { // 关闭定时器和DMA __HAL_TIM_DISABLE(htim); __HAL_TIM_DISABLE_DMA(htim, TIM_DMA_CC1 | TIM_DMA_CC2 | TIM_DMA_CC3 | TIM_DMA_CC4); // 所有引脚置低电平(产生复位信号) for (int i = 0; i < 4; i++) { HAL_GPIO_WritePin(channels[i].port, channels[i].pin, GPIO_PIN_RESET); } dma_busy = 0; } 22:42:50 **** 项目dengguang配置Debug的增量构建 **** make -j16 all arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o" arm-none-eabi-gcc "../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.d" -MT"Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o" arm-none-eabi-gcc "../Core/Src/gpio.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/gpio.d" -MT"Core/Src/gpio.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/gpio.o" arm-none-eabi-gcc "../Core/Src/main.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/main.d" -MT"Core/Src/main.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/main.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_hal_msp.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_hal_msp.d" -MT"Core/Src/stm32f1xx_hal_msp.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_hal_msp.o" arm-none-eabi-gcc "../Core/Src/stm32f1xx_it.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/stm32f1xx_it.d" -MT"Core/Src/stm32f1xx_it.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/stm32f1xx_it.o" arm-none-eabi-gcc "../Core/Src/syscalls.c" -mcpu=cortex-m3 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32F103xB -c -I../Core/Inc -I../Drivers/STM32F1xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32F1xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F1xx/Include -I../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -fcyclomatic-complexity -MMD -MP -MF"Core/Src/syscalls.d" -MT"Core/Src/syscalls.o" --specs=nano.specs -mfloat-abi=soft -mthumb -o "Core/Src/syscalls.o" ../Core/Src/main.c:25:1: error: unknown type name 'RGBColor' 25 | RGBColor ledStrip[4][LED_PER_CHAIN]; | ^~~~~~~~ ../Core/Src/main.c:25:22: error: 'LED_PER_CHAIN' undeclared here (not in a function) 25 | RGBColor ledStrip[4][LED_PER_CHAIN]; | ^~~~~~~~~~~~~ make: *** [Core/Src/subdir.mk:40: Core/Src/main.o] Error 1 make: *** Waiting for unfinished jobs.... "make -j16 all"以退出代码2结尾。构建可能不完整。 22:42:51 构建失败。 4 错误,0 警告。 (使用1s.155ms) #define WS2812_H #include "stm32f1xx_hal.h" // 每路LED数量(根据内存调整) #define LED_PER_CHAIN 30 // 每LED数据位数 (24位GRB) #define BIT_PER_LED 24 // PWM缓冲大小 #define PWM_BUFFER_SIZE (LED_PER_CHAIN * BIT_PER_LED) // 单个通道数据总数 #define DMA_TRANSFER_SIZE (PWM_BUFFER_SIZE * 4) // 4通道共享同一DMA请求 // LED颜色结构 typedef struct { uint8_t r; uint8_t g; uint8_t b; } RGBColor; // 通道配置结构 typedef struct { TIM_HandleTypeDef* timer; uint32_t channel; uint16_t pin; GPIO_TypeDef* port; } WS2812_Channel; // 初始化函数 void WS2812_Init(TIM_HandleTypeDef* htim, DMA_HandleTypeDef* hdma); // 设置LED颜色 void WS2812_SetColor(uint8_t ch, uint16_t index, RGBColor color); // 设置全局亮度 (0-100) void WS2812_SetBrightness(uint8_t brightness); // 更新LED显示 void WS2812_Update(void); // 复位完成标志 uint8_t WS2812_IsBusy(void); // DMA传输完成回调 void WS2812_DMACompleteCallback(void); #endif

../Core/Src/main.c(134): error: use of undeclared identifier 'Encode1Count' 134 | Encode1Count =(short)__HAL_TIM_GET_COUNTER(&htim4); | ^ ../Core/Src/main.c(135): error: use of undeclared identifier 'Encode2Count' 135 | Encode2Count =(short)__HAL_TIM_GET_COUNTER(&htim2); | ^ ../Core/Src/main.c(140): error: use of undeclared identifier 'Motor1Speed' 140 | Motor1Speed = (float)Encode1Count*100/9.6/11/4;//转<CB>伲<BA>Encode<A3><BF>Count为<B5><E7><BB><FA>1<B5>谋<E0><C2><EB><C6><F7><B5>募<C6><CA><FD>值,100为1000/<D1><D3>时<BA><AF><CA><FD><B5><C4>值(一<C3><EB><BC><C7><CA><FD><B5>拇<CE><CA><FD><A3><BA>1000<BA><C1><C3><EB>/<D1><D3>时<BA><AF><CA><FD>=100) | ^ ../Core/Src/main.c(140): error: use of undeclared identifier 'Encode1Count' 140 | Motor1Speed = (float)Encode1Count*100/9.6/11/4;//转<CB>伲<BA>Encode<A3><BF>Count为<B5><E7><BB><FA>1<B5>谋<E0><C2><EB><C6><F7><B5>募<C6><CA><FD>值,100为1000/<D1><D3>时<BA><AF><CA><FD><B5><C4>值(一<C3><EB><BC><C7><CA><FD><B5>拇<CE><CA><FD><A3><BA>1000<BA><C1><C3><EB>/<D1><D3>时<BA><AF><CA><FD>=100) | ^ ../Core/Src/main.c(141): error: use of undeclared identifier 'Motor2Speed' 141 | Motor2Speed = -(float)Encode2Count*100/9.6/11/4;//9.6为<B5><E7><BB><FA><B5>募<F5><CB>俦龋<AC>11为<B1><E0><C2><EB><C6><F7><CF><DF><CA><FD><A3><AC> 4为一<B8><F6><D6><DC><C6>诩<C7><CA><FD>4<B4>危<AC> 9.6*11*4为<BC><C7><CA><FD><B5><C4><C2><F6><B3><E5><CA><FD> | ^ ../Core/Src/main.c(141): error: use of undeclared identifier 'Encode2Count' 141 | Motor2Speed = -(float)Encode2Count*100/9.6/11/4;//9.6为<B5><E7><BB><FA><B5>募<F5><CB>俦龋<AC>11为<B1><E0><C2><EB><C6><F7><CF><DF><CA><FD><A3><AC> 4为一<B8><F6><D6><DC><C6>诩<C7><CA><FD>4<B4>危<AC> 9.6*11*4为<BC><C7><CA><FD><B5><C4><C2><F6><B3><E5><CA><FD> | ^ ../Core/Src/main.c(143): error: use of undeclared identifier 'Motor1Speed'; did you mean 'Motor_Set'? 143 | printf("Motor1Speed:%.2f\r\n",Motor1Speed); | ^~~~~~~~~~~ | Motor_Set ../HARDWARE/MOTOR\Motor.h(16): note: 'Motor_Set' declared here 16 | void Motor_Set(int Motor1,int Motor2); | ^ ../Core/Src/main.c(144): error: use of undeclared identifier 'Motor2Speed'; did you mean 'Motor_Set'? 144 | printf("Motor2Speed:%.2f\r\n",Motor2Speed); | ^~~~~~~~~~~ | Motor_Set ../HARDWARE/MOTOR\Motor.h(16): note: 'Motor_Set' declared here 16 | void Motor_Set(int Motor1,int Motor2); | ^ 8 errors generated. compiling main.c... compiling stm32f1xx_hal_msp.c... assembling startup_stm32f103xb.s... compiling stm32f1xx_hal.c... compiling stm32f1xx_hal_rcc_ex.c... compiling gpio.c... compiling stm32f1xx_it.c... compiling usart.c... compiling stm32f1xx_hal_gpio_ex.c... compiling tim.c... compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal_tim_ex.c... compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_exti.c... compiling system_stm32f1xx.c... compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_cortex.c... compiling stm32f1xx_hal_flash_ex.c... compiling motor.c... compiling stm32f1xx_hal_dma.c... compiling oled.c... compiling stm32f1xx_hal_tim.c... compiling stm32f1xx_hal_uart.c... "LED\LED.axf" - 8 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:01

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'E:\Keil5\ARM\ARMCC\Bin' Build target 'OLED' compiling stm32f4xx_ll_adc.c... compiling stm32f4xx_hal_pwr.c... assembling startup_stm32f411xe.s... compiling oled.c... ..\Core\Src\oled.c(23): error: #20: identifier "OLED_DC_GPIO_Port" is undefined LED_DC_Set();//命令/数据标志位置为1,则表示传送的是命令字节 ..\Core\Src\oled.c(23): error: #20: identifier "OLED_DC_Pin" is undefined LED_DC_Set();//命令/数据标志位置为1,则表示传送的是命令字节 ..\Core\Src\oled.c(26): error: #20: identifier "OLED_DC_GPIO_Port" is undefined LED_DC_Clr();//命令/数据标志位置为0,则表示传送的是数据字节 ..\Core\Src\oled.c(26): error: #20: identifier "OLED_DC_Pin" is undefined LED_DC_Clr();//命令/数据标志位置为0,则表示传送的是数据字节 ..\Core\Src\oled.c(27): error: #20: identifier "OLED_CS_GPIO_Port" is undefined LED_CS_Clr();//片选信号为低,表示选中OLED ..\Core\Src\oled.c(27): error: #20: identifier "OLED_CS_Pin" is undefined LED_CS_Clr();//片选信号为低,表示选中OLED ..\Core\Src\oled.c(30): error: #20: identifier "OLED_DC_GPIO_Port" is undefined LED_DC_Set(); ..\Core\Src\oled.c(30): error: #20: identifier "OLED_DC_Pin" is undefined LED_DC_Set(); ..\Core\Src\oled.c(243): error: #20: identifier "OLED_RST_GPIO_Port" is undefined LED_RST_Clr(); ..\Core\Src\oled.c(243): error: #20: identifier "OLED_RST_Pin" is undefined LED_RST_Clr(); ..\Core\Src\oled.c: 0 warnings, 10 errors compiling gpio.c... ../Core/Src/gpio.c(96): error: #20: identifier "OLED_CS_GPIO_Port" is undefined HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_RESET); ../Core/Src/gpio.c(96): error: #20: identifier "OLED_CS_Pin" is undefined HAL_GPIO_WritePin(OLED_CS_GPIO_Port, OLED_CS_Pin, GPIO_PIN_RESET); ../Core/Src/gpio.c(99): error: #20: identifier "OLED_RST_Pin" is undefined HAL_GPIO_WritePin( PIOB, OLED_RST_Pin|OLED_DC_Pin, GPIO_PIN_RESET); ../Core/Src/gpio.c(99): error: #20: identifier "OLED_DC_Pin" is undefined HAL_GPIO_WritePin( PIOB, OLED_RST_Pin|OLED_DC_Pin, GPIO_PIN_RESET); ../Core/Src/gpio.c: 0 warnings, 4 errors compiling i2c.c... ../Core/Inc/i2c.h(34): error: #20: identifier "I2C_HandleTypeDef" is undefined extern I2C_HandleTypeDef hi2c1; i2c.c(27): error: #20: identifier "I2C_HandleTypeDef" is undefined I2C_HandleTypeDef hi2c1; i2c.c(35): error: #20: identifier "I2C_DUTYCYCLE_2" is undefined hi2c1.Init.DutyCycle = I2C_DUTYCYCLE_2; i2c.c(37): error: #20: identifier "I2C_ADDRESSINGMODE_7BIT" is undefined hi2c1.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT; i2c.c(38): error: #20: identifier "I2C_DUALADDRESS_DISABLE" is undefined hi2c1.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE; i2c.c(40): error: #20: identifier "I2C_GENERALCALL_DISABLE" is undefined hi2c1.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE; i2c.c(41): error: #20: identifier "I2C_NOSTRETCH_DISABLE" is undefined hi2c1.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE; i2c.c(42): warning: #223-D: function "HAL_I2C_Init" declared implicitly if (HAL_I2C_Init(&hi2c1) != HAL_OK) i2c.c(49): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspInit(I2C_HandleTypeDef* i2cHandle) i2c.c(79): error: #20: identifier "I2C_HandleTypeDef" is undefined void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle) i2c.c(108): warning: #1-D: last line of file ends without a newline /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ i2c.c: 2 warnings, 9 errors compiling stm32f4xx_hal_rtc_ex.c... compiling stm32f4xx_hal_cortex.c... compiling stm32f4xx_hal_spi.c... compiling stm32f4xx_hal_flash_ramfunc.c... compiling stm32f4xx_hal.c... compiling stm32f4xx_hal_adc.c... compiling tim.c... compiling stm32f4xx_hal_dma_ex.c... compiling usart.c... compiling stm32f4xx_hal_flash.c... compiling stm32f4xx_hal_rcc.c... compiling adc.c... compiling stm32f4xx_hal_exti.c... compiling main.c... ../Core/Src/main.c(289): warning: #177-D: variable "i" was declared but never referenced int i,j; ../Core/Src/main.c(371): warning: #1035-D: single-precision operand implicitly converted to double-precision Res_1 = ( ( (float)adc_values[1] ) / ( (float)adc_values[0] )-1.0)*708; ../Core/Src/main.c(375): warning: #1035-D: single-precision operand implicitly converted to double-precision Res_2 = (int)(( ( (float)adc_values[1] ) / ( (float)adc_values[0] )-1.0)*475000); ../Core/Src/main.c(503): warning: #1035-D: single-precision operand implicitly converted to double-precision Esr = ( ( (float)adc_values[1] ) / ( (float)adc_values[0] )-1.0)*708; ../Core/Src/main.c(489): warning: #550-D: variable "adcget1" was set but never used uint32_t adcget1, adcget2, adc_values[2]; ../Core/Src/main.c(489): warning: #550-D: variable "adcget2" was set but never used uint32_t adcget1, adcget2, adc_values[2]; ../Core/Src/main.c(490): warning: #177-D: variable "Res" was declared but never referenced float Res,Esr; ../Core/Src/main.c: 7 warnings, 0 errors compiling spi.c... compiling stm32f4xx_it.c... compiling stm32f4xx_hal_dma.c... compiling stm32f4xx_hal_pwr_ex.c... compiling stm32f4xx_hal_rtc.c... compiling stm32f4xx_hal_gpio.c... compiling stm32f4xx_hal_rcc_ex.c... compiling stm32f4xx_hal_flash_ex.c... compiling stm32f4xx_hal_adc_ex.c... compiling stm32f4xx_hal_msp.c... compiling rtc.c... compiling stm32f4xx_hal_tim_ex.c... compiling stm32f4xx_hal_tim.c... compiling stm32f4xx_hal_uart.c... compiling system_stm32f4xx.c... "OLED\OLED.axf" - 23 Error(s), 9 Warning(s). Target not created. Build Time Elapsed: 00:02:10

Rebuild started: Project: lsd *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'D:\keil5\ARM\ARMCC\Bin' Rebuild target 'Template' assembling startup_stm32f103xe.s... compiling IWGA.c... ..\..\Drivers\IWGA\IWGA.c(1): error: #5: cannot open source input file "./IWGA/IWGA.h": No such file or directory #include "./IWGA/IWGA.h" ..\..\Drivers\IWGA\IWGA.c: 0 warnings, 1 error compiling stm32f1xx_hal_dac_ex.c... compiling stm32f1xx_it.c... compiling stm32f1xx_hal_eth.c... compiling stm32f1xx_hal_cortex.c... compiling delay.c... compiling stm32f1xx_hal_cec.c... compiling main.c... compiling stm32f1xx_hal_gpio_ex.c... compiling usart.c... compiling sys.c... compiling stm32f1xx_hal_dac.c... compiling stm32f1xx_hal_crc.c... compiling stm32f1xx_hal.c... compiling stm32f1xx_hal_adc.c... compiling system_stm32f1xx.c... compiling stm32f1xx_hal_adc_ex.c... compiling stm32f1xx_hal_exti.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_hcd.c... compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_can.c... compiling stm32f1xx_hal_flash_ex.c... compiling stm32f1xx_hal_dma.c... compiling stm32f1xx_hal_i2c.c... compiling stm32f1xx_hal_iwdg.c... compiling stm32f1xx_hal_msp_template.c... compiling stm32f1xx_hal_pcd_ex.c... compiling stm32f1xx_hal_rcc_ex.c... compiling stm32f1xx_hal_i2s.c... compiling stm32f1xx_hal_nand.c... compiling stm32f1xx_hal_irda.c... compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_pccard.c... compiling stm32f1xx_hal_nor.c... compiling stm32f1xx_hal_pcd.c... compiling stm32f1xx_hal_rtc.c... compiling stm32f1xx_hal_rtc_ex.c... compiling stm32f1xx_hal_sram.c... compiling stm32f1xx_hal_smartcard.c... compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal_timebase_tim_template.c... compiling stm32f1xx_hal_mmc.c... compiling stm32f1xx_ll_adc.c... compiling stm32f1xx_hal_usart.c... compiling stm32f1xx_hal_uart.c... compiling stm32f1xx_ll_crc.c... compiling stm32f1xx_ll_dac.c... compiling stm32f1xx_ll_dma.c... compiling stm32f1xx_ll_exti.c... compiling stm32f1xx_ll_gpio.c... compiling stm32f1xx_hal_spi.c... compiling stm32f1xx_hal_tim_ex.c... compiling stm32f1xx_hal_sd.c... compiling stm32f1xx_ll_i2c.c... compiling stm32f1xx_ll_pwr.c... compiling stm32f1xx_ll_rcc.c... compiling stm32f1xx_ll_rtc.c... compiling stm32f1xx_ll_spi.c... compiling stm32f1xx_ll_tim.c... compiling stm32f1xx_ll_usart.c... compiling stm32f1xx_hal_tim.c... compiling stm32f1xx_hal_wwdg.c... compiling stm32f1xx_ll_fsmc.c... compiling stm32f1xx_ll_sdmmc.c... compiling stm32f1xx_ll_utils.c... compiling stm32f1xx_ll_usb.c... ".\Objects\lsd.axf" - 1 Error(s), 0 Warning(s). Target not created. Build Time Elapsed: 00:00:07什么问题怎么解决

Build started: Project: SimpleUARTRx *** Using Compiler '', folder: 'D:\Keil_v5\ARM\ARMCC\bin\' Build target 'SimpleUARTRx' assembling startup_stm32f103xb.s... compiling stm32f1xx_hal_tim_ex.c... compiling stm32f1xx_hal_tim.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_msp.c... compiling stm32f1xx_hal_gpio_ex.c... compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal_dma.c... compiling stm32f1xx_hal_cortex.c... compiling stm32f1xx_it.c... compiling stm32f1xx_hal_rcc_ex.c... compiling main.c... ../Core/Src/main.c(99): error: #167: argument of type "UART_HandleTypeDef" is incompatible with parameter of type "UART_HandleTypeDef *" HAL_UART_Receive(huart1,&dataRcvd,1, AL_MAX_DELAY); ../Core/Src/main.c(120): error: #65: expected a ";" { ../Core/Src/main.c(141): warning: #12-D: parsing restarts here after previous syntax error RCC_ClkInitStruct.APB1CLKDivider = CC_HCLK_DIV1; ../Core/Src/main.c(142): warning: #111-D: statement is unreachable RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; ../Core/Src/main.c(142): error: #20: identifier "RCC_ClkInitStruct" is undefined RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; ../Core/Src/main.c(244): warning: #1-D: last line of file ends without a newline } ../Core/Src/main.c(244): error: #169: expected a declaration } ../Core/Src/main.c: 3 warnings, 4 errors compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_flash_ex.c... compiling stm32f1xx_hal.c... compiling stm32f1xx_hal_uart.c... compiling system_stm32f1xx.c... compiling stm32f1xx_hal_exti.c... "SimpleUARTRx\SimpleUARTRx.axf" - 4 Error(s), 3 Warning(s). Target not created. Build Time Elapsed: 00:00:02

[1/1] Linking C executable XSSS.elf FAILED: XSSS.elf : && /opt/homebrew/bin/arm-none-eabi-gcc -g -Wl,-gc-sections,--print-memory-usage,-Map=/Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug/XSSS.map -mcpu=cortex-m3 -mthumb -mthumb-interwork -T /Users/mac/Desktop/NewFolder/XSSS/STM32F103VETX_FLASH.ld CMakeFiles/XSSS.elf.dir/Core/Src/gpio.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/lcd1602.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/main.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/stm32f1xx_hal_msp.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/stm32f1xx_it.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/syscalls.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/sysmem.c.obj CMakeFiles/XSSS.elf.dir/Core/Src/system_stm32f1xx.c.obj CMakeFiles/XSSS.elf.dir/Core/Startup/startup_stm32f103vetx.s.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c.obj CMakeFiles/XSSS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c.obj -o XSSS.elf && cd /Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug && arm-none-eabi-objcopy -Oihex /Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug/XSSS.elf /Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug/XSSS.hex && arm-none-eabi-objcopy -Obinary /Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug/XSSS.elf /Users/mac/Desktop/NewFolder/XSSS/cmake-build-debug/XSSS.bin /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/XSSS.elf.dir/Core/Src/main.c.obj: in function main': /Users/mac/Desktop/NewFolder/XSSS/Core/Src/main.c:92:(.text.main+0x1c): undefined reference to LCD_SetCursor'

==================[ 构建 | Project | Debug ]==================================== /Users/mac/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /Users/mac/Desktop/Project/cmake-build-debug --target Project -j 6 [1/1] Linking C executable Project.elf FAILED: Project.elf : && /opt/homebrew/bin/arm-none-eabi-gcc -mcpu=cortex-m3 -Wall -Wextra -Wpedantic -fdata-sections -ffunction-sections -O0 -g3 -mcpu=cortex-m3 -T "/Users/mac/Desktop/Project/STM32F103XX_FLASH.ld" --specs=nano.specs -Wl,-Map=Project.map -Wl,--gc-sections -Wl,--start-group -lc -lm -Wl,--end-group -Wl,--print-memory-usage cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Core/Src/system_stm32f1xx.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c.obj cmake/stm32cubemx/CMakeFiles/STM32_Drivers.dir/__/__/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c.obj CMakeFiles/Project.dir/Core/Src/main.c.obj CMakeFiles/Project.dir/Core/Src/gpio.c.obj CMakeFiles/Project.dir/Core/Src/rtc.c.obj CMakeFiles/Project.dir/Core/Src/stm32f1xx_it.c.obj CMakeFiles/Project.dir/Core/Src/stm32f1xx_hal_msp.c.obj CMakeFiles/Project.dir/Core/Src/sysmem.c.obj CMakeFiles/Project.dir/Core/Src/syscalls.c.obj CMakeFiles/Project.dir/startup_stm32f103xe.s.obj -o Project.elf && : /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/Project.dir/Core/Src/gpio.c.obj: in function MX_GPIO_Init': /Users/mac/Desktop/Project/Core/Src/gpio.c:45: multiple definition of MX_GPIO_Init'; CMakeFiles/Project.dir/Core/Src/main.c.obj:/Users/mac/Desktop/Project/Core/Src/main.c:185: first defined here /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/Project.dir/Core/Src/main.c.obj: in function MX_TIM2_Init': /Users/mac/Desktop/Project/Core/Src/main.c:181:(.text.MX_TIM2_Init+0x28): undefined reference to HAL_TIM_Base_Init' Memory region Used Size Region Size %age Used RAM: 1672 B 64 KB 2.55% FLASH: 6556 B 512 KB 1.25% collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.

*** Using Compiler 'V5.06 update 5 (build 528)', folder: 'D:\Keil_v5\ARM\ARMCC\Bin' Build target 'APP' assembling startup_stm32f103xb.s... compiling stm32f1xx_it.c... ../Core/Src/stm32f1xx_it.c(247): error: #20: identifier "UART_CLEAR_NEF" is undefined _HAL_UART_CLEAR_FLAG(&huart1, UART_CLEAR_NEF); // 清除中断标志[^1] ../Core/Src/stm32f1xx_it.c: 0 warnings, 1 error compiling main.c... ../Core/Src/main.c(98): error: #20: identifier "hdma_usart1_tx" is undefined NABLE_DMA(); // 启用自定义DMA配置 ../Core/Src/main.c(111): warning: #223-D: function "task_run" declared implicitly task_run(); ../Core/Src/main.c: 1 warning, 1 error compiling dma.c... ../Core/Src/dma.c(42): error: #65: expected a ";" void Custom_DMA_Config(DMA_HandleTypeDef *hdma) { ../Core/Src/dma.c(56): warning: #12-D: parsing restarts here after previous syntax error HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0); ../Core/Src/dma.c: 1 warning, 1 error compiling usart.c... ../Core/Src/usart.c(27): error: #148: variable "rx_flag" has already been initialized volatile uint8_t rx_flag = 0; ../Core/Src/usart.c(31): error: #148: variable "rx_length" has already been initialized uint16_t rx_length = 0; ../Core/Src/usart.c(32): error: #147: declaration is incompatible with "uint8_t rx_buffer[256]" (declared at line 32 of "../APP/bsp.h") extern uint8_t rx_buffer[128]; ../Core/Src/usart.c(63): error: #18: expected a ")" HAL_UART_Receive_IT(&huart1,uart_rx_buffer,1 sizeof(rx_buffer)); ../Core/Src/usart.c: 0 warnings, 4 errors compiling stm32f1xx_hal_msp.c... compiling gpio.c... compiling tim.c... compiling stm32f1xx_hal_gpio_ex.c... compiling stm32f1xx_hal_rcc_ex.c... compiling stm32f1xx_hal_rcc.c... compiling stm32f1xx_hal.c... compiling stm32f1xx_hal_gpio.c... compiling stm32f1xx_hal_tim_ex.c... compiling stm32f1xx_hal_tim.c... compiling stm32f1xx_hal_dma.c... compiling stm32f1xx_hal_cortex.c... compiling stm32f1xx_hal_pwr.c... compiling stm32f1xx_hal_exti.c... compiling stm32f1xx_hal_flash.c... compiling stm32f1xx_hal_flash_ex.c... compiling stm32f1xx_hal_uart.c... compiling periph.c... compiling uart_app.c... ..\APP\uart_app.c(3): error: #20: identifier "UART_HandLeTypeDef" is undefined void HAL_UART_TxCpLtCallback(UART_HandLeTypeDef *huart) ..\APP\uart_app.c(15): error: #7: unrecognized token if(uart_rx_index == 0)return; ..\APP\uart_app.c(15): error: #125: expected a "(" if(uart_rx_index == 0)return; ..\APP\uart_app.c(15): error: #7: unrecognized token if(uart_rx_index == 0)return; ..\APP\uart_app.c(25): warning: #1-D: last line of file ends without a newline } ..\APP\uart_app.c: 1 warning, 4 errors compiling system_stm32f1xx.c... compiling system.c... compiling schedule.c... ..\APP\schedule.c(64): warning: #1-D: last line of file ends without a newline ..\APP\schedule.c: 1 warning, 0 errors compiling logic.c... "APP\APP.axf" - 11 Error(s), 4 Warning(s). Target not created. Build Time Elapsed: 00:00:17

====================[ 构建 | XXS.elf | Debug ]==================================== /Users/mac/Applications/CLion.app/Contents/bin/cmake/mac/aarch64/bin/cmake --build /Users/mac/Desktop/NewFolder/XXS_副本/cmake-build-debug --target XXS.elf -- -j 6 [ 14%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/syscalls.c.obj [ 14%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/main.c.obj [ 14%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/LCD1602.c.obj [ 19%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/stm32f1xx_hal_msp.c.obj [ 23%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/gpio.c.obj [ 28%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/stm32f1xx_it.c.obj [ 33%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/sysmem.c.obj [ 38%] Building ASM object CMakeFiles/XXS.elf.dir/Core/Startup/startup_stm32f103vetx.s.obj [ 47%] Building C object CMakeFiles/XXS.elf.dir/Core/Src/system_stm32f1xx.c.obj [ 47%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c.obj [ 52%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c.obj [ 57%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c.obj [ 61%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.c.obj [ 66%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c.obj [ 71%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c.obj [ 76%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c.obj [ 80%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c.obj [ 85%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c.obj [ 90%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c.obj [ 95%] Building C object CMakeFiles/XXS.elf.dir/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c.obj [100%] Linking C executable XXS.elf /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/XXS.elf.dir/Core/Src/main.c.obj: in function main': /Users/mac/Desktop/NewFolder/XXS_副本/Core/Src/main.c:94:(.text.main+0x1c): undefined reference to LCD_Clear' /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: /Users/mac/Desktop/NewFolder/XXS_副本/Core/Src/main.c:99:(.text.main+0x2e): undefined reference to LCD_WriteString' /Applications/ArmGNUToolchain/14.2.rel1/arm-none-eabi/bin/../lib/gcc/arm-none-eabi/14.2.1/../../../../arm-none-eabi/bin/ld: /Users/mac/Desktop/NewFolder/XXS_副本/Core/Src/main.c:102:(.text.main+0x42): undefined reference to LCD_WriteString' Memory region Used Size Region Size %age Used RAM: 1992 B 64 KB 3.04% FLASH: 4508 B 512 KB 0.86% collect2: error: ld returned 1 exit status make[3]: *** [XXS.elf] Error 1 make[2]: *** [CMakeFiles/XXS.elf.dir/all] Error 2 make[1]: *** [CMakeFiles/XXS.elf.dir/rule] Error 2 make: *** [XXS.elf] Error 2

大家在看

recommend-type

ELEC5208 Group project submissions.zip_furniturer4m_smart grid_悉

悉尼大学ELEC5208智能电网project的很多组的报告和code都在里面,供学习和参考
recommend-type

基于python单通道脑电信号的自动睡眠分期研究

【作品名称】:基于python单通道脑电信号的自动睡眠分期研究 【适用人群】:适用于希望学习不同技术领域的小白或进阶学习者。可作为毕设项目、课程设计、大作业、工程实训或初期项目立项。 【项目介绍】:网络结构(具体可查看network.py文件): 网络整体结构类似于TinySleepNet,对RNN部分进行了修改,增加了双向RNN、GRU、Attention等网络结构,可根据参数进行调整选择。 定义了seq_len参数,可以更灵活地调整batch_size与seq_len。 数据集加载(具体可查看dataset.py文件) 直接继承自torch的Dataset,并定义了seq_len和shuffle_seed,方便调整输入,并复现实验。 训练(具体可查看train.py文件): 定义并使用了focal loss损失函数 在实验中有使用wandb,感觉用起来还挺方便的,非常便于实验记录追溯 测试(具体可查看test.py文件): 可以输出accuracy、mf1、recall_confusion_matrics、precision_confusion_matrics、f1
recommend-type

bid格式文件电子标书阅读器.zip

软件介绍: bid格式招投标文件阅读器,可以打开浏览、管理电子招标文件,如果打不开标书文件,请按下面步骤检查:1、请查看招标文件(.bid文件)是否下载完全,请用IE下载工具下载;2、查看IE浏览器版本,如果版本低于IE8,低于IE8版本的请升级为IE8浏览器。
recommend-type

机器翻译WMT14数据集

机器翻译WMT14数据集,ACL2014公布的share task,很多模型都在这上benchmark
recommend-type

高通QXDM使用手册.pdf

高通QXDM使用手册,介绍高通QXDM工具软件的使用,中文版的哦。

最新推荐

recommend-type

C#类库封装:简化SDK调用实现多功能集成,构建地磅无人值守系统

内容概要:本文介绍了利用C#类库封装多个硬件设备的SDK接口,实现一系列复杂功能的一键式调用。具体功能包括身份证信息读取、人证识别、车牌识别(支持臻识和海康摄像头)、LED显示屏文字输出、称重数据读取、二维码扫描以及语音播报。所有功能均被封装为简单的API,极大降低了开发者的工作量和技术门槛。文中详细展示了各个功能的具体实现方式及其应用场景,如身份证读取、人证核验、车牌识别等,并最终将这些功能整合到一起,形成了一套完整的地磅称重无人值守系统解决方案。 适合人群:具有一定C#编程经验的技术人员,尤其是需要快速集成多种硬件设备SDK的应用开发者。 使用场景及目标:适用于需要高效集成多种硬件设备SDK的项目,特别是那些涉及身份验证、车辆管理、物流仓储等领域的企业级应用。通过使用这些封装好的API,可以大大缩短开发周期,降低维护成本,提高系统的稳定性和易用性。 其他说明:虽然封装后的API极大地简化了开发流程,但对于一些特殊的业务需求,仍然可能需要深入研究底层SDK。此外,在实际部署过程中,还需考虑网络环境、硬件兼容性等因素的影响。
recommend-type

Teleport Pro教程:轻松复制网站内容

标题中提到的“复制别人网站的软件”指向的是一种能够下载整个网站或者网站的特定部分,然后在本地或者另一个服务器上重建该网站的技术或工具。这类软件通常被称作网站克隆工具或者网站镜像工具。 描述中提到了一个具体的教程网址,并提到了“天天给力信誉店”,这可能意味着有相关的教程或资源可以在这个网店中获取。但是这里并没有提供实际的教程内容,仅给出了网店的链接。需要注意的是,根据互联网法律法规,复制他人网站内容并用于自己的商业目的可能构成侵权,因此在此类工具的使用中需要谨慎,并确保遵守相关法律法规。 标签“复制 别人 网站 软件”明确指出了这个工具的主要功能,即复制他人网站的软件。 文件名称列表中列出了“Teleport Pro”,这是一款具体的网站下载工具。Teleport Pro是由Tennyson Maxwell公司开发的网站镜像工具,允许用户下载一个网站的本地副本,包括HTML页面、图片和其他资源文件。用户可以通过指定开始的URL,并设置各种选项来决定下载网站的哪些部分。该工具能够帮助开发者、设计师或内容分析人员在没有互联网连接的情况下对网站进行离线浏览和分析。 从知识点的角度来看,Teleport Pro作为一个网站克隆工具,具备以下功能和知识点: 1. 网站下载:Teleport Pro可以下载整个网站或特定网页。用户可以设定下载的深度,例如仅下载首页及其链接的页面,或者下载所有可访问的页面。 2. 断点续传:如果在下载过程中发生中断,Teleport Pro可以从中断的地方继续下载,无需重新开始。 3. 过滤器设置:用户可以根据特定的规则过滤下载内容,如排除某些文件类型或域名。 4. 网站结构分析:Teleport Pro可以分析网站的链接结构,并允许用户查看网站的结构图。 5. 自定义下载:用户可以自定义下载任务,例如仅下载图片、视频或其他特定类型的文件。 6. 多任务处理:Teleport Pro支持多线程下载,用户可以同时启动多个下载任务来提高效率。 7. 编辑和管理下载内容:Teleport Pro具备编辑网站镜像的能力,并可以查看、修改下载的文件。 8. 离线浏览:下载的网站可以在离线状态下浏览,这对于需要测试网站在不同环境下的表现的情况十分有用。 9. 备份功能:Teleport Pro可以用来备份网站,确保重要数据的安全。 在实际使用此类工具时,需要注意以下几点: - 著作权法:复制网站内容可能侵犯原作者的版权,因此在使用此类工具时,必须确保有合法权利去下载和使用目标网站的内容。 - 服务条款:许多网站的服务条款明确禁止未经授权的网站克隆。因此,在使用此类软件之前,应当仔细阅读并遵守目标网站的服务条款。 - 数据隐私:下载含有个人数据的网站可能触及隐私保护法律,特别是在欧洲通用数据保护条例(GDPR)等法规的环境下。 - 网络安全:随意下载网站可能导致恶意软件和病毒的传播,用户应当使用最新的反病毒软件,并在安全的环境中进行操作。 综上所述,虽然“复制别人网站的软件”在技术上是可行的,且可以用于多种正当目的,但在使用此类工具时,必须遵守法律法规和道德规范,不可侵犯他人的合法权益。
recommend-type

【跨平台开发者的必读】:解决Qt5Widgetsd.lib目标计算机类型冲突终极指南

# 1. 跨平台开发与Qt框架简介 跨平台开发已经成为现代软件开发中不可或缺的一部分,它使得开发者能够构建出能够在多种操作系统上运行的应用程序,从而触及更广泛的用户群体。在这其中,Qt框架作为一套成熟的跨平台应用程序和用户界面框架,扮演着关键角色。Qt不仅仅是一个跨平台的工具集,它的设计哲学还包含了模块化和可扩展性,使其能够适应各种规模和复杂度的项目。本章节我们将简要介绍
recommend-type

普通RNN结构和特点

<think>首先,用户的问题是:“我想了解普通RNN的结构及其特点请问RNN循环神经网络结构特点工作原理”。这涉及到RNN的结构、特点和工作原理。根据系统级指令:-所有行内数学表达式必须使用$...$格式。-独立公式必须使用$$...$$格式并单独成段。-LaTeX语法正确。-使用中文回答。-生成相关问题。-回答中引用的段落末尾自然地添加引用标识。用户可见层指令:-回答结构清晰,帮助用户逐步解决问题。-保证回答真实可靠。参考站内引用:-引用[1]:关于RNN的基本介绍,为什么需要RNN。-引用[2]:关于RNN的工作原理、结构图,以及与其他网络的比较。用户上一次的问题和我的回答:用户是第一次
recommend-type

探讨通用数据连接池的核心机制与应用

根据给定的信息,我们能够推断出讨论的主题是“通用数据连接池”,这是一个在软件开发和数据库管理中经常用到的重要概念。在这个主题下,我们可以详细阐述以下几个知识点: 1. **连接池的定义**: 连接池是一种用于管理数据库连接的技术,通过维护一定数量的数据库连接,使得连接的创建和销毁操作更加高效。开发者可以在应用程序启动时预先创建一定数量的连接,并将它们保存在一个池中,当需要数据库连接时,可以直接从池中获取,从而降低数据库连接的开销。 2. **通用数据连接池的概念**: 当提到“通用数据连接池”时,它意味着这种连接池不仅支持单一类型的数据库(如MySQL、Oracle等),而且能够适应多种不同数据库系统。设计一个通用的数据连接池通常需要抽象出一套通用的接口和协议,使得连接池可以兼容不同的数据库驱动和连接方式。 3. **连接池的优点**: - **提升性能**:由于数据库连接创建是一个耗时的操作,连接池能够减少应用程序建立新连接的时间,从而提高性能。 - **资源复用**:数据库连接是昂贵的资源,通过连接池,可以最大化现有连接的使用,避免了连接频繁创建和销毁导致的资源浪费。 - **控制并发连接数**:连接池可以限制对数据库的并发访问,防止过载,确保数据库系统的稳定运行。 4. **连接池的关键参数**: - **最大连接数**:池中能够创建的最大连接数。 - **最小空闲连接数**:池中保持的最小空闲连接数,以应对突发的连接请求。 - **连接超时时间**:连接在池中保持空闲的最大时间。 - **事务处理**:连接池需要能够管理不同事务的上下文,保证事务的正确执行。 5. **实现通用数据连接池的挑战**: 实现一个通用的连接池需要考虑到不同数据库的连接协议和操作差异。例如,不同的数据库可能有不同的SQL方言、认证机制、连接属性设置等。因此,通用连接池需要能够提供足够的灵活性,允许用户配置特定数据库的参数。 6. **数据连接池的应用场景**: - **Web应用**:在Web应用中,为了处理大量的用户请求,数据库连接池可以保证数据库连接的快速复用。 - **批处理应用**:在需要大量读写数据库的批处理作业中,连接池有助于提高整体作业的效率。 - **微服务架构**:在微服务架构中,每个服务可能都需要与数据库进行交互,通用连接池能够帮助简化服务的数据库连接管理。 7. **常见的通用数据连接池技术**: - **Apache DBCP**:Apache的一个Java数据库连接池库。 - **C3P0**:一个提供数据库连接池和控制工具的开源Java框架。 - **HikariCP**:目前性能最好的开源Java数据库连接池之一。 - **BoneCP**:一个高性能的开源Java数据库连接池。 - **Druid**:阿里巴巴开源的一个数据库连接池,提供了对性能监控的高级特性。 8. **连接池的管理与监控**: 为了保证连接池的稳定运行,开发者需要对连接池的状态进行监控,并对其进行适当的管理。监控指标可能包括当前活动的连接数、空闲的连接数、等待获取连接的请求队列长度等。一些连接池提供了监控工具或与监控系统集成的能力。 9. **连接池的配置和优化**: 连接池的性能与连接池的配置密切相关。需要根据实际的应用负载和数据库性能来调整连接池的参数。例如,在高并发的场景下,可能需要增加连接池中连接的数量。另外,适当的线程池策略也可以帮助连接池更好地服务于多线程环境。 10. **连接池的应用案例**: 一个典型的案例是电商平台在大型促销活动期间,用户访问量激增,此时通用数据连接池能够保证数据库操作的快速响应,减少因数据库连接问题导致的系统瓶颈。 总结来说,通用数据连接池是现代软件架构中的重要组件,它通过提供高效的数据库连接管理,增强了软件系统的性能和稳定性。了解和掌握连接池的原理及实践,对于任何涉及数据库交互的应用开发都至关重要。在实现和应用连接池时,需要关注其设计的通用性、配置的合理性以及管理的有效性,确保在不同的应用场景下都能发挥出最大的效能。
recommend-type

【LabVIEW网络通讯终极指南】:7个技巧提升UDP性能和安全性

# 摘要 本文系统介绍了LabVIEW在网络通讯中的应用,尤其是针对UDP协议的研究与优化。首先,阐述了UDP的原理、特点及其在LabVIEW中的基础应用。随后,本文深入探讨了通过调整数据包大小、实现并发通信及优化缓冲区管理等技巧来优化UDP性能的LabVIEW方法。接着,文章聚焦于提升UDP通信安全性,介绍了加密技术和认证授权机制在LabVIEW中的实现,以及防御网络攻击的策略。最后,通过具体案例展示了LabVIEW在实时数据采集和远程控制系统中的高级应用,并展望了LabVIEW与UDP通讯技术的未来发展趋势及新兴技术的影响。 # 关键字 LabVIEW;UDP网络通讯;性能优化;安全性;
recommend-type

简要介绍cnn卷积神经网络

<think>首先,用户的问题是:“我想了解卷积神经网络的基本概念和原理 请问CNN卷积神经网络简介及其工作原理”。所以,我需要基于提供的引用材料,构建一个清晰的回答。 引用材料总结: - [^1]: CNN的核心思想是局部感受野、权值共享和时间或空间亚采样,提供位移、尺度、形变不变性。三大特色:局部感知、权重共享和多卷积核。 - [^2]: CNN是一种前馈神经网络,由卷积层和池化层组成,特别在图像处理方面出色。与传统多层神经网络相比,CNN加入了卷积层和池化层,使特征学习更有效。 - [^3]: CNN与全连接神经网络的区别:至少有一个卷积层提取特征;神经元局部连接和权值共享,减少参数数
recommend-type

基于ASP的深度学习网站导航系统功能详解

从给定文件中我们可以提取以下IT知识点: ### 标题知识点 #### "ASP系统篇" - **ASP技术介绍**:ASP(Active Server Pages)是一种服务器端的脚本环境,用于创建动态交互式网页。ASP允许开发者将HTML网页与服务器端脚本结合,使用VBScript或JavaScript等语言编写代码,以实现网页内容的动态生成。 - **ASP技术特点**:ASP适用于小型到中型的项目开发,它可以与数据库紧密集成,如Microsoft的Access和SQL Server。ASP支持多种组件和COM(Component Object Model)对象,使得开发者能够实现复杂的业务逻辑。 #### "深度学习网址导航系统" - **深度学习概念**:深度学习是机器学习的一个分支,通过构建深层的神经网络来模拟人类大脑的工作方式,以实现对数据的高级抽象和学习。 - **系统功能与深度学习的关系**:该标题可能意味着系统在进行网站分类、搜索优化、内容审核等方面采用了深度学习技术,以提供更智能、自动化的服务。然而,根据描述内容,实际上系统并没有直接使用深度学习技术,而是提供了一个传统的网址导航服务,可能是命名上的噱头。 ### 描述知识点 #### "全后台化管理,操作简单" - **后台管理系统的功能**:后台管理系统允许网站管理员通过Web界面执行管理任务,如内容更新、用户管理等。它通常要求界面友好,操作简便,以适应不同技术水平的用户。 #### "栏目无限分类,自由添加,排序,设定是否前台显示" - **动态网站结构设计**:这意味着网站结构具有高度的灵活性,支持创建无限层级的分类,允许管理员自由地添加、排序和设置分类的显示属性。这种设计通常需要数据库支持动态生成内容。 #### "各大搜索和站内搜索随意切换" - **搜索引擎集成**:网站可能集成了外部搜索引擎(如Google、Bing)和内部搜索引擎功能,让用户能够方便地从不同来源获取信息。 #### "网站在线提交、审阅、编辑、删除" - **内容管理系统的功能**:该系统提供了一个内容管理平台,允许用户在线提交内容,由管理员进行审阅、编辑和删除操作。 #### "站点相关信息后台动态配置" - **动态配置机制**:网站允许管理员通过后台系统动态调整各种配置信息,如网站设置、参数调整等,从而实现快速的网站维护和更新。 #### "自助网站收录,后台审阅" - **网站收录和审核机制**:该系统提供了一套自助收录流程,允许其他网站提交申请,由管理员进行后台审核,决定是否收录。 #### "网站广告在线发布" - **广告管理功能**:网站允许管理员在线发布和管理网站广告位,以实现商业变现。 #### "自动生成静态页 ver2.4.5" - **动态与静态内容**:系统支持动态内容的生成,同时也提供了静态页面的生成机制,这可能有助于提高网站加载速度和搜索引擎优化。 #### "重写后台网址分类管理" - **系统优化与重构**:提到了后台网址分类管理功能的重写,这可能意味着系统进行了一次重要的更新,以修复前一个版本的错误,并提高性能。 ### 标签知识点 #### "ASP web 源代码 源码" - **ASP程序开发**:标签表明这是一个ASP语言编写的网站源代码,可能是一个开源项目,供开发者下载、研究或部署到自己的服务器上。 ### 压缩包子文件名称列表知识点 #### "深度学习(asp)网址导航程序" - **文件内容和类型**:文件列表中提到的“深度学习(asp)网址导航程序”表明这是一个ASP语言编写的网址导航系统程序,可能包含了系统安装和配置需要的所有源文件。 通过以上分析,我们可以得出这个ASP系统是一个传统的网址导航系统,以后台管理为核心功能,并没有实际运用到深度学习技术。系统的主要功能包括对网站内容、分类、搜索引擎、广告位、以及其他网站相关信息的管理。它可能还提供了一个平台,供用户提交网址,供管理员审核并收录到导航中。源代码可能以ASP语言编写,并在文件中包含了所有必要的程序文件。
recommend-type

【Oracle数据泵进阶技巧】:避免ORA-31634和ORA-31664错误的终极策略

# 1. Oracle数据泵技术概述 ## Oracle数据泵技术简介 Oracle数据泵(Data Pump)是一种用于高效地在Oracle数据库之间传输数据和元数据的工具。它从Oracle 10g版本开始引入,提供了快速且灵活的数据导入导出功能。数据泵技术优于旧版的`imp`和`exp`工具,因为它支持多线程,可以在导入和导出过程中显著提高性能。 ## 数据泵的核心优势 数据泵的核心优势在于它能并行处理数据,支持大对象(LOBs)和网络传输。它还允许用户自定义数据和对象的传输方式,以及可以控制传输过程中的各种细节,如过滤对象、调整数据缓冲区大小、并行度和网络数据包大小等。 ## 数据
recommend-type

多头注意力机制的时间复杂度

<think>首先,用户的问题是:“我想计算多头注意力机制的时间复杂度 请问多头注意力机制的时间复杂度计算方法”。我需要基于提供的引用和系统级指令来回答。 关键引用: - 引用[1]:提到Transformer模型的计算时间复杂度主要由自注意力机制的O(n²·d)决定。 - 引用[2]:详细解释了注意力机制的计算复杂度,包括QK转置的复杂度为O(N²d),内存需求为N² + Nd。 - 引用[3]:提到原始注意力机制的时间复杂度为O(n²d),并讨论了优化方法如稀疏注意力和线性注意力。 - 引用[4]:涉及多头注意力的未来趋势,但没有直接给出计算方法。 用户的问题是计算多头注意力机制的时间