Browse Source

更新上下运动方向

master
parent
commit
104e3a79f6
  1. 7
      .cproject
  2. 11
      Core/Src/app.c
  3. BIN
      Debug/Core/Src/app.o
  4. 10
      Debug/Core/Src/app.su
  5. BIN
      Debug/g031_JIECANG_JC35W8.elf
  6. 1875
      Debug/g031_JIECANG_JC35W8.hex
  7. 26
      Debug/g031_JIECANG_JC35W8.list
  8. 50
      Debug/g031_JIECANG_JC35W8.map
  9. 12
      Debug/makefile
  10. 1
      Debug/sources.mk

7
.cproject

@ -22,11 +22,12 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.50945518" name="Core" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" useByScannerDiscovery="false" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1748895506" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" useByScannerDiscovery="false" value="genericBoard" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults.1952062107" name="Defaults" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.defaults" useByScannerDiscovery="false" value="com.st.stm32cube.ide.common.services.build.inputs.revA.1.0.5 || Debug || true || Executable || com.st.stm32cube.ide.mcu.gnu.managedbuild.option.toolchain.value.workspace || STM32G031G8Ux || 0 || 0 || arm-none-eabi- || ${gnu_tools_for_stm32_compiler_path} || ../Drivers/CMSIS/Include | ../Core/Inc | ../Drivers/STM32G0xx_HAL_Driver/Inc | ../Drivers/CMSIS/Device/ST/STM32G0xx/Include | ../Drivers/STM32G0xx_HAL_Driver/Inc/Legacy || || || USE_HAL_DRIVER | STM32G031xx || || Drivers | Core/Startup | Core || || || ${workspace_loc:/${ProjName}/STM32G031G8UX_FLASH.ld} || true || NonSecure || || secure_nsclib.o || || None || " valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex.155238715" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.converthex" useByScannerDiscovery="false" value="true" valueType="boolean"/>
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.ELF" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform.1283563930" isAbstract="false" osList="all" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.targetplatform"/>
<builder buildPath="${workspace_loc:/g031test}/Debug" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder.1941579567" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.builder"/>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.398778314" name="MCU GCC Assembler" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1598880994" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.269368206" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" valueType="definedSymbols">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.1598880994" name="Debug level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel" useByScannerDiscovery="false" value="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.debuglevel.value.g3" valueType="enumerated"/>
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols.269368206" name="Define symbols (-D)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.option.definedsymbols" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="DEBUG"/>
</option>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input.847571386" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.assembler.input"/>
@ -53,7 +54,7 @@
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level.2090132509" name="Optimization level" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.cpp.compiler.option.optimization.level" useByScannerDiscovery="false"/>
</tool>
<tool id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.12611516" name="MCU GCC Linker" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker">
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1297836248" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" value="${workspace_loc:/${ProjName}/STM32G031G8UX_FLASH.ld}" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script.1297836248" name="Linker Script (-T)" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.option.script" useByScannerDiscovery="false" value="${workspace_loc:/${ProjName}/STM32G031G8UX_FLASH.ld}" valueType="string"/>
<inputType id="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input.641431053" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.tool.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>

11
Core/Src/app.c

@ -120,15 +120,16 @@ static void App_UpdateMotor(void)
if (up != 0)
{
/* 正转:IO_1 高,IO_2 低 */
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_RESET);
}
else if (down != 0)
{
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_RESET);
/* 反转:IO_1 低,IO_2 高 */
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_SET);
}
else
{

BIN
Debug/Core/Src/app.o

Binary file not shown.

10
Debug/Core/Src/app.su

@ -1,8 +1,8 @@
../Core/Src/app.c:40:6:App_Init 8 static
../Core/Src/app.c:69:6:App_Process 8 static
../Core/Src/app.c:88:13:App_UpdateMotor 32 static
../Core/Src/app.c:141:13:App_SetCurrentLimit 16 static
../Core/Src/app.c:151:13:App_UpdateEncoderRegister 16 static
../Core/Src/app.c:158:13:App_ProcessZeroCommand 8 static
../Core/Src/app.c:167:13:App_UpdateLed 32 static
../Core/Src/app.c:207:6:HAL_ADC_ConvCpltCallback 32 static
../Core/Src/app.c:142:13:App_SetCurrentLimit 16 static
../Core/Src/app.c:152:13:App_UpdateEncoderRegister 16 static
../Core/Src/app.c:159:13:App_ProcessZeroCommand 8 static
../Core/Src/app.c:168:13:App_UpdateLed 32 static
../Core/Src/app.c:208:6:HAL_ADC_ConvCpltCallback 32 static

BIN
Debug/g031_JIECANG_JC35W8.elf

Binary file not shown.

1875
Debug/g031_JIECANG_JC35W8.hex

File diff suppressed because it is too large

26
Debug/g031_JIECANG_JC35W8.list

@ -37,13 +37,13 @@ Idx Name Size VMA LMA File off Algn
CONTENTS, READONLY, DEBUGGING, OCTETS
16 .debug_macro 0001846e 00000000 00000000 0003b750 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
17 .debug_line 00016ff7 00000000 00000000 00053bbe 2**0
17 .debug_line 00016ff5 00000000 00000000 00053bbe 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
18 .debug_str 000998a1 00000000 00000000 0006abb5 2**0
18 .debug_str 000998a1 00000000 00000000 0006abb3 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
19 .comment 00000050 00000000 00000000 00104456 2**0
19 .comment 00000050 00000000 00000000 00104454 2**0
CONTENTS, READONLY
20 .debug_frame 00004160 00000000 00000000 001044a8 2**2
20 .debug_frame 00004160 00000000 00000000 001044a4 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
Disassembly of section .text:
@ -1087,16 +1087,18 @@ static void App_UpdateMotor(void)
80007ae: d00d beq.n 80007cc <App_UpdateMotor+0x108>
{
/* 正转:IO_1 高,IO_2 低 */
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_SET);
80007b0: 4b1b ldr r3, [pc, #108] ; (8000820 <App_UpdateMotor+0x15c>)
80007b2: 2200 movs r2, #0
80007b2: 2201 movs r2, #1
80007b4: 2101 movs r1, #1
80007b6: 0018 movs r0, r3
80007b8: f003 f81c bl 80037f4 <HAL_GPIO_WritePin>
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_RESET);
80007bc: 23a0 movs r3, #160 ; 0xa0
80007be: 05db lsls r3, r3, #23
80007c0: 2201 movs r2, #1
80007c0: 2200 movs r2, #0
80007c2: 2180 movs r1, #128 ; 0x80
80007c4: 0018 movs r0, r3
80007c6: f003 f815 bl 80037f4 <HAL_GPIO_WritePin>
@ -1113,16 +1115,16 @@ static void App_UpdateMotor(void)
80007d0: 781b ldrb r3, [r3, #0]
80007d2: 2b00 cmp r3, #0
80007d4: d00d beq.n 80007f2 <App_UpdateMotor+0x12e>
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_SET);
HAL_GPIO_WritePin(IO_1_GPIO_Port, IO_1_Pin, GPIO_PIN_RESET);
80007d6: 4b12 ldr r3, [pc, #72] ; (8000820 <App_UpdateMotor+0x15c>)
80007d8: 2201 movs r2, #1
80007d8: 2200 movs r2, #0
80007da: 2101 movs r1, #1
80007dc: 0018 movs r0, r3
80007de: f003 f809 bl 80037f4 <HAL_GPIO_WritePin>
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_RESET);
HAL_GPIO_WritePin(IO_2_GPIO_Port, IO_2_Pin, GPIO_PIN_SET);
80007e2: 23a0 movs r3, #160 ; 0xa0
80007e4: 05db lsls r3, r3, #23
80007e6: 2200 movs r2, #0
80007e6: 2201 movs r2, #1
80007e8: 2180 movs r1, #128 ; 0x80
80007ea: 0018 movs r0, r3
80007ec: f003 f802 bl 80037f4 <HAL_GPIO_WritePin>

50
Debug/g031_JIECANG_JC35W8.map

@ -5016,32 +5016,32 @@ LOAD d:/st/stm32cubeide_1.10.1/stm32cubeide/plugins/com.st.stm32cube.ide.mcu.ext
.debug_macro 0x0000000000018029 0x232 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.o
.debug_macro 0x000000000001825b 0x213 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.o
.debug_line 0x0000000000000000 0x16ff7
.debug_line 0x0000000000000000 0x16ff5
.debug_line 0x0000000000000000 0x7ea ./Core/Src/adc.o
.debug_line 0x00000000000007ea 0xa1d ./Core/Src/app.o
.debug_line 0x0000000000001207 0x741 ./Core/Src/dma.o
.debug_line 0x0000000000001948 0x761 ./Core/Src/gpio.o
.debug_line 0x00000000000020a9 0x7fc ./Core/Src/main.o
.debug_line 0x00000000000028a5 0xbc9 ./Core/Src/modbus.o
.debug_line 0x000000000000346e 0x745 ./Core/Src/stm32g0xx_hal_msp.o
.debug_line 0x0000000000003bb3 0x7f2 ./Core/Src/stm32g0xx_it.o
.debug_line 0x00000000000043a5 0x7b8 ./Core/Src/system_stm32g0xx.o
.debug_line 0x0000000000004b5d 0x88e ./Core/Src/tim.o
.debug_line 0x00000000000053eb 0x7df ./Core/Src/usart.o
.debug_line 0x0000000000005bca 0x89 ./Core/Startup/startup_stm32g031g8ux.o
.debug_line 0x0000000000005c53 0xb06 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.o
.debug_line 0x0000000000006759 0x18a0 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_adc.o
.debug_line 0x0000000000007ff9 0xa21 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_adc_ex.o
.debug_line 0x0000000000008a1a 0xb6f ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.o
.debug_line 0x0000000000009589 0xd8f ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.o
.debug_line 0x000000000000a318 0xb5b ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.o
.debug_line 0x000000000000ae73 0xad3 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.o
.debug_line 0x000000000000b946 0xf19 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.o
.debug_line 0x000000000000c85f 0xc38 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.o
.debug_line 0x000000000000d497 0x3b7e ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.o
.debug_line 0x0000000000011015 0x1c3c ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.o
.debug_line 0x0000000000012c51 0x3579 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.o
.debug_line 0x00000000000161ca 0xe2d ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.o
.debug_line 0x00000000000007ea 0xa1b ./Core/Src/app.o
.debug_line 0x0000000000001205 0x741 ./Core/Src/dma.o
.debug_line 0x0000000000001946 0x761 ./Core/Src/gpio.o
.debug_line 0x00000000000020a7 0x7fc ./Core/Src/main.o
.debug_line 0x00000000000028a3 0xbc9 ./Core/Src/modbus.o
.debug_line 0x000000000000346c 0x745 ./Core/Src/stm32g0xx_hal_msp.o
.debug_line 0x0000000000003bb1 0x7f2 ./Core/Src/stm32g0xx_it.o
.debug_line 0x00000000000043a3 0x7b8 ./Core/Src/system_stm32g0xx.o
.debug_line 0x0000000000004b5b 0x88e ./Core/Src/tim.o
.debug_line 0x00000000000053e9 0x7df ./Core/Src/usart.o
.debug_line 0x0000000000005bc8 0x89 ./Core/Startup/startup_stm32g031g8ux.o
.debug_line 0x0000000000005c51 0xb06 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal.o
.debug_line 0x0000000000006757 0x18a0 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_adc.o
.debug_line 0x0000000000007ff7 0xa21 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_adc_ex.o
.debug_line 0x0000000000008a18 0xb6f ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_cortex.o
.debug_line 0x0000000000009587 0xd8f ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_dma.o
.debug_line 0x000000000000a316 0xb5b ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_gpio.o
.debug_line 0x000000000000ae71 0xad3 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_pwr_ex.o
.debug_line 0x000000000000b944 0xf19 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc.o
.debug_line 0x000000000000c85d 0xc38 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_rcc_ex.o
.debug_line 0x000000000000d495 0x3b7e ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim.o
.debug_line 0x0000000000011013 0x1c3c ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_tim_ex.o
.debug_line 0x0000000000012c4f 0x3579 ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart.o
.debug_line 0x00000000000161c8 0xe2d ./Drivers/STM32G0xx_HAL_Driver/Src/stm32g0xx_hal_uart_ex.o
.debug_str 0x0000000000000000 0x998a1
.debug_str 0x0000000000000000 0x948b1 ./Core/Src/adc.o

12
Debug/makefile

@ -52,6 +52,9 @@ default.size.stdout \
OBJDUMP_LIST += \
g031_JIECANG_JC35W8.list \
OBJCOPY_HEX += \
g031_JIECANG_JC35W8.hex \
# All Target
all: main-build
@ -75,12 +78,17 @@ g031_JIECANG_JC35W8.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_D
@echo 'Finished building: $@'
@echo ' '
g031_JIECANG_JC35W8.hex: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS)
arm-none-eabi-objcopy -O ihex $(EXECUTABLES) "g031_JIECANG_JC35W8.hex"
@echo 'Finished building: $@'
@echo ' '
# Other Targets
clean:
-$(RM) default.size.stdout g031_JIECANG_JC35W8.elf g031_JIECANG_JC35W8.list g031_JIECANG_JC35W8.map
-$(RM) default.size.stdout g031_JIECANG_JC35W8.elf g031_JIECANG_JC35W8.hex g031_JIECANG_JC35W8.list g031_JIECANG_JC35W8.map
-@echo ' '
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST)
secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) $(OBJCOPY_HEX)
fail-specified-linker-script-missing:
@echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.'

1
Debug/sources.mk

@ -9,6 +9,7 @@ S_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
O_SRCS :=
OBJCOPY_HEX :=
SIZE_OUTPUT :=
OBJDUMP_LIST :=
SU_FILES :=

Loading…
Cancel
Save