Commit 17550fa0 by 刘大爷来也

创建电机项目,新增加速,减速

parents
// File: STM32F101_102_103_105_107.dbgconf
// Version: 1.0.0
// Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008)
// STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU configuration register (DBGMCU_CR)
// <i> Reserved bits must be kept at reset value
// <o.30> DBG_TIM11_STOP <i> TIM11 counter stopped when core is halted
// <o.29> DBG_TIM10_STOP <i> TIM10 counter stopped when core is halted
// <o.28> DBG_TIM9_STOP <i> TIM9 counter stopped when core is halted
// <o.27> DBG_TIM14_STOP <i> TIM14 counter stopped when core is halted
// <o.26> DBG_TIM13_STOP <i> TIM13 counter stopped when core is halted
// <o.25> DBG_TIM12_STOP <i> TIM12 counter stopped when core is halted
// <o.21> DBG_CAN2_STOP <i> Debug CAN2 stopped when core is halted
// <o.20> DBG_TIM7_STOP <i> TIM7 counter stopped when core is halted
// <o.19> DBG_TIM6_STOP <i> TIM6 counter stopped when core is halted
// <o.18> DBG_TIM5_STOP <i> TIM5 counter stopped when core is halted
// <o.17> DBG_TIM8_STOP <i> TIM8 counter stopped when core is halted
// <o.16> DBG_I2C2_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
// <o.15> DBG_I2C1_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
// <o.14> DBG_CAN1_STOP <i> Debug CAN1 stopped when Core is halted
// <o.13> DBG_TIM4_STOP <i> TIM4 counter stopped when core is halted
// <o.12> DBG_TIM3_STOP <i> TIM3 counter stopped when core is halted
// <o.11> DBG_TIM2_STOP <i> TIM2 counter stopped when core is halted
// <o.10> DBG_TIM1_STOP <i> TIM1 counter stopped when core is halted
// <o.9> DBG_WWDG_STOP <i> Debug window watchdog stopped when core is halted
// <o.8> DBG_IWDG_STOP <i> Debug independent watchdog stopped when core is halted
// <o.2> DBG_STANDBY <i> Debug standby mode
// <o.1> DBG_STOP <i> Debug stop mode
// <o.0> DBG_SLEEP <i> Debug sleep mode
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>
// File: STM32F101_102_103_105_107.dbgconf
// Version: 1.0.0
// Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008)
// STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets
// <<< Use Configuration Wizard in Context Menu >>>
// <h> Debug MCU configuration register (DBGMCU_CR)
// <i> Reserved bits must be kept at reset value
// <o.30> DBG_TIM11_STOP <i> TIM11 counter stopped when core is halted
// <o.29> DBG_TIM10_STOP <i> TIM10 counter stopped when core is halted
// <o.28> DBG_TIM9_STOP <i> TIM9 counter stopped when core is halted
// <o.27> DBG_TIM14_STOP <i> TIM14 counter stopped when core is halted
// <o.26> DBG_TIM13_STOP <i> TIM13 counter stopped when core is halted
// <o.25> DBG_TIM12_STOP <i> TIM12 counter stopped when core is halted
// <o.21> DBG_CAN2_STOP <i> Debug CAN2 stopped when core is halted
// <o.20> DBG_TIM7_STOP <i> TIM7 counter stopped when core is halted
// <o.19> DBG_TIM6_STOP <i> TIM6 counter stopped when core is halted
// <o.18> DBG_TIM5_STOP <i> TIM5 counter stopped when core is halted
// <o.17> DBG_TIM8_STOP <i> TIM8 counter stopped when core is halted
// <o.16> DBG_I2C2_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
// <o.15> DBG_I2C1_SMBUS_TIMEOUT <i> SMBUS timeout mode stopped when core is halted
// <o.14> DBG_CAN1_STOP <i> Debug CAN1 stopped when Core is halted
// <o.13> DBG_TIM4_STOP <i> TIM4 counter stopped when core is halted
// <o.12> DBG_TIM3_STOP <i> TIM3 counter stopped when core is halted
// <o.11> DBG_TIM2_STOP <i> TIM2 counter stopped when core is halted
// <o.10> DBG_TIM1_STOP <i> TIM1 counter stopped when core is halted
// <o.9> DBG_WWDG_STOP <i> Debug window watchdog stopped when core is halted
// <o.8> DBG_IWDG_STOP <i> Debug independent watchdog stopped when core is halted
// <o.2> DBG_STANDBY <i> Debug standby mode
// <o.1> DBG_STOP <i> Debug stop mode
// <o.0> DBG_SLEEP <i> Debug sleep mode
// </h>
DbgMCU_CR = 0x00000007;
// <<< end of configuration section >>>
This source diff could not be displayed because it is too large. You can view the blob instead.
#ifndef STEPPER_MOTOR_H
#define STEPPER_MOTOR_H
#define SYSCLK_FREQUENCY 72000000 // 主时钟频率(72 MHz)
#define STEPMOTOR_ANGLEPERSTEP 1.8 //步进电机步距角
#define STEPMOTOR_FREDIV 32 //步进电机分频系数(细分数)
#define STEPMOTOR_PERDISTANCE 2 //步进电机一转走2mm
#define STEPMOTOR_PULSEPERROUND ((360/STEPMOTOR_ANGLEPERSTEP)*STEPMOTOR_FREDIV) //步进电机每转所需要脉冲的脉冲个数
#define STEPMOTOR_PULSEPERDISTANCE STEPMOTOR_PULSEPERROUND/STEPMOTOR_PERDISTANCE //步进电机每1mm所需要脉冲的脉冲个数
#define STEPMOTOR_FREQ_ROUNDPERMIN (9375/(STEPMOTOR_FREDIV*2)) //步进电机1r/min需要配置的定时器重载值((72000000*60/STEPMOTOR_PULSEPERROUND)/72)(假设时钟分频为8) 定时时间=60s/(每转需要的脉冲个数) 秒冲个数*2是因为只认高-低
#define STEPMOTOR_MAX_SPEED(psc, arr) (SYSCLK_FREQUENCY / ((psc + 1) * (arr + 1)) * 60 / STEPMOTOR_PULSEPERROUND)
typedef enum
{
SPEED_NONE, // 无速度变化
SPEED_ACC, // 加速
SPEED_DEC, // 减速
SPEED_STOP, // 停止
} SpeedStatus;
// 定义步进电机配置结构体
typedef struct {
unsigned stepcount; // 步数(脉冲数)
unsigned direction; // 方向 (0: 逆时针, 1: 顺时针)
unsigned curSpeed; // 当前速度 (步/秒)
unsigned desSpeed; // 目标速度 (步/秒)
unsigned maxSpeed; //最大转速
SpeedStatus speedStatus; // 速度状态
unsigned stepcountMode; // 脉冲计数模式
unsigned curlocation; // 当前位置
unsigned deslocation; // 目标位置
unsigned acceleration; // 加速度 (步/秒^2)
unsigned deceleration; // 减速度 (步/秒^2)
uint16_t psc; //预分频器
uint16_t arr; //自动重装载寄存器
} StepMotor;
// 更新电机状态
void Update_Motor_Status(StepMotor *motor, SpeedStatus status, uint32_t targetSpeed, uint32_t acceleration);
;
void Set_Direction(int direction);
// 使能或禁用步进电机
void Enable_Stepper(bool enable);
// 设置PWM频率
void Set_PWM_Frequency(uint32_t frequency)
// 梯形加减速算法
void StepMotor(int steps, int direction, int max_speed, int acceleration);
void Delay(uint32_t delay);
void Timer_Frequency(int & frequency,StepMotor *stepMotor);
void TIM3_Init(uint16_t &psc,uint16_t &arr);
#endif // STEPPER_MOTOR_H
\ No newline at end of file
#ifndef UART_LOG_H
#define UART_LOG_H
#include "stm32f10x.h"
// 初始化串口日志
void Serial_Init(void);
// 打印字符串
void Serial_Print(const char *str);
// 打印字符
void Serial_Write(char ch);
// 打印格式化字符串
void Serial_Printf(const char *format, ...);
#endif // UART_LOG_H
#include "step_motor.h"
#include "stm32f10x.h"
// 初始化步进电机控制
void StepperMotor_Init(void){
// 使能 GPIOC 和 GPIOF 的时钟
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
RCC->APB2ENR |= RCC_APB2ENR_IOPFEN;
// 使能 AFIO 时钟,用于重映射
RCC->APB2ENR |= RCC_APB2ENR_AFIOEN;
// 配置 PC6 引脚为复用推挽输出 (50 MHz)
GPIOC->CRL &= ~(0xF << 24); // 清空 PC6 配置
GPIOC->CRL |= (0xB << 24); // 配置为复用推挽输出 (0xB = 1011)
// 配置 PC5 为通用推挽输出 (方向)
GPIOC->CRL &= ~(0xF << 20); // 清空 PC5 配置
GPIOC->CRL |= (0x3 << 20); // 配置为通用推挽输出 (0x3 = 0011)
// 配置 PF11 为通用推挽输出 (使能)
GPIOF->CRH &= ~(0xF <<12); // 清空 PF11 配置
GPIOF->CRH |= (0x3 << 12); // 配置为通用推挽输出 (0x3 = 0011)
// 重映射 TIM3_CH1 到 PC6
AFIO->MAPR |= AFIO_MAPR_TIM3_REMAP_FULLREMAP;
}
// 初始化定时器 TIM3 函数
void TIM3_Init(uint16_t &psc,uint16_t &arr);
// 使能 TIM3 时钟
RCC->APB1ENR |= RCC_APB1ENR_TIM3EN;
// 设置预分频器为 72-1,使时钟频率为 1 MHz (72 MHz / 72)
TIM3->PSC = psc;//72 - 1;
// 设置自动重装载值为 1000 - 1,对应于 1 毫秒 (1 MHz * 1 ms)
TIM3->ARR =arr;//1000 - 1;
// 配置 TIM3 通道 1 为 PWM 模式 1
TIM3->CCMR1 &= ~TIM_CCMR1_OC1M; // 清空模式位
TIM3->CCMR1 |= TIM_CCMR1_OC1M_1 | TIM_CCMR1_OC1M_2; // PWM 模式1
TIM3->CCER |= TIM_CCER_CC1E; // 使能通道 1 输出
TIM3->CCR1 = 500; // 设置占空比为 50%
// 使能 TIM3
TIM3->CR1 |= TIM_CR1_CEN;
}
//f定时器输出频率 系统时钟/(PSC+1)*(ARR+1)
void Timer_Frequency(int &frequency, StepMotor *stepMotor) {
// 预先计算 psc 和 arr
int psc_plus_1 = stepMotor->psc + 1;
int arr_plus_1 = stepMotor->arr + 1;
// 简化并避免除法的额外开销
frequency = 72000000 / (psc_plus_1 * arr_plus_1);
}
// 设置方向
// 设置方向函数
void Set_Direction(int direction) {
if (direction) {
GPIOC->ODR |= (1 << 5); // 设置高电平 (顺时针方向)
} else {
GPIOC->ODR &= ~(1 << 5); // 设置低电平 (逆时针方向)
}
}
// 使能控制函数
void Enable_Stepper(bool enable) {
if (enable) {
GPIOF->ODR &= ~(1 << 11); // 设置低电平 (使能步进电机)
} else {
GPIOF->ODR |= (1 << 11); // 设置高电平 (关闭步进电机)
}
}
// 设置PWM频率
void Set_PWM_Frequency(uint32_t frequency) {
// 计算ARR值
uint32_t arr_value = (SYSCLK_FREQUENCY / ((TIM3->PSC + 1) * frequency)) - 1;
// 更新自动重装载寄存器
TIM3->ARR = arr_value;
TIM3->CCR1 = arr_value / 2; // 保持50%占空比
}
// 梯形加速函数
void StepMotor_Accelerate(uint32_t targetRPM, uint32_t acceleration) {
uint32_t currentRPM = 0;
uint32_t deltaRPM = (acceleration / 60000) * 10; // 10ms内的速度增量
while (currentRPM < targetRPM) {
if (currentRPM == 0) {
currentRPM = 100;
}
// 更新PWM频率
uint32_t pwmFrequency = (currentRPM * STEPMOTOR_PULSEPERROUND) / 60;
Set_PWM_Frequency(pwmFrequency);
// 每次加速的增量
currentRPM += deltaRPM;
if (currentRPM > targetRPM) {
currentRPM = targetRPM; // 防止超过目标速度
}
// 延时 10ms,每次迭代增加速度
Delay(10);
}
// 达到目标速度,保持目标速度的PWM频率
uint32_t finalFrequency = (targetRPM * STEPMOTOR_PULSEPERROUND) / 60;
Set_PWM_Frequency(finalFrequency);
}
// 梯形减速函数:将当前转速逐步减速为 0
void StepMotor_Decelerate(uint32_t currentRPM, uint32_t deceleration) {
uint32_t deltaRPM = (deceleration / 60000) * 10; // 10ms 内的速度减量
while (currentRPM > 0) {
// 计算 PWM 频率
uint32_t pwmFrequency = (currentRPM * STEPMOTOR_PULSEPERROUND) / 60;
Set_PWM_Frequency(pwmFrequency); // 更新PWM频率以调整电机速度
// 每次减速的增量
if (currentRPM > deltaRPM) {
currentRPM -= deltaRPM; // 减速
} else {
currentRPM = 0;
}
Delay(10);
}
Set_PWM_Frequency(0);
}
void Delay(uint32_t delay) {
for (volatile uint32_t i = 0; i < delay * 1000; i++) {
__NOP(); // 空操作,用于延时
}
}
void Update_Motor_Status(StepMotor *motor, SpeedStatus status, uint32_t targetSpeed, uint32_t acceleration) {
motor->speedStatus = status; // 更新电机的速度状态
motor->desSpeed = targetSpeed; // 更新目标速度
motor->acceleration = acceleration; // 更新加速度
switch (status) {
case SPEED_ACC:
// 加速过程
StepMotor_Accelerate(targetSpeed, acceleration);
break;
case SPEED_DEC:
// 减速过程
StepMotor_Decelerate(motor->curSpeed, acceleration);
break;
case SPEED_NONE:
// 匀速,保持当前速度
Set_PWM_Frequency((motor->curSpeed * STEPMOTOR_PULSEPERROUND) / 60);
break;
case SPEED_STOP:
// 停止电机
motor->curSpeed = 0;
Set_PWM_Frequency(0); // 关闭PWM
break;
default:
break;
}
}
#include "uart_log.h"
#include <stdarg.h>
#include <string.h>
#include <stdio.h> // 包含<stdio.h>头文件
// 缓冲区大小
#define SERIAL_BUFFER_SIZE 128
// USART1 GPIO初始化
void USART1_GPIO_Init(void) {
// 使能GPIOA和USART1时钟
RCC->APB2ENR |= RCC_APB2ENR_IOPAEN | RCC_APB2ENR_USART1EN;
GPIOA->CRH &= ~(0xF << 20);
GPIOA->CRH |= (0xB << 20);
GPIOA->CRH &= ~(0xF << 24); // 清除模式控制位
GPIOA->CRH |= (0x4 << 24); // 设置为浮空输入
}
// USART1初始化
void USART1_Init(void) {
// 设置波特率
uint32_t BRR = (uint32_t)(SystemCoreClock / 16 / 115200);
USART1->BRR = BRR;
// 配置USART1
USART1->CR1 = USART_CR1_UE | USART_CR1_TE | USART_CR1_RE; // 使能USART1、发送器和接收器
USART1->CR2 = 0; // 不使用流控制
USART1->CR3 = 0; // 不使用额外功能
}
// 发送一个字符
void USART1_SendChar(char ch) {
while (!(USART1->SR & USART_SR_TXE)); // 等待发送缓冲区为空
USART1->DR = (ch & 0xFF); // 发送字符
}
// 发送字符串
void USART1_SendString(const char *str) {
while (*str) {
USART1_SendChar(*str++);
}
}
// 格式化字符串并发送
void USART1_SendFormatted(const char *format, ...) {
char buffer[SERIAL_BUFFER_SIZE];
va_list args;
va_start(args, format);
vsnprintf(buffer, sizeof(buffer), format, args);
va_end(args);
USART1_SendString(buffer);
}
// 初始化串口日志
void Serial_Init(void) {
USART1_GPIO_Init();
USART1_Init();
}
// 打印字符串
void Serial_Print(const char *str) {
USART1_SendString(str);
}
// 打印字符
void Serial_Write(char ch) {
USART1_SendChar(ch);
}
// 打印格式化字符串
void Serial_Printf(const char *format, ...) {
va_list args;
va_start(args, format);
USART1_SendFormatted(format, args);
va_end(args);
}
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Header>### uVision Project, (C) Keil Software</Header>
<Extensions>
<cExt>*.c</cExt>
<aExt>*.s*; *.src; *.a*</aExt>
<oExt>*.obj</oExt>
<lExt>*.lib</lExt>
<tExt>*.txt; *.h; *.inc</tExt>
<pExt>*.plm</pExt>
<CppX>*.cpp</CppX>
<nMigrate>0</nMigrate>
</Extensions>
<DaveTm>
<dwLowDateTime>0</dwLowDateTime>
<dwHighDateTime>0</dwHighDateTime>
</DaveTm>
<Target>
<TargetName>PWM</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<CLKADS>12000000</CLKADS>
<OPTTT>
<gFlags>1</gFlags>
<BeepAtEnd>1</BeepAtEnd>
<RunSim>0</RunSim>
<RunTarget>1</RunTarget>
<RunAbUc>0</RunAbUc>
</OPTTT>
<OPTHX>
<HexSelection>1</HexSelection>
<FlashByte>65535</FlashByte>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
</OPTHX>
<OPTLEX>
<PageWidth>79</PageWidth>
<PageLength>66</PageLength>
<TabStop>8</TabStop>
<ListingPath>.\Listings\</ListingPath>
</OPTLEX>
<ListingPage>
<CreateCListing>1</CreateCListing>
<CreateAListing>1</CreateAListing>
<CreateLListing>1</CreateLListing>
<CreateIListing>0</CreateIListing>
<AsmCond>1</AsmCond>
<AsmSymb>1</AsmSymb>
<AsmXref>0</AsmXref>
<CCond>1</CCond>
<CCode>0</CCode>
<CListInc>0</CListInc>
<CSymb>0</CSymb>
<LinkerCodeListing>0</LinkerCodeListing>
</ListingPage>
<OPTXL>
<LMap>1</LMap>
<LComments>1</LComments>
<LGenerateSymbols>1</LGenerateSymbols>
<LLibSym>1</LLibSym>
<LLines>1</LLines>
<LLocSym>1</LLocSym>
<LPubSym>1</LPubSym>
<LXref>0</LXref>
<LExpSel>0</LExpSel>
</OPTXL>
<OPTFL>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<IsCurrentTarget>1</IsCurrentTarget>
</OPTFL>
<CpuCode>18</CpuCode>
<Books>
<Book>
<Number>0</Number>
<Title>Quick Start Guide (MCBSTM32E)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Boards/Keil/MCBSTM32E/Documentation/STM32E_QSG.pdf</Path>
</Book>
<Book>
<Number>1</Number>
<Title>Base Board Schematics (MCBSTM32E)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Boards/Keil/MCBSTM32E/Documentation/mcbstm32e-base-board-schematics.pdf</Path>
</Book>
<Book>
<Number>2</Number>
<Title>Display Board Schematics (MCBSTM32E)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Boards/Keil/MCBSTM32E/Documentation/mcbstm32e-display-board-schematics.pdf</Path>
</Book>
<Book>
<Number>3</Number>
<Title>User Manual (MCBSTM32E)</Title>
<Path>C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Boards/Keil/MCBSTM32E/Documentation/mcbstm32e.chm</Path>
</Book>
<Book>
<Number>4</Number>
<Title>MCBSTM32E Evaluation Board Web Page (MCBSTM32E)</Title>
<Path>http://www.keil.com/mcbstm32e/</Path>
</Book>
</Books>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<sLdApp>1</sLdApp>
<sGomain>1</sGomain>
<sRbreak>1</sRbreak>
<sRwatch>1</sRwatch>
<sRmem>1</sRmem>
<sRfunc>1</sRfunc>
<sRbox>1</sRbox>
<tLdApp>1</tLdApp>
<tGomain>1</tGomain>
<tRbreak>1</tRbreak>
<tRwatch>1</tRwatch>
<tRmem>1</tRmem>
<tRfunc>0</tRfunc>
<tRbox>1</tRbox>
<tRtrace>1</tRtrace>
<sRSysVw>1</sRSysVw>
<tRSysVw>1</tRSysVw>
<sRunDeb>0</sRunDeb>
<sLrtime>0</sLrtime>
<nTsel>1</nTsel>
<sDll></sDll>
<sDllPa></sDllPa>
<sDlgDll></sDlgDll>
<sDlgPa></sDlgPa>
<sIfile></sIfile>
<tDll></tDll>
<tDllPa></tDllPa>
<tDlgDll></tDlgDll>
<tDlgPa></tDlgPa>
<tIfile></tIfile>
<pMon>BIN\UL2CM3.DLL</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>UL2CM3</Key>
<Name>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F10x_512 -FS08000000 -FL080000 -FP0($$Device:STM32F103ZE$Flash/STM32F10x_512.FLM))</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
<Breakpoint/>
<Tracepoint>
<THDelay>0</THDelay>
</Tracepoint>
<DebugFlag>
<trace>0</trace>
<periodic>1</periodic>
<aLwin>0</aLwin>
<aCover>0</aCover>
<aSer1>0</aSer1>
<aSer2>0</aSer2>
<aPa>0</aPa>
<viewmode>0</viewmode>
<vrSel>0</vrSel>
<aSym>0</aSym>
<aTbox>0</aTbox>
<AscS1>0</AscS1>
<AscS2>0</AscS2>
<AscS3>0</AscS3>
<aSer3>0</aSer3>
<eProf>0</eProf>
<aLa>0</aLa>
<aPa1>0</aPa1>
<AscS4>0</AscS4>
<aSer4>0</aSer4>
<StkLoc>0</StkLoc>
<TrcWin>0</TrcWin>
<newCpu>0</newCpu>
<uProt>0</uProt>
</DebugFlag>
<LintExecutable></LintExecutable>
<LintConfigFile></LintConfigFile>
<DebugDescription>
<Enable>1</Enable>
<EnableLog>0</EnableLog>
<Protocol>2</Protocol>
<DbgClock>10000000</DbgClock>
</DebugDescription>
</TargetOption>
</Target>
<Group>
<GroupName>Control</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>1</GroupNumber>
<FileNumber>1</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\main.c</PathWithFileName>
<FilenameWithoutPath>main.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>Module</GroupName>
<tvExp>1</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>0</RteFlg>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>2</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Module\Inc\StepMotor.h</PathWithFileName>
<FilenameWithoutPath>StepMotor.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>3</FileNumber>
<FileType>5</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Module\Inc\uart_log.h</PathWithFileName>
<FilenameWithoutPath>uart_log.h</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>4</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Module\Src\StepMotor.c</PathWithFileName>
<FilenameWithoutPath>StepMotor.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
<File>
<GroupNumber>2</GroupNumber>
<FileNumber>5</FileNumber>
<FileType>1</FileType>
<tvExp>0</tvExp>
<Focus>0</Focus>
<tvExpOptDlg>0</tvExpOptDlg>
<bDave2>0</bDave2>
<PathWithFileName>.\Module\Src\uart_log.c</PathWithFileName>
<FilenameWithoutPath>uart_log.c</FilenameWithoutPath>
<RteFlg>0</RteFlg>
<bShared>0</bShared>
</File>
</Group>
<Group>
<GroupName>::Device</GroupName>
<tvExp>0</tvExp>
<tvExpOptDlg>0</tvExpOptDlg>
<cbSel>0</cbSel>
<RteFlg>1</RteFlg>
</Group>
</ProjectOpt>
<html>
<body>
<pre>
<h1>Vision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: Vision V5.14.0.0
Copyright (C) 2015 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: 111 1434736858@qq.com, 111, LIC=14HV2-915PI-BSHYX-HP4J5-5IIFN-ZG5AK
Tool Versions:
Toolchain: MDK-ARM Standard Version: 5.14.0.0
Toolchain Path: C:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.05 update 1 (build 106)
Assembler: Armasm.exe V5.05 update 1 (build 106)
Linker/Locator: ArmLink.exe V5.05 update 1 (build 106)
Library Manager: ArmAr.exe V5.05 update 1 (build 106)
Hex Converter: FromElf.exe V5.05 update 1 (build 106)
CPU DLL: SARMCM3.DLL V5.14.0.0
Dialog DLL: DCM.DLL V1.13.1.0
Target DLL: UL2CM3.DLL V1.155.0.0
Dialog DLL: TCM.DLL V1.14.4.0
<h2>Project:</h2>
D:\Ƕʽ\mcu\Motor_Control\MotorControl.uvprojx
Project File Date: 09/25/2024
<h2>Output:</h2>
Build target 'PWM'
compiling main.c...
compiling uart_log.c...
compiling step_motor.c...
assembling startup_stm32f10x_hd.s...
compiling system_stm32f10x.c...
linking...
Program Size: Code=1196 RO-data=336 RW-data=20 ZI-data=1636
FromELF: creating hex file...
".\Objects\MotorControl.axf" - 0 Error(s), 0 Warning(s).
<h2>Software Packages used:</h2>
Package Vendor: Keil
https://www.keil.com/pack/Keil.STM32F1xx_DFP.2.4.1.pack
Keil::Device:Startup:1.0.0
STMicroelectronics STM32F1 Series Device Support, Drivers and Examples
* Component: Startup Version: 1.0.0
<h2>Collection of Component include folders:</h2>
D:\Ƕʽ\mcu\Motor_Control\RTE
D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE
C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1
C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include
<h2>Collection of Component Files used:</h2>
* Component: Keil::Device:Startup:1.0.0
Source file: Device\Source\ARM\startup_stm32f10x_hd.s
Source file: Device\Source\ARM\STM32F1xx_OPT.s
Source file: Device\Source\system_stm32f10x.c
Include file: RTE_Driver\Config\RTE_Device.h
</pre>
</body>
</html>
:020000040800F2
:1000000078060020CD010008D5010008D7010008BE
:10001000D9010008DB010008DD0100080000000034
:10002000000000000000000000000000DF010008E8
:10003000E101000800000000E3010008E5010008FC
:10004000E7010008E7010008E7010008E7010008F0
:10005000E7010008E7010008E7010008E7010008E0
:10006000E7010008E7010008E7010008E7010008D0
:10007000E7010008E7010008E7010008E7010008C0
:10008000E7010008E7010008E7010008E7010008B0
:10009000E7010008E7010008E7010008E7010008A0
:1000A000E7010008E7010008E7010008E701000890
:1000B000E7010008E7010008E7010008E701000880
:1000C000E7010008E7010008E7010008E701000870
:1000D000E7010008E7010008E7010008E701000860
:1000E000E7010008E7010008E7010008E701000850
:1000F000E7010008E7010008E7010008E701000840
:10010000E7010008E7010008E7010008E70100082F
:10011000E7010008E7010008E7010008E70100081F
:10012000E7010008E7010008E7010008E70100080F
:1001300000F002F800F03AF80AA090E8000C8244BF
:100140008344AAF10107DA4501D100F02FF8AFF29C
:10015000090EBAE80F0013F0010F18BFFB1A43F0A5
:10016000010318477804000098040000103A24BFE7
:1001700078C878C1FAD8520724BF30C830C144BF0C
:1001800004680C607047000000230024002500264E
:10019000103A28BF78C1FBD8520728BF30C148BFEA
:1001A0000B6070471FB51FBD10B510BD00F031F8D2
:1001B0001146FFF7F7FF00F0F1F900F04FF803B434
:1001C000FFF7F2FF03BC00F055F800000948804734
:1001D00009480047FEE7FEE7FEE7FEE7FEE7FEE729
:1001E000FEE7FEE7FEE7FEE704480549054A064B41
:1001F0007047000061040008310100087800002009
:1002000078060020780200207802002070477047AE
:100210007047754600F028F8AE460500694653461B
:1002200020F00700854618B020B5FFF7DDFFBDE8D8
:1002300020404FF000064FF000074FF000084FF04D
:10024000000B21F00701AC46ACE8C009ACE8C009DE
:10025000ACE8C009ACE8C0098D4670470446AFF36E
:1002600000802046FFF7ABFF0048704714000020D5
:100270007047000001491820ABBEFEE726000200CF
:1002800008B50021009103E000BF0099491C0091CE
:1002900000EB4001C1EBC011009AB2EBC10FF3D3E8
:1002A00008BD000030B10749096821F40061054A22
:1002B000116005E00349096841F40061014A1160D9
:1002C000704700000C1C01401B48806940F0100082
:1002D000194988610846806940F0800088610846B5
:1002E000806940F0010088611448006820F0706067
:1002F000124908600846006840F03060086008460F
:10030000006820F4700008600846006840F440105F
:1003100008600B48006820F47040094908600846EE
:10032000006840F4405008600648406840F440606F
:10033000044948607047000000100240001001406E
:10034000041C01400000014000B500F0EDF800F091
:100350000DF900BD10B500F001F810BD0CB500207E
:10036000019000903348006840F4803031490860C3
:1003700000BF3048006800F4003000900198401C35
:100380000190009818B90198B0F5A06FF1D12948F3
:10039000006800F4003010B10120009001E000205E
:1003A00000900098012843D12348006840F01000D5
:1003B000214908600846006820F0030008600846EC
:1003C000006840F0020008601A4840681949486017
:1003D0000846406848600846406840F480604860CD
:1003E0000846406820F47C1048600846406840F4A5
:1003F000E81048600846006840F08070086000BF60
:100400000C48006800F000700028F9D009484068E6
:1004100020F00300074948600846406840F00200A9
:10042000486000BF0348406800F00C000828F9D17C
:100430000CBD0000001002400020024030B107490E
:10044000C96841F02001054AD16005E00349C96847
:1004500021F02001014AD1607047000000100140E6
:1004600010B51348006840F00100114908600846C3
:100470004068104908400E494860084600680E4927
:1004800008400B4908600846006820F48020086096
:100490000846406820F4FE0048604FF41F00886062
:1004A000FFF758FF4FF000600449086010BD0000DE
:1004B000001002400000FFF8FFFFF6FE08ED00E02C
:1004C0001748C06940F002001549C8614720154926
:1004D000088040F2E730091D088012481038008873
:1004E00020F070000F49103908800846008840F05D
:1004F000600008800B480838008840F00100094976
:10050000083908804FF4FA7006490C310880054814
:100510002838008840F001000249283908807047D7
:1005200000100240280400400E48806944F2040193
:1005300008430C4988610C48006820F470000A499F
:1005400008600846006840F430000860084600680B
:1005500020F0706008600846006840F08060086025
:100560007047000000100240040801400949096872
:1005700009094FF4E132B1FBF2F0074A108042F270
:100580000C01121D11800021121D1180121D1180FD
:10059000704700000000002008380140FFF794FE7B
:1005A000FFF78EFFFFF7D0FE0120FFF747FF012086
:1005B000FFF778FE012400250CE00748854205D3AB
:1005C00084F001042046FFF739FF00250120FFF7E2
:1005D00057FE6D1CF1E7000020A10700FC05000894
:1005E00000000020140000006C0100081006000844
:1005F00014000020640600008801000800A24A04DC
:1006000000000000000000000102030406070809C2
:0400000508000131BD
:00000001FF
--cpu Cortex-M3
".\objects\main.o"
".\objects\uart_log.o"
".\objects\step_motor.o"
".\objects\startup_stm32f10x_hd.o"
".\objects\system_stm32f10x.o"
--strict --scatter ".\Objects\MotorControl.sct"
-u _printf --summary_stderr --info summarysizes --map --xref --callgraph --symbols
--info sizes --info totals --info unused --info veneers
--list ".\Listings\MotorControl.map" -o .\Objects\MotorControl.axf
\ No newline at end of file
; *************************************************************
; *** Scatter-Loading Description File generated by uVision ***
; *************************************************************
LR_IROM1 0x08000000 0x00080000 { ; load region size_region
ER_IROM1 0x08000000 0x00080000 { ; load address = execution address
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
}
RW_IRAM1 0x20000000 0x00010000 { ; RW data
.ANY (+RW +ZI)
}
}
Dependencies for Project 'MotorControl', Target 'PWM': (DO NOT MODIFY !)
F (.\main.c)(0x66F677B1)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -I.\Module\Inc --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\main.o --omf_browse .\objects\main.crf --depend .\objects\main.d)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x5475F300)
I (.\Module\Inc\uart_log.h)(0x66F3E910)
F (.\Module\Inc\uart_log.h)(0x66F3E910)()
F (.\Module\Src\uart_log.c)(0x66F6776B)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -I.\Module\Inc --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\uart_log.o --omf_browse .\objects\uart_log.crf --depend .\objects\uart_log.d)
I (.\Module\Inc\uart_log.h)(0x66F3E910)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
I (C:\Keil_v5\ARM\ARMCC\include\stdarg.h)(0x5475F2FA)
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x5475F300)
I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x5475F300)
F (.\Module\Inc\step_motor.h)(0x66F67758)()
F (.\Module\Src\step_motor.c)(0x66F67758)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -I.\Module\Inc --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\step_motor.o --omf_browse .\objects\step_motor.crf --depend .\objects\step_motor.d)
F (RTE\Device\STM32F103ZE\RTE_Device.h)(0x5FC04FEA)()
F (RTE\Device\STM32F103ZE\startup_stm32f10x_hd.s)(0x61AD795E)(--cpu Cortex-M3 -g --apcs=interwork -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include --pd "__UVISION_VERSION SETA 514" --pd "_RTE_ SETA 1" --pd "STM32F10X_HD SETA 1" --list .\listings\startup_stm32f10x_hd.lst --xref -o .\objects\startup_stm32f10x_hd.o --depend .\objects\startup_stm32f10x_hd.d)
F (RTE\Device\STM32F103ZE\system_stm32f10x.c)(0x61AD795E)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include -I.\Module\Inc --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\system_stm32f10x.o --omf_browse .\objects\system_stm32f10x.crf --depend .\objects\system_stm32f10x.d)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
Dependencies for Project 'MotorControl', Target 'Target 1': (DO NOT MODIFY !)
F (.\main.c)(0x66F3DF7C)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\main.o --omf_browse .\objects\main.crf --depend .\objects\main.d)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
I (C:\Keil_v5\ARM\ARMCC\include\stdbool.h)(0x5475F300)
I (uart_log.h)(0x66F3E19A)
F (.\StepMotor.h)(0x66F28B19)()
F (.\StepMotor.c)(0x66F28C69)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\stepmotor.o --omf_browse .\objects\stepmotor.crf --depend .\objects\stepmotor.d)
F (.\uart_log.h)(0x66F3E19A)()
F (.\uart_log.c)(0x66F3E28E)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\uart_log.o --omf_browse .\objects\uart_log.crf --depend .\objects\uart_log.d)
I (uart_log.h)(0x66F3E19A)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
I (C:\Keil_v5\ARM\ARMCC\include\stdarg.h)(0x5475F2FA)
I (C:\Keil_v5\ARM\ARMCC\include\string.h)(0x5475F300)
I (C:\Keil_v5\ARM\ARMCC\include\stdio.h)(0x5475F300)
F (RTE\Device\STM32F103ZE\RTE_Device.h)(0x5FC04FEA)()
F (RTE\Device\STM32F103ZE\startup_stm32f10x_hd.s)(0x61AD795E)(--cpu Cortex-M3 -g --apcs=interwork -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include --pd "__UVISION_VERSION SETA 514" --pd "_RTE_ SETA 1" --pd "STM32F10X_HD SETA 1" --list .\listings\startup_stm32f10x_hd.lst --xref -o .\objects\startup_stm32f10x_hd.o --depend .\objects\startup_stm32f10x_hd.d)
F (RTE\Device\STM32F103ZE\system_stm32f10x.c)(0x61AD795E)(-c --cpu Cortex-M3 -g -O0 --apcs=interwork --split_sections -IC:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include -IC:\Keil_v5\ARM\CMSIS\Include --locale=english --c99 -I D:\Ƕʽ\mcu\Motor_Control\RTE -I D:\Ƕʽ\mcu\Motor_Control\RTE\Device\STM32F103ZE -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1 -I C:\Keil_v5\ARM\PACK\Keil\STM32F1xx_DFP\2.4.1\Device\Include -I C:\Keil_v5\ARM\CMSIS\Include -D__UVISION_VERSION="514" -D_RTE_ -DSTM32F10X_HD -o .\objects\system_stm32f10x.o --omf_browse .\objects\system_stm32f10x.crf --depend .\objects\system_stm32f10x.d)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h)(0x5825386C)
I (D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h)(0x00000000)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h)(0x5714AE54)
I (C:\Keil_v5\ARM\ARMCC\include\stdint.h)(0x5475F300)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h)(0x5714AE54)
I (C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h)(0x5825386C)
.\objects\main.o: main.c
.\objects\main.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h
.\objects\main.o: D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h
.\objects\main.o: C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h
.\objects\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\main.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h
.\objects\main.o: C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h
.\objects\main.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h
.\objects\main.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h
.\objects\main.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdbool.h
.\objects\main.o: .\Module\Inc\uart_log.h
File added
.\objects\startup_stm32f10x_hd.o: RTE\Device\STM32F103ZE\startup_stm32f10x_hd.s
.\objects\step_motor.o: Module\Src\step_motor.c
.\objects\stepmotor.o: StepMotor.c
.\objects\system_stm32f10x.o: RTE\Device\STM32F103ZE\system_stm32f10x.c
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h
.\objects\system_stm32f10x.o: D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h
.\objects\system_stm32f10x.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h
.\objects\uart_log.o: Module\Src\uart_log.c
.\objects\uart_log.o: .\Module\Inc\uart_log.h
.\objects\uart_log.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\stm32f10x.h
.\objects\uart_log.o: D:\嵌入式\mcu\Motor_Control\RTE\RTE_Components.h
.\objects\uart_log.o: C:\Keil_v5\ARM\CMSIS\Include\core_cm3.h
.\objects\uart_log.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h
.\objects\uart_log.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmInstr.h
.\objects\uart_log.o: C:\Keil_v5\ARM\CMSIS\Include\cmsis_armcc.h
.\objects\uart_log.o: C:\Keil_v5\ARM\CMSIS\Include\core_cmFunc.h
.\objects\uart_log.o: C:\Keil_v5\ARM\Pack\Keil\STM32F1xx_DFP\2.2.0\Device\Include\system_stm32f10x.h
.\objects\uart_log.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h
.\objects\uart_log.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h
.\objects\uart_log.o: C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h
/*
* Auto generated Run-Time-Environment Component Configuration File
* *** Do not modify ! ***
*
* Project: 'MotorControl'
* Target: 'PWM'
*/
#ifndef RTE_COMPONENTS_H
#define RTE_COMPONENTS_H
#endif /* RTE_COMPONENTS_H */
#include "step_motor.h"
#include "stm32f10x.h"
int main(void) {
// 初始化步进电机控制
StepperMotor_Init();
// 定义步进电机结构体
StepMotor motor = {
.stepcount = 0, // 初始步数
.direction = 1, // 初始方向(1:顺时针)
.curSpeed = 0, // 初始速度为0
.desSpeed = 0, // 目标速度
.maxSpeed = 9375, // 最大转速(假设值)
.speedStatus = SPEED_NONE, // 初始速度状态
.stepcountMode = 0, // 脉冲计数模式
.curlocation = 0, // 当前位置
.deslocation = 0, // 目标位置
.acceleration = 1000, // 加速度 (步/秒^2)
.deceleration = 1000, // 减速度 (步/秒^2)
.psc = 71, // 预分频器
.arr = 999 // 自动重装载寄存器
};
// 初始化定时器 TIM3
TIM3_Init(motor.psc, motor.arr);
// 设置初始方向(例如顺时针)
Set_Direction(motor.direction);
// 使能步进电机
Enable_Stepper(true);
// 主循环
while (1) {
// 例子:加速到目标速度
Update_Motor_Status(&motor, SPEED_ACC, 9375, 1000); // 以1000 RPM/s的加速度加速到9375 RPM
// 保持匀速一段时间
Delay(5000); // 延时5秒
// 例子:减速到停止
Update_Motor_Status(&motor, SPEED_DEC, 0, 1000); // 以1000 RPM/s的减速度减速到停止
// 保持停止一段时间
Delay(5000); // 延时5秒
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment