去掉了Config_ShootInit
This commit is contained in:
parent
520a732db0
commit
2c7e90fda1
11
.clangd
Normal file
11
.clangd
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
CompileFlags:
|
||||||
|
Add:
|
||||||
|
- '-ferror-limit=0'
|
||||||
|
- '-Wno-implicit-int'
|
||||||
|
CompilationDatabase: build/Debug
|
||||||
|
Diagnostics:
|
||||||
|
Suppress:
|
||||||
|
- unused-includes
|
||||||
|
- unknown_typename
|
||||||
|
- unknown_typename_suggest
|
||||||
|
- typename_requires_specqual
|
||||||
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
build
|
||||||
|
mx.scratch
|
||||||
|
!.settings
|
||||||
File diff suppressed because one or more lines are too long
147
.settings/bundles-lock.store.json
Normal file
147
.settings/bundles-lock.store.json
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
{
|
||||||
|
"resolved": [
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3",
|
||||||
|
"platform": "darwin",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3",
|
||||||
|
"platform": "x86_64-linux",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3",
|
||||||
|
"platform": "x86_64-windows",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9",
|
||||||
|
"platform": "darwin",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9",
|
||||||
|
"platform": "x86_64-linux",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9",
|
||||||
|
"platform": "x86_64-windows",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32-13_3_1-description",
|
||||||
|
"version": "1.0.1+st.1",
|
||||||
|
"platform": "all",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32-13_3_1-description",
|
||||||
|
"version": ">=0.0.1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1",
|
||||||
|
"platform": "darwin",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1",
|
||||||
|
"platform": "x86_64-linux",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1",
|
||||||
|
"platform": "x86_64-windows",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3",
|
||||||
|
"platform": "darwin",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3",
|
||||||
|
"platform": "x86_64-linux",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3",
|
||||||
|
"platform": "x86_64-windows",
|
||||||
|
"selected_by": [
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
20
.settings/bundles.store.json
Normal file
20
.settings/bundles.store.json
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"bundles": [
|
||||||
|
{
|
||||||
|
"name": "cmake",
|
||||||
|
"version": "4.0.1+st.3"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "ninja",
|
||||||
|
"version": "1.13.1+st.1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "gnu-tools-for-stm32",
|
||||||
|
"version": "13.3.1+st.9"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "st-arm-clangd",
|
||||||
|
"version": "19.1.2+st.3"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
6
.settings/ide.store.json
Normal file
6
.settings/ide.store.json
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"device": "STM32F407IGH6",
|
||||||
|
"core": "Cortex-M4",
|
||||||
|
"order": 0,
|
||||||
|
"toolchain": "GCC"
|
||||||
|
}
|
||||||
8
.vscode/c_cpp_properties.json
vendored
Normal file
8
.vscode/c_cpp_properties.json
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "STM32",
|
||||||
|
"compileCommands": "${workspaceFolder}/build/Debug/compile_commands.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
15
.vscode/settings.json
vendored
15
.vscode/settings.json
vendored
@ -6,5 +6,18 @@
|
|||||||
"motor_rm.h": "c",
|
"motor_rm.h": "c",
|
||||||
"filter.h": "c",
|
"filter.h": "c",
|
||||||
"user_math.h": "c"
|
"user_math.h": "c"
|
||||||
}
|
},
|
||||||
|
"cmake.cmakePath": "cube-cmake",
|
||||||
|
"cmake.configureArgs": [
|
||||||
|
"-DCMAKE_COMMAND=cube-cmake"
|
||||||
|
],
|
||||||
|
"cmake.preferredGenerators": [
|
||||||
|
"Ninja"
|
||||||
|
],
|
||||||
|
"stm32cube-ide-clangd.path": "cube",
|
||||||
|
"stm32cube-ide-clangd.arguments": [
|
||||||
|
"starm-clangd",
|
||||||
|
"--query-driver=${env:CUBE_BUNDLE_PATH}/gnu-tools-for-stm32/13.3.1+st.9/bin/arm-none-eabi-gcc.exe",
|
||||||
|
"--query-driver=${env:CUBE_BUNDLE_PATH}/gnu-tools-for-stm32/13.3.1+st.9/bin/arm-none-eabi-g++.exe"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
98
CMakeLists.txt
Normal file
98
CMakeLists.txt
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
|
||||||
|
#
|
||||||
|
# This file is generated only once,
|
||||||
|
# and is not re-generated if converter is called multiple times.
|
||||||
|
#
|
||||||
|
# User is free to modify the file as much as necessary
|
||||||
|
#
|
||||||
|
|
||||||
|
# Setup compiler settings
|
||||||
|
set(CMAKE_C_STANDARD 11)
|
||||||
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_C_EXTENSIONS ON)
|
||||||
|
|
||||||
|
|
||||||
|
# Define the build type
|
||||||
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
|
set(CMAKE_BUILD_TYPE "Debug")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Set the project name
|
||||||
|
set(CMAKE_PROJECT_NAME shoot)
|
||||||
|
|
||||||
|
# Enable compile command to ease indexing with e.g. clangd
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
|
||||||
|
|
||||||
|
# Core project settings
|
||||||
|
project(${CMAKE_PROJECT_NAME})
|
||||||
|
message("Build type: " ${CMAKE_BUILD_TYPE})
|
||||||
|
|
||||||
|
# Enable CMake support for ASM and C languages
|
||||||
|
enable_language(C ASM)
|
||||||
|
|
||||||
|
# Create an executable object type
|
||||||
|
add_executable(${CMAKE_PROJECT_NAME})
|
||||||
|
|
||||||
|
# Add STM32CubeMX generated sources
|
||||||
|
add_subdirectory(cmake/stm32cubemx)
|
||||||
|
|
||||||
|
# Link directories setup
|
||||||
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined library search paths
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add sources to executable
|
||||||
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user sources here
|
||||||
|
# User/bsp sources
|
||||||
|
User/bsp/can.c
|
||||||
|
User/bsp/dwt.c
|
||||||
|
User/bsp/mm.c
|
||||||
|
User/bsp/time.c
|
||||||
|
User/bsp/uart.c
|
||||||
|
|
||||||
|
# User/component sources
|
||||||
|
User/component/at9s_pro_cmd.c
|
||||||
|
User/component/filter.c
|
||||||
|
User/component/pid.c
|
||||||
|
User/component/user_math.c
|
||||||
|
|
||||||
|
# User/device sources
|
||||||
|
User/device/AT9S_Pro.c
|
||||||
|
User/device/motor.c
|
||||||
|
User/device/motor_rm.c
|
||||||
|
User/device/vofa.c
|
||||||
|
|
||||||
|
# User/module sources
|
||||||
|
User/module/config.c
|
||||||
|
User/module/shoot.c
|
||||||
|
|
||||||
|
# User/task sources
|
||||||
|
User/task/cmd.c
|
||||||
|
User/task/init.c
|
||||||
|
User/task/rc.c
|
||||||
|
User/task/shoot_ctrl.c
|
||||||
|
User/task/user_task.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add include paths
|
||||||
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined include paths
|
||||||
|
User
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add project symbols (macros)
|
||||||
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined symbols
|
||||||
|
)
|
||||||
|
|
||||||
|
# Remove wrong libob.a library dependency when using cpp files
|
||||||
|
list(REMOVE_ITEM CMAKE_C_IMPLICIT_LINK_LIBRARIES ob)
|
||||||
|
|
||||||
|
# Add linked libraries
|
||||||
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||||
|
stm32cubemx
|
||||||
|
|
||||||
|
# Add user defined libraries
|
||||||
|
)
|
||||||
38
CMakePresets.json
Normal file
38
CMakePresets.json
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "default",
|
||||||
|
"hidden": true,
|
||||||
|
"generator": "Ninja",
|
||||||
|
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||||
|
"toolchainFile": "${sourceDir}/cmake/gcc-arm-none-eabi.cmake",
|
||||||
|
"cacheVariables": {
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "Debug",
|
||||||
|
"configurePreset": "Debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"configurePreset": "Release"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
244
Core/Src/syscalls.c
Normal file
244
Core/Src/syscalls.c
Normal file
@ -0,0 +1,244 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file syscalls.c
|
||||||
|
* @author Auto-generated by STM32CubeMX
|
||||||
|
* @brief Minimal System calls file
|
||||||
|
*
|
||||||
|
* For more information about which c-functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the Newlib or Picolibc libc-manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020-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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
|
#include <sys/times.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* Variables */
|
||||||
|
extern int __io_putchar(int ch) __attribute__((weak));
|
||||||
|
extern int __io_getchar(void) __attribute__((weak));
|
||||||
|
|
||||||
|
|
||||||
|
char *__env[1] = { 0 };
|
||||||
|
char **environ = __env;
|
||||||
|
|
||||||
|
|
||||||
|
/* Functions */
|
||||||
|
void initialise_monitor_handles()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
int _getpid(void)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _kill(int pid, int sig)
|
||||||
|
{
|
||||||
|
(void)pid;
|
||||||
|
(void)sig;
|
||||||
|
errno = EINVAL;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void _exit (int status)
|
||||||
|
{
|
||||||
|
_kill(status, -1);
|
||||||
|
while (1) {} /* Make sure we hang here */
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _read(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
*ptr++ = __io_getchar();
|
||||||
|
}
|
||||||
|
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
__attribute__((weak)) int _write(int file, char *ptr, int len)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
int DataIdx;
|
||||||
|
|
||||||
|
for (DataIdx = 0; DataIdx < len; DataIdx++)
|
||||||
|
{
|
||||||
|
__io_putchar(*ptr++);
|
||||||
|
}
|
||||||
|
return len;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _close(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int _fstat(int file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _isatty(int file)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _lseek(int file, int ptr, int dir)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
(void)ptr;
|
||||||
|
(void)dir;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _open(char *path, int flags, ...)
|
||||||
|
{
|
||||||
|
(void)path;
|
||||||
|
(void)flags;
|
||||||
|
/* Pretend like we always fail */
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _wait(int *status)
|
||||||
|
{
|
||||||
|
(void)status;
|
||||||
|
errno = ECHILD;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _unlink(char *name)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
errno = ENOENT;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
clock_t _times(struct tms *buf)
|
||||||
|
{
|
||||||
|
(void)buf;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _stat(const char *file, struct stat *st)
|
||||||
|
{
|
||||||
|
(void)file;
|
||||||
|
st->st_mode = S_IFCHR;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _link(char *old, char *new)
|
||||||
|
{
|
||||||
|
(void)old;
|
||||||
|
(void)new;
|
||||||
|
errno = EMLINK;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _fork(void)
|
||||||
|
{
|
||||||
|
errno = EAGAIN;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _execve(char *name, char **argv, char **env)
|
||||||
|
{
|
||||||
|
(void)name;
|
||||||
|
(void)argv;
|
||||||
|
(void)env;
|
||||||
|
errno = ENOMEM;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- Picolibc Specific Section ---
|
||||||
|
#if defined(__PICOLIBC__)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Picolibc helper function to output a character to a FILE stream.
|
||||||
|
* This redirects the output to the low-level __io_putchar function.
|
||||||
|
* @param c Character to write.
|
||||||
|
* @param file FILE stream pointer (ignored).
|
||||||
|
* @retval int The character written.
|
||||||
|
*/
|
||||||
|
static int starm_putc(char c, FILE *file)
|
||||||
|
{
|
||||||
|
(void) file;
|
||||||
|
__io_putchar(c);
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Picolibc helper function to input a character from a FILE stream.
|
||||||
|
* This redirects the input from the low-level __io_getchar function.
|
||||||
|
* @param file FILE stream pointer (ignored).
|
||||||
|
* @retval int The character read, cast to an unsigned char then int.
|
||||||
|
*/
|
||||||
|
static int starm_getc(FILE *file)
|
||||||
|
{
|
||||||
|
unsigned char c;
|
||||||
|
(void) file;
|
||||||
|
c = __io_getchar();
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Define and initialize the standard I/O streams for Picolibc.
|
||||||
|
// FDEV_SETUP_STREAM connects the starm_putc and starm_getc helper functions to a FILE structure.
|
||||||
|
// _FDEV_SETUP_RW indicates the stream is for reading and writing.
|
||||||
|
static FILE __stdio = FDEV_SETUP_STREAM(starm_putc,
|
||||||
|
starm_getc,
|
||||||
|
NULL,
|
||||||
|
_FDEV_SETUP_RW);
|
||||||
|
|
||||||
|
// Assign the standard stream pointers (stdin, stdout, stderr) to the initialized stream.
|
||||||
|
// Picolibc uses these pointers for standard I/O operations (printf, scanf, etc.).
|
||||||
|
FILE *const stdin = &__stdio;
|
||||||
|
__strong_reference(stdin, stdout);
|
||||||
|
__strong_reference(stdin, stderr);
|
||||||
|
|
||||||
|
// Create strong aliases mapping standard C library function names (without underscore)
|
||||||
|
// to the implemented system call stubs (with underscore). Picolibc uses these
|
||||||
|
// standard names internally, so this linking is required.
|
||||||
|
__strong_reference(_read, read);
|
||||||
|
__strong_reference(_write, write);
|
||||||
|
__strong_reference(_times, times);
|
||||||
|
__strong_reference(_execve, execve);
|
||||||
|
__strong_reference(_fork, fork);
|
||||||
|
__strong_reference(_link, link);
|
||||||
|
__strong_reference(_unlink, unlink);
|
||||||
|
__strong_reference(_stat, stat);
|
||||||
|
__strong_reference(_wait, wait);
|
||||||
|
__strong_reference(_open, open);
|
||||||
|
__strong_reference(_close, close);
|
||||||
|
__strong_reference(_lseek, lseek);
|
||||||
|
__strong_reference(_isatty, isatty);
|
||||||
|
__strong_reference(_fstat, fstat);
|
||||||
|
__strong_reference(_exit, exit);
|
||||||
|
__strong_reference(_kill, kill);
|
||||||
|
__strong_reference(_getpid, getpid);
|
||||||
|
|
||||||
|
#endif //__PICOLIBC__
|
||||||
87
Core/Src/sysmem.c
Normal file
87
Core/Src/sysmem.c
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file sysmem.c
|
||||||
|
* @author Generated by STM32CubeMX
|
||||||
|
* @brief System Memory calls file
|
||||||
|
*
|
||||||
|
* For more information about which C functions
|
||||||
|
* need which of these lowlevel functions
|
||||||
|
* please consult the Newlib or Picolibc libc manual
|
||||||
|
******************************************************************************
|
||||||
|
* @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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Includes */
|
||||||
|
#include <errno.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pointer to the current high watermark of the heap usage
|
||||||
|
*/
|
||||||
|
static uint8_t *__sbrk_heap_end = NULL;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief _sbrk() allocates memory to the newlib heap and is used by malloc
|
||||||
|
* and others from the C library
|
||||||
|
*
|
||||||
|
* @verbatim
|
||||||
|
* ############################################################################
|
||||||
|
* # .data # .bss # newlib heap # MSP stack #
|
||||||
|
* # # # # Reserved by _Min_Stack_Size #
|
||||||
|
* ############################################################################
|
||||||
|
* ^-- RAM start ^-- _end _estack, RAM end --^
|
||||||
|
* @endverbatim
|
||||||
|
*
|
||||||
|
* This implementation starts allocating at the '_end' linker symbol
|
||||||
|
* The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
|
||||||
|
* The implementation considers '_estack' linker symbol to be RAM end
|
||||||
|
* NOTE: If the MSP stack, at any point during execution, grows larger than the
|
||||||
|
* reserved size, please increase the '_Min_Stack_Size'.
|
||||||
|
*
|
||||||
|
* @param incr Memory size
|
||||||
|
* @return Pointer to allocated memory
|
||||||
|
*/
|
||||||
|
void *_sbrk(ptrdiff_t incr)
|
||||||
|
{
|
||||||
|
extern uint8_t _end; /* Symbol defined in the linker script */
|
||||||
|
extern uint8_t _estack; /* Symbol defined in the linker script */
|
||||||
|
extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
|
||||||
|
const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
|
||||||
|
const uint8_t *max_heap = (uint8_t *)stack_limit;
|
||||||
|
uint8_t *prev_heap_end;
|
||||||
|
|
||||||
|
/* Initialize heap end at first call */
|
||||||
|
if (NULL == __sbrk_heap_end)
|
||||||
|
{
|
||||||
|
__sbrk_heap_end = &_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Protect heap from growing into the reserved MSP stack */
|
||||||
|
if (__sbrk_heap_end + incr > max_heap)
|
||||||
|
{
|
||||||
|
errno = ENOMEM;
|
||||||
|
return (void *)-1;
|
||||||
|
}
|
||||||
|
|
||||||
|
prev_heap_end = __sbrk_heap_end;
|
||||||
|
__sbrk_heap_end += incr;
|
||||||
|
|
||||||
|
return (void *)prev_heap_end;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if defined(__PICOLIBC__)
|
||||||
|
// Picolibc expects syscalls without the leading underscore.
|
||||||
|
// This creates a strong alias so that
|
||||||
|
// calls to `sbrk()` are resolved to our `_sbrk()` implementation.
|
||||||
|
__strong_reference(_sbrk, sbrk);
|
||||||
|
#endif
|
||||||
269
STM32F407XX_FLASH.ld
Normal file
269
STM32F407XX_FLASH.ld
Normal file
@ -0,0 +1,269 @@
|
|||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
**
|
||||||
|
|
||||||
|
** File : LinkerScript.ld
|
||||||
|
**
|
||||||
|
** Author : STM32CubeMX
|
||||||
|
**
|
||||||
|
** Abstract : Linker script for STM32F407IGHx series
|
||||||
|
** 1024Kbytes FLASH and 192Kbytes RAM
|
||||||
|
**
|
||||||
|
** Set heap size, stack size and stack location according
|
||||||
|
** to application requirements.
|
||||||
|
**
|
||||||
|
** Set memory bank area and size if external memory is used.
|
||||||
|
**
|
||||||
|
** Target : STMicroelectronics STM32
|
||||||
|
**
|
||||||
|
** Distribution: The file is distributed “as is,” without any warranty
|
||||||
|
** of any kind.
|
||||||
|
**
|
||||||
|
*****************************************************************************
|
||||||
|
** @attention
|
||||||
|
**
|
||||||
|
** <h2><center>© COPYRIGHT(c) 2025 STMicroelectronics</center></h2>
|
||||||
|
**
|
||||||
|
** Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
** are permitted provided that the following conditions are met:
|
||||||
|
** 1. Redistributions of source code must retain the above copyright notice,
|
||||||
|
** this list of conditions and the following disclaimer.
|
||||||
|
** 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
** this list of conditions and the following disclaimer in the documentation
|
||||||
|
** and/or other materials provided with the distribution.
|
||||||
|
** 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||||
|
** may be used to endorse or promote products derived from this software
|
||||||
|
** without specific prior written permission.
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||||
|
** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||||
|
** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||||
|
** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
**
|
||||||
|
*****************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Entry Point */
|
||||||
|
ENTRY(Reset_Handler)
|
||||||
|
|
||||||
|
/* Specify the memory areas */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
|
||||||
|
CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
|
||||||
|
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Highest address of the user mode stack */
|
||||||
|
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of RAM */
|
||||||
|
/* Generate a link error if heap and stack don't fit into RAM */
|
||||||
|
_Min_Heap_Size = 0x200; /* required amount of heap */
|
||||||
|
_Min_Stack_Size = 0x400; /* required amount of stack */
|
||||||
|
|
||||||
|
/* Define output sections */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The startup code goes first into FLASH */
|
||||||
|
.isr_vector :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
/* The program code and other data goes into FLASH */
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.text) /* .text sections (code) */
|
||||||
|
*(.text*) /* .text* sections (code) */
|
||||||
|
*(.glue_7) /* glue arm to thumb code */
|
||||||
|
*(.glue_7t) /* glue thumb to arm code */
|
||||||
|
*(.eh_frame)
|
||||||
|
|
||||||
|
KEEP (*(.init))
|
||||||
|
KEEP (*(.fini))
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_etext = .; /* define a global symbols at end of code */
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
/* Constant data goes into FLASH */
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||||
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
__exidx_start = .;
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = .;
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
|
KEEP (*(.preinit_array*))
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array*))
|
||||||
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
KEEP (*(.fini_array*))
|
||||||
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
_siccmram = LOADADDR(.ccmram);
|
||||||
|
|
||||||
|
/* CCM-RAM section
|
||||||
|
*
|
||||||
|
* IMPORTANT NOTE!
|
||||||
|
* If initialized variables will be placed in this section,
|
||||||
|
* the startup code needs to be modified to copy the init-values.
|
||||||
|
*/
|
||||||
|
.ccmram :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sccmram = .; /* create a global symbol at ccmram start */
|
||||||
|
*(.ccmram)
|
||||||
|
*(.ccmram*)
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_eccmram = .; /* create a global symbol at ccmram end */
|
||||||
|
} >CCMRAM AT> FLASH
|
||||||
|
|
||||||
|
/* used by the startup to initialize data */
|
||||||
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
. = ALIGN(4);
|
||||||
|
_sdata = .; /* create a global symbol at data start */
|
||||||
|
*(.data) /* .data sections */
|
||||||
|
*(.data*) /* .data* sections */
|
||||||
|
*(.RamFunc) /* .RamFunc sections */
|
||||||
|
*(.RamFunc*) /* .RamFunc* sections */
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
} >RAM AT> FLASH
|
||||||
|
|
||||||
|
/* Initialized TLS data section */
|
||||||
|
.tdata : ALIGN(4)
|
||||||
|
{
|
||||||
|
*(.tdata .tdata.* .gnu.linkonce.td.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
_edata = .; /* define a global symbol at data end */
|
||||||
|
PROVIDE(__data_end = .);
|
||||||
|
PROVIDE(__tdata_end = .);
|
||||||
|
} >RAM AT> FLASH
|
||||||
|
|
||||||
|
PROVIDE( __tdata_start = ADDR(.tdata) );
|
||||||
|
PROVIDE( __tdata_size = __tdata_end - __tdata_start );
|
||||||
|
|
||||||
|
PROVIDE( __data_start = ADDR(.data) );
|
||||||
|
PROVIDE( __data_size = __data_end - __data_start );
|
||||||
|
|
||||||
|
PROVIDE( __tdata_source = LOADADDR(.tdata) );
|
||||||
|
PROVIDE( __tdata_source_end = LOADADDR(.tdata) + SIZEOF(.tdata) );
|
||||||
|
PROVIDE( __tdata_source_size = __tdata_source_end - __tdata_source );
|
||||||
|
|
||||||
|
PROVIDE( __data_source = LOADADDR(.data) );
|
||||||
|
PROVIDE( __data_source_end = __tdata_source_end );
|
||||||
|
PROVIDE( __data_source_size = __data_source_end - __data_source );
|
||||||
|
/* Uninitialized data section */
|
||||||
|
.tbss (NOLOAD) : ALIGN(4)
|
||||||
|
{
|
||||||
|
/* This is used by the startup in order to initialize the .bss secion */
|
||||||
|
_sbss = .; /* define a global symbol at bss start */
|
||||||
|
__bss_start__ = _sbss;
|
||||||
|
*(.tbss .tbss.*)
|
||||||
|
. = ALIGN(4);
|
||||||
|
PROVIDE( __tbss_end = . );
|
||||||
|
} >RAM
|
||||||
|
|
||||||
|
PROVIDE( __tbss_start = ADDR(.tbss) );
|
||||||
|
PROVIDE( __tbss_size = __tbss_end - __tbss_start );
|
||||||
|
PROVIDE( __tbss_offset = ADDR(.tbss) - ADDR(.tdata) );
|
||||||
|
|
||||||
|
PROVIDE( __tls_base = __tdata_start );
|
||||||
|
PROVIDE( __tls_end = __tbss_end );
|
||||||
|
PROVIDE( __tls_size = __tls_end - __tls_base );
|
||||||
|
PROVIDE( __tls_align = MAX(ALIGNOF(.tdata), ALIGNOF(.tbss)) );
|
||||||
|
PROVIDE( __tls_size_align = (__tls_size + __tls_align - 1) & ~(__tls_align - 1) );
|
||||||
|
PROVIDE( __arm32_tls_tcb_offset = MAX(8, __tls_align) );
|
||||||
|
PROVIDE( __arm64_tls_tcb_offset = MAX(16, __tls_align) );
|
||||||
|
|
||||||
|
.bss (NOLOAD) : ALIGN(4)
|
||||||
|
{
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = .; /* define a global symbol at bss end */
|
||||||
|
__bss_end__ = _ebss;
|
||||||
|
PROVIDE( __bss_end = .);
|
||||||
|
} >RAM
|
||||||
|
PROVIDE( __non_tls_bss_start = ADDR(.bss) );
|
||||||
|
|
||||||
|
PROVIDE( __bss_start = __tbss_start );
|
||||||
|
PROVIDE( __bss_size = __bss_end - __bss_start );
|
||||||
|
|
||||||
|
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||||
|
._user_heap_stack (NOLOAD) :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
PROVIDE ( end = . );
|
||||||
|
PROVIDE ( _end = . );
|
||||||
|
. = . + _Min_Heap_Size;
|
||||||
|
. = . + _Min_Stack_Size;
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >RAM
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* Remove information from the standard libraries */
|
||||||
|
/DISCARD/ :
|
||||||
|
{
|
||||||
|
libc.a:* ( * )
|
||||||
|
libm.a:* ( * )
|
||||||
|
libgcc.a:* ( * )
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -15,44 +15,106 @@
|
|||||||
|
|
||||||
// 机器人参数配置
|
// 机器人参数配置
|
||||||
Config_RobotParam_t robot_config = {
|
Config_RobotParam_t robot_config = {
|
||||||
|
.shoot_param = {
|
||||||
|
.proj=SHOOT_PROJECTILE_42MM,
|
||||||
|
.fric_num=6,
|
||||||
.shoot_param = {
|
|
||||||
.proj=SHOOT_PROJECTILE_17MM,
|
|
||||||
.fric_num=2,
|
|
||||||
.extra_deceleration_ratio=1.0f,
|
.extra_deceleration_ratio=1.0f,
|
||||||
.num_trig_tooth=4,
|
.num_trig_tooth=5,
|
||||||
.shot_freq=20.0f,
|
.shot_freq=1.0f,
|
||||||
.shot_burst_num=10,
|
.shot_burst_num=3,
|
||||||
.num_multilevel=1,
|
.num_multilevel=2,
|
||||||
.jam_enable=false,
|
.ratio_multilevel = {0.8f, 1.0f},
|
||||||
.jam_threshold=120.0f,
|
.fric_motor_param = {
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x201,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = false,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x202,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = true,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x203,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = true,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x204,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = false,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x205,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = true,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=2,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.param = {
|
||||||
|
.can = BSP_CAN_2,
|
||||||
|
.id = 0x206,
|
||||||
|
.module = MOTOR_M3508,
|
||||||
|
.reverse = false,
|
||||||
|
.gear = false,
|
||||||
|
},
|
||||||
|
.level=2,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
.jam_enable=true,
|
||||||
|
.jam_threshold=240.0f,
|
||||||
.jam_suspected_time=0.5f,
|
.jam_suspected_time=0.5f,
|
||||||
.trig_motor_param = {
|
.trig_motor_param = {
|
||||||
.can = BSP_CAN_2,
|
.can = BSP_CAN_1,
|
||||||
.id = 0x207,
|
.id = 0x207,
|
||||||
.module = MOTOR_M2006,
|
.module = MOTOR_M3508,
|
||||||
.reverse = true,
|
.reverse = false,
|
||||||
.gear=true,
|
.gear=true,
|
||||||
},
|
},
|
||||||
|
|
||||||
.fric_follow = {
|
.fric_follow = {
|
||||||
.k=1.0f,
|
.k=1.0f,
|
||||||
.p=1.8f,
|
.p=1.8f,
|
||||||
.i=0.0f,
|
.i=0.1f,
|
||||||
.d=0.0f,
|
.d=0.05f,
|
||||||
.i_limit=0.0f,
|
.i_limit=0.1f,
|
||||||
.out_limit=0.9f,
|
.out_limit=0.9f,
|
||||||
.d_cutoff_freq=30.0f,
|
.d_cutoff_freq=30.0f,
|
||||||
.range=-1.0f,
|
.range=-1.0f,
|
||||||
},
|
},
|
||||||
.fric_err = {
|
.fric_err = {
|
||||||
.k=1.0f,
|
.k=0.0f,
|
||||||
.p=4.0f,
|
.p=4.0f,
|
||||||
.i=0.4f,
|
.i=0.4f,
|
||||||
.d=0.04f,
|
.d=0.04f,
|
||||||
.i_limit=0.25f,
|
.i_limit=0.25f,
|
||||||
.out_limit=0.25f,
|
.out_limit=0.01f,
|
||||||
.d_cutoff_freq=40.0f,
|
.d_cutoff_freq=40.0f,
|
||||||
.range=-1.0f,
|
.range=-1.0f,
|
||||||
},
|
},
|
||||||
@ -107,6 +169,7 @@ Config_RobotParam_t robot_config = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/* Private function prototypes ---------------------------------------------- */
|
/* Private function prototypes ---------------------------------------------- */
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
|
|
||||||
@ -116,43 +179,4 @@ Config_RobotParam_t robot_config = {
|
|||||||
*/
|
*/
|
||||||
Config_RobotParam_t* Config_GetRobotParam(void) {
|
Config_RobotParam_t* Config_GetRobotParam(void) {
|
||||||
return &robot_config;
|
return &robot_config;
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief 初始化发射部分配置参数
|
|
||||||
* @return 初始化结果
|
|
||||||
*/
|
|
||||||
int8_t Config_ShootInit(void) {
|
|
||||||
int fric_num = robot_config.shoot_param.fric_num;
|
|
||||||
int num_multilevel = robot_config.shoot_param.num_multilevel;
|
|
||||||
robot_config.shoot_param.fric_motor_param = (Shoot_MOTOR_RM_Param_t *)BSP_Malloc(fric_num * sizeof(Shoot_MOTOR_RM_Param_t));
|
|
||||||
if (robot_config.shoot_param.fric_motor_param == NULL) {
|
|
||||||
BSP_Free(robot_config.shoot_param.fric_motor_param);
|
|
||||||
return -1; // 内存分配失败
|
|
||||||
}
|
|
||||||
robot_config.shoot_param.ratio_multilevel = (float *)BSP_Malloc(num_multilevel * sizeof(float));
|
|
||||||
if (robot_config.shoot_param.ratio_multilevel == NULL) {
|
|
||||||
BSP_Free(robot_config.shoot_param.ratio_multilevel);
|
|
||||||
return -1; // 内存分配失败
|
|
||||||
}
|
|
||||||
/* 初始化摩擦轮电机参数 */
|
|
||||||
for (uint8_t i = 0; i < fric_num; i++) {
|
|
||||||
robot_config.shoot_param.fric_motor_param[i].param = (MOTOR_RM_Param_t){
|
|
||||||
.can = BSP_CAN_2,
|
|
||||||
.id = 0x201 + i,
|
|
||||||
.module = MOTOR_M3508,
|
|
||||||
/*设置电机反装;example***********************
|
|
||||||
.reverse = (i == 0||i == 2) ? true : false,*/
|
|
||||||
.reverse = (i == 1) ? true : false,
|
|
||||||
.gear = false,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/*规定电机属于哪级发射;example************************
|
|
||||||
robot_config.shoot_param.fric_motor_param[0].level=1;*/
|
|
||||||
robot_config.shoot_param.fric_motor_param[0].level=1;
|
|
||||||
robot_config.shoot_param.fric_motor_param[1].level=1;
|
|
||||||
/*规定各级摩擦轮转速比;example*********************
|
|
||||||
robot_config.shoot_param.ratio_multilevel[0]=1.0f;*/
|
|
||||||
robot_config.shoot_param.ratio_multilevel[0]=1.0f;
|
|
||||||
return SHOOT_OK;
|
|
||||||
}
|
}
|
||||||
@ -12,7 +12,7 @@ extern "C" {
|
|||||||
#include "component/pid.h"
|
#include "component/pid.h"
|
||||||
#include "device/motor.h"
|
#include "device/motor.h"
|
||||||
#include "device/motor_rm.h"
|
#include "device/motor_rm.h"
|
||||||
#include "module/shoot_control.h"
|
#include "module/shoot.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Shoot_Params_t shoot_param;
|
Shoot_Params_t shoot_param;
|
||||||
@ -25,7 +25,6 @@ typedef struct {
|
|||||||
* @return 机器人配置参数指针
|
* @return 机器人配置参数指针
|
||||||
*/
|
*/
|
||||||
Config_RobotParam_t* Config_GetRobotParam(void);
|
Config_RobotParam_t* Config_GetRobotParam(void);
|
||||||
int8_t Config_ShootInit(void);
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,40 +1,10 @@
|
|||||||
/*
|
/*
|
||||||
* far♂蛇模块
|
* far♂蛇模块
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/****************************************************************************/
|
/********************************* 使用示例 **********************************/
|
||||||
/********************************* 新手教程 **********************************/
|
|
||||||
|
|
||||||
/*1.配置config参数以及Config_ShootInit函数参数*/
|
/*1.配置config参数以及Config_ShootInit函数参数*/
|
||||||
/*2.在cmd任务中获取遥控器数据,如下解析后发送给shoot任务
|
/*2.
|
||||||
DEVICE_AT9S_t at9s_from_rc;
|
|
||||||
Shoot_CMD_t cmd_for_shoot;
|
|
||||||
osMessageQueueGet(task_runtime.msgq.cmd.rc, &at9s_from_rc, NULL, 0);
|
|
||||||
|
|
||||||
switch (at9s_from_rc.data.key_C) {
|
|
||||||
case AT9S_CMD_SW_DOWN:
|
|
||||||
cmd_for_shoot.online = at9s_from_rc.online;
|
|
||||||
cmd_for_shoot.ready = true;
|
|
||||||
cmd_for_shoot.firecmd = true;
|
|
||||||
break;
|
|
||||||
case AT9S_CMD_SW_MID:
|
|
||||||
cmd_for_shoot.online = at9s_from_rc.online;
|
|
||||||
cmd_for_shoot.ready = true;
|
|
||||||
cmd_for_shoot.firecmd = false;
|
|
||||||
break;
|
|
||||||
case AT9S_CMD_SW_UP:
|
|
||||||
cmd_for_shoot.online = at9s_from_rc.online;
|
|
||||||
cmd_for_shoot.ready = false;
|
|
||||||
cmd_for_shoot.firecmd = false;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
cmd_for_shoot.online = at9s_from_rc.online;
|
|
||||||
cmd_for_shoot.ready = false;
|
|
||||||
cmd_for_shoot.firecmd = false;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
osMessageQueuePut(task_runtime.msgq.shoot.cmd, &cmd_for_shoot, 0, 0);*/
|
|
||||||
/*3.在shoot任务中完成初始化,接收控制指令以及控制函数调用
|
|
||||||
COMP_AT9S_CMD_t shoot_ctrl_cmd_rc;
|
COMP_AT9S_CMD_t shoot_ctrl_cmd_rc;
|
||||||
Shoot_t shoot;
|
Shoot_t shoot;
|
||||||
Shoot_CMD_t shoot_cmd;
|
Shoot_CMD_t shoot_cmd;
|
||||||
@ -43,22 +13,26 @@ void Task(void *argument) {
|
|||||||
|
|
||||||
Config_ShootInit();
|
Config_ShootInit();
|
||||||
Shoot_Init(&shoot,&Config_GetRobotParam()->shoot_param,SHOOT_CTRL_FREQ);
|
Shoot_Init(&shoot,&Config_GetRobotParam()->shoot_param,SHOOT_CTRL_FREQ);
|
||||||
/*关于模式切换,有两种方式:1.初始化一个模式
|
Shoot_SetMode(&shoot,SHOOT_MODE_SINGLE); 关于模式选择:初始化一个模式
|
||||||
Shoot_SetMode(&shoot,SHOOT_MODE_SINGLE);
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/*关于模式切换,有两种方式:2.或者用遥控器某一摇杆随时切换模式
|
|
||||||
shoot.mode =shoot_ctrl_cmd_rc.mode;
|
shoot_cmd.online =shoot_ctrl_cmd_rc.online;
|
||||||
osMessageQueueGet(task_runtime.msgq.shoot.cmd, &shoot_cmd, NULL, 0);
|
shoot_cmd.ready =shoot_ctrl_cmd_rc.shoot.ready;
|
||||||
Shoot_UpdateFeedback(&shoot);
|
shoot_cmd.firecmd =shoot_ctrl_cmd_rc.shoot.firecmd;
|
||||||
Shoot_Control(&shoot,&shoot_cmd);
|
|
||||||
|
shoot.mode =shoot_ctrl_cmd_rc.mode; 关于模式选择:或者用遥控器随时切换模式,二选一
|
||||||
|
|
||||||
|
Chassis_UpdateFeedback(&shoot);
|
||||||
|
Shoot_Control(&shoot,&shoot_cmd);
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
/****************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
/* Includes ----------------------------------------------------------------- */
|
/* Includes ----------------------------------------------------------------- */
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "shoot_control.h"
|
#include "shoot.h"
|
||||||
#include "bsp/mm.h"
|
#include "bsp/mm.h"
|
||||||
#include "bsp/time.h"
|
#include "bsp/time.h"
|
||||||
#include "component/filter.h"
|
#include "component/filter.h"
|
||||||
@ -163,6 +137,22 @@ int8_t Shoot_ResetOutput(Shoot_t *s)
|
|||||||
s->output.outlpf_trig=0.0f;
|
s->output.outlpf_trig=0.0f;
|
||||||
return SHOOT_OK;
|
return SHOOT_OK;
|
||||||
}
|
}
|
||||||
|
//float last_angle=0.0f;
|
||||||
|
//float speed=0.0f;
|
||||||
|
//int8_t Shoot_CalufeedbackRPM(Shoot_t *s)
|
||||||
|
//{
|
||||||
|
// if (s == NULL) {
|
||||||
|
// return SHOOT_ERR_NULL; // 参数错误
|
||||||
|
// }
|
||||||
|
//// static
|
||||||
|
// float err;
|
||||||
|
// err=CircleError(s->feedback.fric[0].rotor_abs_angle,last_angle,M_2PI);
|
||||||
|
// speed=err/s->dt/M_2PI*60.0f;
|
||||||
|
// last_angle=s->feedback.fric->rotor_abs_angle;
|
||||||
|
|
||||||
|
|
||||||
|
// return SHOOT_OK;
|
||||||
|
//}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief 根据目标弹丸速度计算摩擦轮目标转速
|
* \brief 根据目标弹丸速度计算摩擦轮目标转速
|
||||||
@ -180,10 +170,10 @@ int8_t Shoot_CaluTargetRPM(Shoot_t *s, float target_speed)
|
|||||||
switch(s->param->proj)
|
switch(s->param->proj)
|
||||||
{
|
{
|
||||||
case SHOOT_PROJECTILE_17MM:
|
case SHOOT_PROJECTILE_17MM:
|
||||||
s->target_variable.target_rpm=5000.0f/MAX_FRIC_RPM;
|
s->target_variable.target_rpm=5000.0f;
|
||||||
break;
|
break;
|
||||||
case SHOOT_PROJECTILE_42MM:
|
case SHOOT_PROJECTILE_42MM:
|
||||||
s->target_variable.target_rpm=5000.0f/MAX_FRIC_RPM;
|
s->target_variable.target_rpm=3000.0f;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return SHOOT_OK;
|
return SHOOT_OK;
|
||||||
@ -221,7 +211,7 @@ int8_t Shoot_CaluTargetAngle(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
*
|
*
|
||||||
* \return 函数运行结果
|
* \return 函数运行结果
|
||||||
*/
|
*/
|
||||||
int8_t Chassis_UpdateFeedback(Shoot_t *s)
|
int8_t Shoot_UpdateFeedback(Shoot_t *s)
|
||||||
{
|
{
|
||||||
if (s == NULL) {
|
if (s == NULL) {
|
||||||
return SHOOT_ERR_NULL; // 参数错误
|
return SHOOT_ERR_NULL; // 参数错误
|
||||||
@ -278,7 +268,6 @@ int8_t Shoot_RunningFSM(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
return SHOOT_ERR_NULL; // 参数错误
|
return SHOOT_ERR_NULL; // 参数错误
|
||||||
}
|
}
|
||||||
uint8_t fric_num = s->param->fric_num;
|
uint8_t fric_num = s->param->fric_num;
|
||||||
uint8_t num_multilevel = s->param->num_multilevel;
|
|
||||||
if(!s->online /*|| s->mode==SHOOT_MODE_SAFE*/){
|
if(!s->online /*|| s->mode==SHOOT_MODE_SAFE*/){
|
||||||
for(int i=0;i<fric_num;i++)
|
for(int i=0;i<fric_num;i++)
|
||||||
{
|
{
|
||||||
@ -290,7 +279,6 @@ int8_t Shoot_RunningFSM(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
static float pos;
|
static float pos;
|
||||||
switch(s->running_state)
|
switch(s->running_state)
|
||||||
{
|
{
|
||||||
|
|
||||||
case SHOOT_STATE_IDLE:/*熄火等待*/
|
case SHOOT_STATE_IDLE:/*熄火等待*/
|
||||||
for(int i=0;i<fric_num;i++)
|
for(int i=0;i<fric_num;i++)
|
||||||
{ /* 转速归零 */
|
{ /* 转速归零 */
|
||||||
@ -317,11 +305,10 @@ int8_t Shoot_RunningFSM(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOOT_STATE_READY:/*准备射击*/
|
case SHOOT_STATE_READY:/*准备射击*/
|
||||||
Shoot_CaluTargetRPM(s,233);
|
|
||||||
for(int i=0;i<fric_num;i++)
|
for(int i=0;i<fric_num;i++)
|
||||||
{
|
{
|
||||||
uint8_t level=s->param->fric_motor_param->level-1;
|
uint8_t level=s->param->fric_motor_param->level-1;
|
||||||
float target_rpm=s->param->ratio_multilevel[level]*s->target_variable.target_rpm;
|
float target_rpm=s->param->ratio_multilevel[level]*s->target_variable.target_rpm/MAX_FRIC_RPM;
|
||||||
/* 计算跟随输出、计算修正输出 */
|
/* 计算跟随输出、计算修正输出 */
|
||||||
a=s->target_variable.target_rpm/MAX_FRIC_RPM;
|
a=s->target_variable.target_rpm/MAX_FRIC_RPM;
|
||||||
s->output.out_follow[i]=PID_Calc(&s->pid.fric_follow[i],
|
s->output.out_follow[i]=PID_Calc(&s->pid.fric_follow[i],
|
||||||
@ -363,7 +350,7 @@ int8_t Shoot_RunningFSM(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
Shoot_ResetOutput(s);
|
Shoot_ResetOutput(s);
|
||||||
s->running_state=SHOOT_STATE_IDLE;
|
s->running_state=SHOOT_STATE_IDLE;
|
||||||
}
|
}
|
||||||
else if(last_firecmd==false&&cmd->firecmd==true)
|
else if(last_firecmd==false&&cmd->firecmd==true)
|
||||||
{
|
{
|
||||||
s->running_state=SHOOT_STATE_FIRE;
|
s->running_state=SHOOT_STATE_FIRE;
|
||||||
/* 根据模式设置待发射弹数 */
|
/* 根据模式设置待发射弹数 */
|
||||||
@ -390,7 +377,7 @@ int8_t Shoot_RunningFSM(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
for(int i=0;i<fric_num;i++)
|
for(int i=0;i<fric_num;i++)
|
||||||
{
|
{
|
||||||
uint8_t level=s->param->fric_motor_param->level-1;
|
uint8_t level=s->param->fric_motor_param->level-1;
|
||||||
float target_rpm=s->param->ratio_multilevel[level]*s->target_variable.target_rpm;
|
float target_rpm=s->param->ratio_multilevel[level]*s->target_variable.target_rpm/MAX_FRIC_RPM;
|
||||||
/* 计算跟随输出、计算修正输出 */
|
/* 计算跟随输出、计算修正输出 */
|
||||||
s->output.out_follow[i]=PID_Calc(&s->pid.fric_follow[i],
|
s->output.out_follow[i]=PID_Calc(&s->pid.fric_follow[i],
|
||||||
target_rpm,
|
target_rpm,
|
||||||
@ -538,39 +525,6 @@ int8_t Shoot_Init(Shoot_t *s, Shoot_Params_t *param, float target_freq)
|
|||||||
}
|
}
|
||||||
uint8_t fric_num = param->fric_num;
|
uint8_t fric_num = param->fric_num;
|
||||||
|
|
||||||
/* 分配内存 */
|
|
||||||
s->param=param;
|
|
||||||
s->output.out_follow = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->output.out_err = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->output.out_fric = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->output.lpfout_fric = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->feedback.fric = (MOTOR_Feedback_t *) BSP_Malloc(fric_num * sizeof(MOTOR_Feedback_t));
|
|
||||||
s->feedback.fil_fric_rpm = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->feedback.fric_rpm = (float *) BSP_Malloc(fric_num * sizeof(float));
|
|
||||||
s->pid.fric_follow = (KPID_t *) BSP_Malloc(fric_num * sizeof(KPID_t));
|
|
||||||
s->pid.fric_err = (KPID_t *) BSP_Malloc(fric_num * sizeof(KPID_t));
|
|
||||||
s->filter.fric.in = (LowPassFilter2p_t *)BSP_Malloc(fric_num * sizeof(LowPassFilter2p_t));
|
|
||||||
s->filter.fric.out = (LowPassFilter2p_t *)BSP_Malloc(fric_num * sizeof(LowPassFilter2p_t));
|
|
||||||
|
|
||||||
/* 内存分配失败 */
|
|
||||||
if (s->feedback.fric == NULL || s->feedback.fil_fric_rpm == NULL || s->feedback.fric_rpm == NULL ||
|
|
||||||
s->output.out_follow == NULL || s->output.out_err == NULL || s->output.out_fric == NULL ||
|
|
||||||
s->output.lpfout_fric == NULL || s->param->fric_motor_param == NULL || s->pid.fric_follow == NULL ||
|
|
||||||
s->pid.fric_err == NULL || s->filter.fric.in == NULL || s->filter.fric.out == NULL) {
|
|
||||||
BSP_Free(s->feedback.fric);
|
|
||||||
BSP_Free(s->feedback.fil_fric_rpm);
|
|
||||||
BSP_Free(s->feedback.fric_rpm);
|
|
||||||
BSP_Free(s->output.out_follow);
|
|
||||||
BSP_Free(s->output.out_err);
|
|
||||||
BSP_Free(s->output.out_fric);
|
|
||||||
BSP_Free(s->output.lpfout_fric);
|
|
||||||
BSP_Free(s->param->fric_motor_param);
|
|
||||||
BSP_Free(s->pid.fric_follow);
|
|
||||||
BSP_Free(s->pid.fric_err);
|
|
||||||
BSP_Free(s->filter.fric.in);
|
|
||||||
BSP_Free(s->filter.fric.out);
|
|
||||||
return SHOOT_ERR_MALLOC;}
|
|
||||||
|
|
||||||
BSP_CAN_Init();
|
BSP_CAN_Init();
|
||||||
/* 初始化摩擦轮PID和滤波器 */
|
/* 初始化摩擦轮PID和滤波器 */
|
||||||
for(int i=0;i<fric_num;i++){
|
for(int i=0;i<fric_num;i++){
|
||||||
@ -621,7 +575,9 @@ int8_t Shoot_Control(Shoot_t *s, Shoot_CMD_t *cmd)
|
|||||||
s->dt =(BSP_TIME_Get_us() - s->lask_wakeup) / 1000000.0f;
|
s->dt =(BSP_TIME_Get_us() - s->lask_wakeup) / 1000000.0f;
|
||||||
s->lask_wakeup =BSP_TIME_Get_us();
|
s->lask_wakeup =BSP_TIME_Get_us();
|
||||||
s->online =cmd->online;
|
s->online =cmd->online;
|
||||||
|
Shoot_CaluTargetRPM(s,233);
|
||||||
Shoot_JamDetectionFSM(s, cmd);
|
Shoot_JamDetectionFSM(s, cmd);
|
||||||
|
// Shoot_CalufeedbackRPM(s);
|
||||||
return SHOOT_OK;
|
return SHOOT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
@ -24,6 +25,9 @@ extern "C" {
|
|||||||
|
|
||||||
#define MAX_FRIC_RPM 7000.0f
|
#define MAX_FRIC_RPM 7000.0f
|
||||||
#define MAX_TRIG_RPM 5000.0f//这里可能也会影响最高发射频率,待测试
|
#define MAX_TRIG_RPM 5000.0f//这里可能也会影响最高发射频率,待测试
|
||||||
|
|
||||||
|
#define MAX_FRIC_NUM 6
|
||||||
|
#define MAX_NUM_MULTILEVEL 2 /* 多级发射级数 */
|
||||||
/* Exported macro ----------------------------------------------------------- */
|
/* Exported macro ----------------------------------------------------------- */
|
||||||
/* Exported types ----------------------------------------------------------- */
|
/* Exported types ----------------------------------------------------------- */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -42,7 +46,8 @@ typedef enum {
|
|||||||
SHOOT_MODE_SAFE = 0, /* 安全模式 */
|
SHOOT_MODE_SAFE = 0, /* 安全模式 */
|
||||||
SHOOT_MODE_SINGLE, /* 单发模式 */
|
SHOOT_MODE_SINGLE, /* 单发模式 */
|
||||||
SHOOT_MODE_BURST, /* 多发模式 */
|
SHOOT_MODE_BURST, /* 多发模式 */
|
||||||
SHOOT_MODE_CONTINUE /* 连发模式 */
|
SHOOT_MODE_CONTINUE, /* 连发模式 */
|
||||||
|
SHOOT_MODE_NUM
|
||||||
}Shoot_Mode_t;
|
}Shoot_Mode_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
@ -52,7 +57,7 @@ typedef enum {
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
bool online; /* 遥控器在线 */
|
bool online; /* 遥控器在线 */
|
||||||
Shoot_Mode_t mode; /* 射击模式 */
|
Shoot_Mode_t mode; /* 射击模式 */
|
||||||
bool ready; /* 准备射击 */
|
bool ready; /* 准备射击 */
|
||||||
bool firecmd; /* 射击指令 */
|
bool firecmd; /* 射击指令 */
|
||||||
}Shoot_CMD_t;
|
}Shoot_CMD_t;
|
||||||
@ -63,15 +68,15 @@ typedef struct{
|
|||||||
}Shoot_MOTOR_RM_Param_t;
|
}Shoot_MOTOR_RM_Param_t;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
MOTOR_Feedback_t *fric; /* 摩擦轮电机反馈 */
|
MOTOR_Feedback_t fric[MAX_FRIC_NUM]; /* 摩擦轮电机反馈 */
|
||||||
MOTOR_RM_t trig; /* 拨弹电机反馈 */
|
MOTOR_RM_t trig; /* 拨弹电机反馈 */
|
||||||
|
|
||||||
float trig_agl; /*计算所有减速比后的拨弹盘的角度*/
|
float trig_agl; /*计算所有减速比后的拨弹盘的角度*/
|
||||||
|
|
||||||
float *fil_fric_rpm; /* 滤波后的摩擦轮转速 */
|
float fil_fric_rpm[MAX_FRIC_NUM]; /* 滤波后的摩擦轮转速 */
|
||||||
float fil_trig_rpm; /* 滤波后的拨弹电机转速*/
|
float fil_trig_rpm; /* 滤波后的拨弹电机转速*/
|
||||||
|
|
||||||
float *fric_rpm; /* 归一化摩擦轮转速 */
|
float fric_rpm[MAX_FRIC_NUM]; /* 归一化摩擦轮转速 */
|
||||||
float fric_avgrpm; /* 归一化摩擦轮平均转速*/
|
float fric_avgrpm; /* 归一化摩擦轮平均转速*/
|
||||||
float trig_rpm; /* 归一化拨弹电机转速*/
|
float trig_rpm; /* 归一化拨弹电机转速*/
|
||||||
|
|
||||||
@ -89,12 +94,11 @@ typedef struct {
|
|||||||
Shoot_JamDetectionFSM_State_t jamfsm_state; /* 卡弹检测状态 */
|
Shoot_JamDetectionFSM_State_t jamfsm_state; /* 卡弹检测状态 */
|
||||||
}Shoot_JamDetection_t;
|
}Shoot_JamDetection_t;
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float *out_follow;
|
float out_follow[MAX_FRIC_NUM];
|
||||||
float *out_err;
|
float out_err[MAX_FRIC_NUM];
|
||||||
float *out_fric;
|
float out_fric[MAX_FRIC_NUM];
|
||||||
float *lpfout_fric;
|
float lpfout_fric[MAX_FRIC_NUM];
|
||||||
|
|
||||||
|
|
||||||
float outagl_trig;
|
float outagl_trig;
|
||||||
float outomg_trig;
|
float outomg_trig;
|
||||||
float outlpf_trig;
|
float outlpf_trig;
|
||||||
@ -104,21 +108,21 @@ typedef struct {
|
|||||||
/* 底盘参数的结构体,包含所有初始化用的参数,通常是const,存好几组 */
|
/* 底盘参数的结构体,包含所有初始化用的参数,通常是const,存好几组 */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
Shoot_Projectile_t proj;
|
Shoot_Projectile_t proj;
|
||||||
size_t fric_num; /* 摩擦轮数量 */
|
|
||||||
|
|
||||||
|
size_t fric_num; /* 摩擦轮电机数量 */
|
||||||
float extra_deceleration_ratio; /*电机出轴到拨盘的额外减速比;没有写1*/
|
float extra_deceleration_ratio; /*电机出轴到拨盘的额外减速比;没有写1*/
|
||||||
size_t num_trig_tooth; /* 拨弹盘每圈弹丸数量 */
|
size_t num_trig_tooth; /* 拨弹盘每圈弹丸数量 */
|
||||||
float shot_freq; /* 射击频率,单位Hz */
|
float shot_freq; /* 射击频率,单位Hz */
|
||||||
size_t shot_burst_num; /* 多发模式一次射击的数量 */
|
size_t shot_burst_num; /* 多发模式一次射击的数量 */
|
||||||
|
|
||||||
size_t num_multilevel; /* 多级发射级数 (默认每级摩擦轮的数量相等)*/
|
size_t num_multilevel; /* 多级发射级数 */
|
||||||
float *ratio_multilevel; /* 多级发射各级速度比例 */
|
float ratio_multilevel[MAX_NUM_MULTILEVEL]; /* 多级发射各级速度比例 */
|
||||||
|
|
||||||
bool jam_enable; /* 是否启用卡弹检测 */ //还没加到逻辑里
|
bool jam_enable; /* 是否启用卡弹检测 */
|
||||||
float jam_threshold; /* 卡弹检测阈值,单位A (dji2006建议设置为120A,dji3508建议设置为235A,根据实际测试调整)*/
|
float jam_threshold; /* 卡弹检测阈值,单位A (dji2006建议设置为120A,dji3508建议设置为235A,根据实际测试调整)*/
|
||||||
float jam_suspected_time; /* 卡弹怀疑时间,单位秒 */
|
float jam_suspected_time; /* 卡弹怀疑时间,单位秒 */
|
||||||
|
|
||||||
Shoot_MOTOR_RM_Param_t *fric_motor_param;
|
Shoot_MOTOR_RM_Param_t fric_motor_param[MAX_FRIC_NUM];
|
||||||
MOTOR_RM_Param_t trig_motor_param;
|
MOTOR_RM_Param_t trig_motor_param;
|
||||||
|
|
||||||
|
|
||||||
@ -168,8 +172,8 @@ typedef struct {
|
|||||||
|
|
||||||
/* 反馈控制用的PID */
|
/* 反馈控制用的PID */
|
||||||
struct {
|
struct {
|
||||||
KPID_t *fric_follow; /* 摩擦轮PID主结构体 */
|
KPID_t fric_follow[MAX_FRIC_NUM]; /* 摩擦轮PID主结构体 */
|
||||||
KPID_t *fric_err; /* 摩擦轮PID主结构体 */
|
KPID_t fric_err[MAX_FRIC_NUM]; /* 摩擦轮PID主结构体 */
|
||||||
KPID_t trig; /* 拨弹PID主结构体 */
|
KPID_t trig; /* 拨弹PID主结构体 */
|
||||||
KPID_t trig_omg; /* 拨弹PID主结构体 */
|
KPID_t trig_omg; /* 拨弹PID主结构体 */
|
||||||
} pid;
|
} pid;
|
||||||
@ -177,8 +181,8 @@ typedef struct {
|
|||||||
/* 滤波器 */
|
/* 滤波器 */
|
||||||
struct {
|
struct {
|
||||||
struct{
|
struct{
|
||||||
LowPassFilter2p_t *in; /* 反馈值滤波器 */
|
LowPassFilter2p_t in[MAX_FRIC_NUM]; /* 反馈值滤波器 */
|
||||||
LowPassFilter2p_t *out; /* 输出值滤波器 */
|
LowPassFilter2p_t out[MAX_FRIC_NUM]; /* 输出值滤波器 */
|
||||||
}fric;
|
}fric;
|
||||||
struct{
|
struct{
|
||||||
LowPassFilter2p_t in; /* 反馈值滤波器 */
|
LowPassFilter2p_t in; /* 反馈值滤波器 */
|
||||||
@ -220,7 +224,7 @@ int8_t Shoot_SetMode(Shoot_t *s, Shoot_Mode_t mode);
|
|||||||
*
|
*
|
||||||
* \return 函数运行结果
|
* \return 函数运行结果
|
||||||
*/
|
*/
|
||||||
int8_t Chassis_UpdateFeedback(Shoot_t *s);
|
int8_t Shoot_UpdateFeedback(Shoot_t *s);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief 初始化发射
|
* \brief 初始化发射
|
||||||
@ -12,3 +12,10 @@
|
|||||||
function: Task_rc
|
function: Task_rc
|
||||||
name: rc
|
name: rc
|
||||||
stack: 256
|
stack: 256
|
||||||
|
- delay: 0
|
||||||
|
description: ''
|
||||||
|
freq_control: true
|
||||||
|
frequency: 500.0
|
||||||
|
function: Task_cmd
|
||||||
|
name: cmd
|
||||||
|
stack: 256
|
||||||
|
|||||||
@ -32,11 +32,12 @@ void Task_Init(void *argument) {
|
|||||||
/* 创建任务线程 */
|
/* 创建任务线程 */
|
||||||
task_runtime.thread.shoot_ctrl = osThreadNew(Task_shoot_ctrl, NULL, &attr_shoot_ctrl);
|
task_runtime.thread.shoot_ctrl = osThreadNew(Task_shoot_ctrl, NULL, &attr_shoot_ctrl);
|
||||||
task_runtime.thread.rc = osThreadNew(Task_rc, NULL, &attr_rc);
|
task_runtime.thread.rc = osThreadNew(Task_rc, NULL, &attr_rc);
|
||||||
|
task_runtime.thread.cmd = osThreadNew(Task_cmd, NULL, &attr_cmd);
|
||||||
|
|
||||||
// 创建消息队列
|
// 创建消息队列
|
||||||
/* USER MESSAGE BEGIN */
|
/* USER MESSAGE BEGIN */
|
||||||
task_runtime.msgq.user_msg= osMessageQueueNew(2u, 10, NULL);
|
task_runtime.msgq.user_msg= osMessageQueueNew(2u, 10, NULL);
|
||||||
task_runtime.msgq.shoot.rc_cmd= osMessageQueueNew(3u, sizeof(COMP_AT9S_CMD_t), NULL);
|
task_runtime.msgq.shoot.cmd= osMessageQueueNew(3u, sizeof(COMP_AT9S_CMD_t), NULL);
|
||||||
/* USER MESSAGE END */
|
/* USER MESSAGE END */
|
||||||
|
|
||||||
osKernelUnlock(); // 解锁内核
|
osKernelUnlock(); // 解锁内核
|
||||||
|
|||||||
@ -5,19 +5,21 @@
|
|||||||
|
|
||||||
/* Includes ----------------------------------------------------------------- */
|
/* Includes ----------------------------------------------------------------- */
|
||||||
#include "task/user_task.h"
|
#include "task/user_task.h"
|
||||||
|
/* USER INCLUDE BEGIN */
|
||||||
#include "device/at9s_pro.h"
|
#include "device/at9s_pro.h"
|
||||||
#include "component/at9s_pro_cmd.h"
|
#include "component/at9s_pro_cmd.h"
|
||||||
/* USER INCLUDE BEGIN */
|
|
||||||
|
|
||||||
/* USER INCLUDE END */
|
/* USER INCLUDE END */
|
||||||
|
|
||||||
/* Private typedef ---------------------------------------------------------- */
|
/* Private typedef ---------------------------------------------------------- */
|
||||||
/* Private define ----------------------------------------------------------- */
|
/* Private define ----------------------------------------------------------- */
|
||||||
/* Private macro ------------------------------------------------------------ */
|
/* Private macro ------------------------------------------------------------ */
|
||||||
/* Private variables -------------------------------------------------------- */
|
/* Private variables -------------------------------------------------------- */
|
||||||
|
/* USER STRUCT BEGIN */
|
||||||
uint8_t cmd_buffer[DEVICE_AT9S_FRAME_LEN];
|
uint8_t cmd_buffer[DEVICE_AT9S_FRAME_LEN];
|
||||||
DEVICE_AT9S_t at9s;
|
DEVICE_AT9S_t at9s;
|
||||||
COMP_AT9S_CMD_t rc_cmd;
|
COMP_AT9S_CMD_t rc_cmd;
|
||||||
|
/* USER STRUCT END */
|
||||||
|
|
||||||
/* Private function --------------------------------------------------------- */
|
/* Private function --------------------------------------------------------- */
|
||||||
/* Exported functions ------------------------------------------------------- */
|
/* Exported functions ------------------------------------------------------- */
|
||||||
void Task_rc(void *argument) {
|
void Task_rc(void *argument) {
|
||||||
@ -36,7 +38,7 @@ void Task_rc(void *argument) {
|
|||||||
/* USER CODE INIT END */
|
/* USER CODE INIT END */
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
tick += delay_tick; /* 计算下一个唤 醒时刻 */
|
tick += delay_tick; /* 计算下一个唤醒时刻 */
|
||||||
/* USER CODE BEGIN */
|
/* USER CODE BEGIN */
|
||||||
if (DEVICE_AT9S_WaitDmaCplt(10)) {
|
if (DEVICE_AT9S_WaitDmaCplt(10)) {
|
||||||
DEVICE_AT9S_ParseRaw(cmd_buffer, &at9s);
|
DEVICE_AT9S_ParseRaw(cmd_buffer, &at9s);
|
||||||
@ -44,8 +46,7 @@ void Task_rc(void *argument) {
|
|||||||
DEVICE_AT9S_StartDmaRecv(cmd_buffer);
|
DEVICE_AT9S_StartDmaRecv(cmd_buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
osMessageQueuePut(task_runtime.msgq.shoot.rc_cmd, &rc_cmd, 0, 0);
|
osMessageQueuePut(task_runtime.msgq.cmd.rc, &at9s, 0, 0);
|
||||||
|
|
||||||
/* USER CODE END */
|
/* USER CODE END */
|
||||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
#include "task/user_task.h"
|
#include "task/user_task.h"
|
||||||
/* USER INCLUDE BEGIN */
|
/* USER INCLUDE BEGIN */
|
||||||
#include "component/at9s_pro_cmd.h"
|
#include "component/at9s_pro_cmd.h"
|
||||||
#include "module/shoot_control.h"
|
#include "module/shoot.h"
|
||||||
#include "module/config.h"
|
#include "module/config.h"
|
||||||
/* USER INCLUDE END */
|
/* USER INCLUDE END */
|
||||||
|
|
||||||
@ -15,10 +15,9 @@
|
|||||||
/* Private define ----------------------------------------------------------- */
|
/* Private define ----------------------------------------------------------- */
|
||||||
/* Private macro ------------------------------------------------------------ */
|
/* Private macro ------------------------------------------------------------ */
|
||||||
/* Private variables -------------------------------------------------------- */
|
/* Private variables -------------------------------------------------------- */
|
||||||
COMP_AT9S_CMD_t shoot_ctrl_cmd_rc;
|
/* USER STRUCT BEGIN */
|
||||||
Shoot_t shoot;
|
Shoot_t shoot;
|
||||||
Shoot_CMD_t shoot_cmd;
|
Shoot_CMD_t shoot_cmd;
|
||||||
/* USER STRUCT BEGIN */
|
|
||||||
/* USER STRUCT END */
|
/* USER STRUCT END */
|
||||||
|
|
||||||
/* Private function --------------------------------------------------------- */
|
/* Private function --------------------------------------------------------- */
|
||||||
@ -34,7 +33,6 @@ void Task_shoot_ctrl(void *argument) {
|
|||||||
|
|
||||||
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
uint32_t tick = osKernelGetTickCount(); /* 控制任务运行频率的计时 */
|
||||||
/* USER CODE INIT BEGIN */
|
/* USER CODE INIT BEGIN */
|
||||||
Config_ShootInit();
|
|
||||||
Shoot_Init(&shoot,&Config_GetRobotParam()->shoot_param,SHOOT_CTRL_FREQ);
|
Shoot_Init(&shoot,&Config_GetRobotParam()->shoot_param,SHOOT_CTRL_FREQ);
|
||||||
Shoot_SetMode(&shoot,SHOOT_MODE_BURST);
|
Shoot_SetMode(&shoot,SHOOT_MODE_BURST);
|
||||||
/* USER CODE INIT END */
|
/* USER CODE INIT END */
|
||||||
@ -42,14 +40,10 @@ void Task_shoot_ctrl(void *argument) {
|
|||||||
while (1) {
|
while (1) {
|
||||||
tick += delay_tick; /* 计算下一个唤醒时刻 */
|
tick += delay_tick; /* 计算下一个唤醒时刻 */
|
||||||
/* USER CODE BEGIN */
|
/* USER CODE BEGIN */
|
||||||
osMessageQueueGet(task_runtime.msgq.shoot.rc_cmd, &shoot_ctrl_cmd_rc, NULL, 0);
|
osMessageQueueGet(task_runtime.msgq.shoot.cmd, &shoot_cmd, NULL, 0);
|
||||||
shoot_cmd.ready=shoot_ctrl_cmd_rc.shoot.ready;
|
Shoot_UpdateFeedback(&shoot);
|
||||||
shoot_cmd.firecmd=shoot_ctrl_cmd_rc.shoot.firecmd;
|
|
||||||
shoot_cmd.online=shoot_ctrl_cmd_rc.online;
|
|
||||||
shoot.target_variable.target_rpm=4000;
|
|
||||||
shoot.mode=shoot_ctrl_cmd_rc.mode;
|
|
||||||
Chassis_UpdateFeedback(&shoot);
|
|
||||||
Shoot_Control(&shoot,&shoot_cmd);
|
Shoot_Control(&shoot,&shoot_cmd);
|
||||||
|
|
||||||
/* USER CODE END */
|
/* USER CODE END */
|
||||||
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
osDelayUntil(tick); /* 运行结束,等待下一次唤醒 */
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,10 +12,15 @@ const osThreadAttr_t attr_init = {
|
|||||||
const osThreadAttr_t attr_shoot_ctrl = {
|
const osThreadAttr_t attr_shoot_ctrl = {
|
||||||
.name = "shoot_ctrl",
|
.name = "shoot_ctrl",
|
||||||
.priority = osPriorityNormal,
|
.priority = osPriorityNormal,
|
||||||
.stack_size = 512 * 4,
|
.stack_size = 256 * 4,
|
||||||
};
|
};
|
||||||
const osThreadAttr_t attr_rc = {
|
const osThreadAttr_t attr_rc = {
|
||||||
.name = "rc",
|
.name = "rc",
|
||||||
.priority = osPriorityNormal,
|
.priority = osPriorityNormal,
|
||||||
.stack_size = 256 * 4,
|
.stack_size = 256 * 4,
|
||||||
|
};
|
||||||
|
const osThreadAttr_t attr_cmd = {
|
||||||
|
.name = "cmd",
|
||||||
|
.priority = osPriorityNormal,
|
||||||
|
.stack_size = 256 * 4,
|
||||||
};
|
};
|
||||||
@ -15,11 +15,13 @@ extern "C" {
|
|||||||
/* 任务运行频率 */
|
/* 任务运行频率 */
|
||||||
#define SHOOT_CTRL_FREQ (500.0)
|
#define SHOOT_CTRL_FREQ (500.0)
|
||||||
#define RC_FREQ (500.0)
|
#define RC_FREQ (500.0)
|
||||||
|
#define CMD_FREQ (500.0)
|
||||||
|
|
||||||
/* 任务初始化延时ms */
|
/* 任务初始化延时ms */
|
||||||
#define TASK_INIT_DELAY (100u)
|
#define TASK_INIT_DELAY (100u)
|
||||||
#define SHOOT_CTRL_INIT_DELAY (0)
|
#define SHOOT_CTRL_INIT_DELAY (0)
|
||||||
#define RC_INIT_DELAY (0)
|
#define RC_INIT_DELAY (0)
|
||||||
|
#define CMD_INIT_DELAY (0)
|
||||||
|
|
||||||
/* Exported defines --------------------------------------------------------- */
|
/* Exported defines --------------------------------------------------------- */
|
||||||
/* Exported macro ----------------------------------------------------------- */
|
/* Exported macro ----------------------------------------------------------- */
|
||||||
@ -31,6 +33,7 @@ typedef struct {
|
|||||||
struct {
|
struct {
|
||||||
osThreadId_t shoot_ctrl;
|
osThreadId_t shoot_ctrl;
|
||||||
osThreadId_t rc;
|
osThreadId_t rc;
|
||||||
|
osThreadId_t cmd;
|
||||||
} thread;
|
} thread;
|
||||||
|
|
||||||
/* USER MESSAGE BEGIN */
|
/* USER MESSAGE BEGIN */
|
||||||
@ -38,7 +41,10 @@ typedef struct {
|
|||||||
osMessageQueueId_t user_msg; /* 用户自定义任务消息队列 */
|
osMessageQueueId_t user_msg; /* 用户自定义任务消息队列 */
|
||||||
|
|
||||||
struct{
|
struct{
|
||||||
osMessageQueueId_t rc_cmd; /* 来自遥控器的命令 */
|
osMessageQueueId_t rc; /* 来自遥控器的数据 */
|
||||||
|
}cmd;
|
||||||
|
struct{
|
||||||
|
osMessageQueueId_t cmd; /* 来自遥控器的命令 */
|
||||||
}shoot;
|
}shoot;
|
||||||
|
|
||||||
|
|
||||||
@ -61,18 +67,21 @@ typedef struct {
|
|||||||
struct {
|
struct {
|
||||||
UBaseType_t shoot_ctrl;
|
UBaseType_t shoot_ctrl;
|
||||||
UBaseType_t rc;
|
UBaseType_t rc;
|
||||||
|
UBaseType_t cmd;
|
||||||
} stack_water_mark;
|
} stack_water_mark;
|
||||||
|
|
||||||
/* 各任务运行频率 */
|
/* 各任务运行频率 */
|
||||||
struct {
|
struct {
|
||||||
float shoot_ctrl;
|
float shoot_ctrl;
|
||||||
float rc;
|
float rc;
|
||||||
|
float cmd;
|
||||||
} freq;
|
} freq;
|
||||||
|
|
||||||
/* 任务最近运行时间 */
|
/* 任务最近运行时间 */
|
||||||
struct {
|
struct {
|
||||||
float shoot_ctrl;
|
float shoot_ctrl;
|
||||||
float rc;
|
float rc;
|
||||||
|
float cmd;
|
||||||
} last_up_time;
|
} last_up_time;
|
||||||
|
|
||||||
} Task_Runtime_t;
|
} Task_Runtime_t;
|
||||||
@ -84,11 +93,13 @@ extern Task_Runtime_t task_runtime;
|
|||||||
extern const osThreadAttr_t attr_init;
|
extern const osThreadAttr_t attr_init;
|
||||||
extern const osThreadAttr_t attr_shoot_ctrl;
|
extern const osThreadAttr_t attr_shoot_ctrl;
|
||||||
extern const osThreadAttr_t attr_rc;
|
extern const osThreadAttr_t attr_rc;
|
||||||
|
extern const osThreadAttr_t attr_cmd;
|
||||||
|
|
||||||
/* 任务函数声明 */
|
/* 任务函数声明 */
|
||||||
void Task_Init(void *argument);
|
void Task_Init(void *argument);
|
||||||
void Task_shoot_ctrl(void *argument);
|
void Task_shoot_ctrl(void *argument);
|
||||||
void Task_rc(void *argument);
|
void Task_rc(void *argument);
|
||||||
|
void Task_cmd(void *argument);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
43
cmake/gcc-arm-none-eabi.cmake
Normal file
43
cmake/gcc-arm-none-eabi.cmake
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_ID GNU)
|
||||||
|
set(CMAKE_CXX_COMPILER_ID GNU)
|
||||||
|
|
||||||
|
# Some default GCC settings
|
||||||
|
# arm-none-eabi- must be part of path environment
|
||||||
|
set(TOOLCHAIN_PREFIX arm-none-eabi-)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
|
||||||
|
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||||
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
|
||||||
|
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}g++)
|
||||||
|
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
|
||||||
|
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size)
|
||||||
|
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
||||||
|
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# MCU specific flags
|
||||||
|
set(TARGET_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard ")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -MMD -MP")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fdata-sections -ffunction-sections")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "-Os -g0")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-Os -g0")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics")
|
||||||
|
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T \"${CMAKE_SOURCE_DIR}/STM32F407XX_FLASH.ld\"")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --specs=nano.specs")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Map=${CMAKE_PROJECT_NAME}.map -Wl,--gc-sections")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--print-memory-usage")
|
||||||
|
set(TOOLCHAIN_LINK_LIBRARIES "m")
|
||||||
65
cmake/starm-clang.cmake
Normal file
65
cmake/starm-clang.cmake
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
set(CMAKE_SYSTEM_NAME Generic)
|
||||||
|
set(CMAKE_SYSTEM_PROCESSOR arm)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER_ID Clang)
|
||||||
|
set(CMAKE_CXX_COMPILER_ID Clang)
|
||||||
|
|
||||||
|
# Some default llvm settings
|
||||||
|
set(TOOLCHAIN_PREFIX starm-)
|
||||||
|
|
||||||
|
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}clang)
|
||||||
|
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER})
|
||||||
|
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}clang++)
|
||||||
|
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}clang)
|
||||||
|
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy)
|
||||||
|
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size)
|
||||||
|
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_ASM ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_C ".elf")
|
||||||
|
set(CMAKE_EXECUTABLE_SUFFIX_CXX ".elf")
|
||||||
|
|
||||||
|
set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
|
||||||
|
|
||||||
|
# STARM_TOOLCHAIN_CONFIG allows you to choose the toolchain configuration.
|
||||||
|
# Possible values are:
|
||||||
|
# "STARM_HYBRID" : Hybrid configuration using starm-clang Assemler and Compiler and GNU Linker
|
||||||
|
# "STARM_NEWLIB" : starm-clang toolchain with NEWLIB C library
|
||||||
|
# "STARM_PICOLIBC" : starm-clang toolchain with PICOLIBC C library
|
||||||
|
set(STARM_TOOLCHAIN_CONFIG "STARM_HYBRID")
|
||||||
|
|
||||||
|
if(STARM_TOOLCHAIN_CONFIG STREQUAL "STARM_HYBRID")
|
||||||
|
set(TOOLCHAIN_MULTILIBS "--multi-lib-config=\"$ENV{CLANG_GCC_CMSIS_COMPILER}/multilib.gnu_tools_for_stm32.yaml\" --gcc-toolchain=\"$ENV{GCC_TOOLCHAIN_ROOT}/..\"")
|
||||||
|
elseif (STARM_TOOLCHAIN_CONFIG STREQUAL "STARM_NEWLIB")
|
||||||
|
set(TOOLCHAIN_MULTILIBS "--config=newlib.cfg")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# MCU specific flags
|
||||||
|
set(TARGET_FLAGS "-mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard ${TOOLCHAIN_MULTILIBS}")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS} -x assembler-with-cpp -MP")
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fdata-sections -ffunction-sections")
|
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS_DEBUG "-O0 -g3")
|
||||||
|
set(CMAKE_C_FLAGS_RELEASE "-Os -g0")
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
|
||||||
|
set(CMAKE_CXX_FLAGS_RELEASE "-Os -g0")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -fno-rtti -fno-exceptions -fno-threadsafe-statics")
|
||||||
|
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${TARGET_FLAGS}")
|
||||||
|
|
||||||
|
if (STARM_TOOLCHAIN_CONFIG STREQUAL "STARM_HYBRID")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --gcc-specs=nano.specs")
|
||||||
|
set(TOOLCHAIN_LINK_LIBRARIES "m")
|
||||||
|
elseif(STARM_TOOLCHAIN_CONFIG STREQUAL "STARM_NEWLIB")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lcrt0-nosys")
|
||||||
|
elseif(STARM_TOOLCHAIN_CONFIG STREQUAL "STARM_PICOLIBC")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lcrt0-hosted")
|
||||||
|
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -T \"${CMAKE_SOURCE_DIR}/STM32F407XX_FLASH.ld\"")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-Map=${CMAKE_PROJECT_NAME}.map -Wl,--gc-sections")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack")
|
||||||
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--print-memory-usage ")
|
||||||
115
cmake/stm32cubemx/CMakeLists.txt
Normal file
115
cmake/stm32cubemx/CMakeLists.txt
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.22)
|
||||||
|
# Enable CMake support for ASM and C languages
|
||||||
|
enable_language(C ASM)
|
||||||
|
# STM32CubeMX generated symbols (macros)
|
||||||
|
set(MX_Defines_Syms
|
||||||
|
USE_HAL_DRIVER
|
||||||
|
STM32F407xx
|
||||||
|
$<$<CONFIG:Debug>:DEBUG>
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32CubeMX generated include paths
|
||||||
|
set(MX_Include_Dirs
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Inc
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Inc
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Inc/Legacy
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/CMSIS/Device/ST/STM32F4xx/Include
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/CMSIS/Include
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32CubeMX generated application sources
|
||||||
|
set(MX_Application_Src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/main.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/gpio.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/freertos.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/can.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/dma.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/usart.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/stm32f4xx_it.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/stm32f4xx_hal_msp.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/sysmem.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/syscalls.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../startup_stm32f407xx.s
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32 HAL/LL Drivers
|
||||||
|
set(STM32_Drivers_Src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Core/Src/system_stm32f4xx.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_can.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_rcc_ex.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ex.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_gpio.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_pwr_ex.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_cortex.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_exti.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_uart.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Drivers Midllewares
|
||||||
|
|
||||||
|
|
||||||
|
set(FreeRTOS_Src
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/croutine.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/list.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/queue.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/tasks.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/timers.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS_V2/cmsis_os2.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Link directories setup
|
||||||
|
set(MX_LINK_DIRS
|
||||||
|
|
||||||
|
)
|
||||||
|
# Project static libraries
|
||||||
|
set(MX_LINK_LIBS
|
||||||
|
STM32_Drivers
|
||||||
|
${TOOLCHAIN_LINK_LIBRARIES}
|
||||||
|
FreeRTOS
|
||||||
|
)
|
||||||
|
# Interface library for includes and symbols
|
||||||
|
add_library(stm32cubemx INTERFACE)
|
||||||
|
target_include_directories(stm32cubemx INTERFACE ${MX_Include_Dirs})
|
||||||
|
target_compile_definitions(stm32cubemx INTERFACE ${MX_Defines_Syms})
|
||||||
|
|
||||||
|
# Create STM32_Drivers static library
|
||||||
|
add_library(STM32_Drivers OBJECT)
|
||||||
|
target_sources(STM32_Drivers PRIVATE ${STM32_Drivers_Src})
|
||||||
|
target_link_libraries(STM32_Drivers PUBLIC stm32cubemx)
|
||||||
|
|
||||||
|
|
||||||
|
# Create FreeRTOS static library
|
||||||
|
add_library(FreeRTOS OBJECT)
|
||||||
|
target_sources(FreeRTOS PRIVATE ${FreeRTOS_Src})
|
||||||
|
target_link_libraries(FreeRTOS PUBLIC stm32cubemx)
|
||||||
|
|
||||||
|
# Add STM32CubeMX generated application sources to the project
|
||||||
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE ${MX_Application_Src})
|
||||||
|
|
||||||
|
# Link directories setup
|
||||||
|
target_link_directories(${CMAKE_PROJECT_NAME} PRIVATE ${MX_LINK_DIRS})
|
||||||
|
|
||||||
|
# Add libraries to the project
|
||||||
|
target_link_libraries(${CMAKE_PROJECT_NAME} ${MX_LINK_LIBS})
|
||||||
|
|
||||||
|
# Add the map file to the list of files to be removed with 'clean' target
|
||||||
|
set_target_properties(${CMAKE_PROJECT_NAME} PROPERTIES ADDITIONAL_CLEAN_FILES ${CMAKE_PROJECT_NAME}.map)
|
||||||
|
|
||||||
|
# Validate that STM32CubeMX code is compatible with C standard
|
||||||
|
if((CMAKE_C_STANDARD EQUAL 90) OR (CMAKE_C_STANDARD EQUAL 99))
|
||||||
|
message(ERROR "Generated code requires C11 or higher")
|
||||||
|
endif()
|
||||||
@ -152,7 +152,7 @@ ProjectManager.ProjectName=shoot
|
|||||||
ProjectManager.ProjectStructure=
|
ProjectManager.ProjectStructure=
|
||||||
ProjectManager.RegisterCallBack=
|
ProjectManager.RegisterCallBack=
|
||||||
ProjectManager.StackSize=0x400
|
ProjectManager.StackSize=0x400
|
||||||
ProjectManager.TargetToolchain=MDK-ARM V5.32
|
ProjectManager.TargetToolchain=CMake
|
||||||
ProjectManager.ToolChainLocation=
|
ProjectManager.ToolChainLocation=
|
||||||
ProjectManager.UAScriptAfterPath=
|
ProjectManager.UAScriptAfterPath=
|
||||||
ProjectManager.UAScriptBeforePath=
|
ProjectManager.UAScriptBeforePath=
|
||||||
|
|||||||
508
startup_stm32f407xx.s
Normal file
508
startup_stm32f407xx.s
Normal file
@ -0,0 +1,508 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file startup_stm32f407xx.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32F407xx Devices vector table for GCC based toolchains.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address
|
||||||
|
* - Branches to main in the C library (which eventually
|
||||||
|
* calls main()).
|
||||||
|
* After Reset the Cortex-M4 processor is in Thread mode,
|
||||||
|
* priority is Privileged, and the Stack is set to Main.
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2017 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.
|
||||||
|
*
|
||||||
|
******************************************************************************
|
||||||
|
*/
|
||||||
|
|
||||||
|
.syntax unified
|
||||||
|
.cpu cortex-m4
|
||||||
|
.fpu softvfp
|
||||||
|
.thumb
|
||||||
|
|
||||||
|
.global g_pfnVectors
|
||||||
|
.global Default_Handler
|
||||||
|
|
||||||
|
/* start address for the initialization values of the .data section.
|
||||||
|
defined in linker script */
|
||||||
|
.word _sidata
|
||||||
|
/* start address for the .data section. defined in linker script */
|
||||||
|
.word _sdata
|
||||||
|
/* end address for the .data section. defined in linker script */
|
||||||
|
.word _edata
|
||||||
|
/* start address for the .bss section. defined in linker script */
|
||||||
|
.word _sbss
|
||||||
|
/* end address for the .bss section. defined in linker script */
|
||||||
|
.word _ebss
|
||||||
|
/* stack used for SystemInit_ExtMemCtl; always internal RAM used */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor first
|
||||||
|
* starts execution following a reset event. Only the absolutely
|
||||||
|
* necessary set is performed, after which the application
|
||||||
|
* supplied main() routine is called.
|
||||||
|
* @param None
|
||||||
|
* @retval : None
|
||||||
|
*/
|
||||||
|
|
||||||
|
.section .text.Reset_Handler
|
||||||
|
.weak Reset_Handler
|
||||||
|
.type Reset_Handler, %function
|
||||||
|
Reset_Handler:
|
||||||
|
ldr sp, =_estack /* set stack pointer */
|
||||||
|
|
||||||
|
/* Call the clock system initialization function.*/
|
||||||
|
bl SystemInit
|
||||||
|
|
||||||
|
/* Copy the data segment initializers from flash to SRAM */
|
||||||
|
ldr r0, =_sdata
|
||||||
|
ldr r1, =_edata
|
||||||
|
ldr r2, =_sidata
|
||||||
|
movs r3, #0
|
||||||
|
b LoopCopyDataInit
|
||||||
|
|
||||||
|
CopyDataInit:
|
||||||
|
ldr r4, [r2, r3]
|
||||||
|
str r4, [r0, r3]
|
||||||
|
adds r3, r3, #4
|
||||||
|
|
||||||
|
LoopCopyDataInit:
|
||||||
|
adds r4, r0, r3
|
||||||
|
cmp r4, r1
|
||||||
|
bcc CopyDataInit
|
||||||
|
|
||||||
|
/* Zero fill the bss segment. */
|
||||||
|
ldr r2, =_sbss
|
||||||
|
ldr r4, =_ebss
|
||||||
|
movs r3, #0
|
||||||
|
b LoopFillZerobss
|
||||||
|
|
||||||
|
FillZerobss:
|
||||||
|
str r3, [r2]
|
||||||
|
adds r2, r2, #4
|
||||||
|
|
||||||
|
LoopFillZerobss:
|
||||||
|
cmp r2, r4
|
||||||
|
bcc FillZerobss
|
||||||
|
|
||||||
|
/* Call static constructors */
|
||||||
|
bl __libc_init_array
|
||||||
|
/* Call the application's entry point.*/
|
||||||
|
bl main
|
||||||
|
bx lr
|
||||||
|
.size Reset_Handler, .-Reset_Handler
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief This is the code that gets called when the processor receives an
|
||||||
|
* unexpected interrupt. This simply enters an infinite loop, preserving
|
||||||
|
* the system state for examination by a debugger.
|
||||||
|
* @param None
|
||||||
|
* @retval None
|
||||||
|
*/
|
||||||
|
.section .text.Default_Handler,"ax",%progbits
|
||||||
|
Default_Handler:
|
||||||
|
Infinite_Loop:
|
||||||
|
b Infinite_Loop
|
||||||
|
.size Default_Handler, .-Default_Handler
|
||||||
|
/******************************************************************************
|
||||||
|
*
|
||||||
|
* The minimal vector table for a Cortex M3. Note that the proper constructs
|
||||||
|
* must be placed on this to ensure that it ends up at physical address
|
||||||
|
* 0x0000.0000.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
.section .isr_vector,"a",%progbits
|
||||||
|
.type g_pfnVectors, %object
|
||||||
|
|
||||||
|
|
||||||
|
g_pfnVectors:
|
||||||
|
.word _estack
|
||||||
|
.word Reset_Handler
|
||||||
|
.word NMI_Handler
|
||||||
|
.word HardFault_Handler
|
||||||
|
.word MemManage_Handler
|
||||||
|
.word BusFault_Handler
|
||||||
|
.word UsageFault_Handler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SVC_Handler
|
||||||
|
.word DebugMon_Handler
|
||||||
|
.word 0
|
||||||
|
.word PendSV_Handler
|
||||||
|
.word SysTick_Handler
|
||||||
|
|
||||||
|
/* External Interrupts */
|
||||||
|
.word WWDG_IRQHandler /* Window WatchDog */
|
||||||
|
.word PVD_IRQHandler /* PVD through EXTI Line detection */
|
||||||
|
.word TAMP_STAMP_IRQHandler /* Tamper and TimeStamps through the EXTI line */
|
||||||
|
.word RTC_WKUP_IRQHandler /* RTC Wakeup through the EXTI line */
|
||||||
|
.word FLASH_IRQHandler /* FLASH */
|
||||||
|
.word RCC_IRQHandler /* RCC */
|
||||||
|
.word EXTI0_IRQHandler /* EXTI Line0 */
|
||||||
|
.word EXTI1_IRQHandler /* EXTI Line1 */
|
||||||
|
.word EXTI2_IRQHandler /* EXTI Line2 */
|
||||||
|
.word EXTI3_IRQHandler /* EXTI Line3 */
|
||||||
|
.word EXTI4_IRQHandler /* EXTI Line4 */
|
||||||
|
.word DMA1_Stream0_IRQHandler /* DMA1 Stream 0 */
|
||||||
|
.word DMA1_Stream1_IRQHandler /* DMA1 Stream 1 */
|
||||||
|
.word DMA1_Stream2_IRQHandler /* DMA1 Stream 2 */
|
||||||
|
.word DMA1_Stream3_IRQHandler /* DMA1 Stream 3 */
|
||||||
|
.word DMA1_Stream4_IRQHandler /* DMA1 Stream 4 */
|
||||||
|
.word DMA1_Stream5_IRQHandler /* DMA1 Stream 5 */
|
||||||
|
.word DMA1_Stream6_IRQHandler /* DMA1 Stream 6 */
|
||||||
|
.word ADC_IRQHandler /* ADC1, ADC2 and ADC3s */
|
||||||
|
.word CAN1_TX_IRQHandler /* CAN1 TX */
|
||||||
|
.word CAN1_RX0_IRQHandler /* CAN1 RX0 */
|
||||||
|
.word CAN1_RX1_IRQHandler /* CAN1 RX1 */
|
||||||
|
.word CAN1_SCE_IRQHandler /* CAN1 SCE */
|
||||||
|
.word EXTI9_5_IRQHandler /* External Line[9:5]s */
|
||||||
|
.word TIM1_BRK_TIM9_IRQHandler /* TIM1 Break and TIM9 */
|
||||||
|
.word TIM1_UP_TIM10_IRQHandler /* TIM1 Update and TIM10 */
|
||||||
|
.word TIM1_TRG_COM_TIM11_IRQHandler /* TIM1 Trigger and Commutation and TIM11 */
|
||||||
|
.word TIM1_CC_IRQHandler /* TIM1 Capture Compare */
|
||||||
|
.word TIM2_IRQHandler /* TIM2 */
|
||||||
|
.word TIM3_IRQHandler /* TIM3 */
|
||||||
|
.word TIM4_IRQHandler /* TIM4 */
|
||||||
|
.word I2C1_EV_IRQHandler /* I2C1 Event */
|
||||||
|
.word I2C1_ER_IRQHandler /* I2C1 Error */
|
||||||
|
.word I2C2_EV_IRQHandler /* I2C2 Event */
|
||||||
|
.word I2C2_ER_IRQHandler /* I2C2 Error */
|
||||||
|
.word SPI1_IRQHandler /* SPI1 */
|
||||||
|
.word SPI2_IRQHandler /* SPI2 */
|
||||||
|
.word USART1_IRQHandler /* USART1 */
|
||||||
|
.word USART2_IRQHandler /* USART2 */
|
||||||
|
.word USART3_IRQHandler /* USART3 */
|
||||||
|
.word EXTI15_10_IRQHandler /* External Line[15:10]s */
|
||||||
|
.word RTC_Alarm_IRQHandler /* RTC Alarm (A and B) through EXTI Line */
|
||||||
|
.word OTG_FS_WKUP_IRQHandler /* USB OTG FS Wakeup through EXTI line */
|
||||||
|
.word TIM8_BRK_TIM12_IRQHandler /* TIM8 Break and TIM12 */
|
||||||
|
.word TIM8_UP_TIM13_IRQHandler /* TIM8 Update and TIM13 */
|
||||||
|
.word TIM8_TRG_COM_TIM14_IRQHandler /* TIM8 Trigger and Commutation and TIM14 */
|
||||||
|
.word TIM8_CC_IRQHandler /* TIM8 Capture Compare */
|
||||||
|
.word DMA1_Stream7_IRQHandler /* DMA1 Stream7 */
|
||||||
|
.word FSMC_IRQHandler /* FSMC */
|
||||||
|
.word SDIO_IRQHandler /* SDIO */
|
||||||
|
.word TIM5_IRQHandler /* TIM5 */
|
||||||
|
.word SPI3_IRQHandler /* SPI3 */
|
||||||
|
.word UART4_IRQHandler /* UART4 */
|
||||||
|
.word UART5_IRQHandler /* UART5 */
|
||||||
|
.word TIM6_DAC_IRQHandler /* TIM6 and DAC1&2 underrun errors */
|
||||||
|
.word TIM7_IRQHandler /* TIM7 */
|
||||||
|
.word DMA2_Stream0_IRQHandler /* DMA2 Stream 0 */
|
||||||
|
.word DMA2_Stream1_IRQHandler /* DMA2 Stream 1 */
|
||||||
|
.word DMA2_Stream2_IRQHandler /* DMA2 Stream 2 */
|
||||||
|
.word DMA2_Stream3_IRQHandler /* DMA2 Stream 3 */
|
||||||
|
.word DMA2_Stream4_IRQHandler /* DMA2 Stream 4 */
|
||||||
|
.word ETH_IRQHandler /* Ethernet */
|
||||||
|
.word ETH_WKUP_IRQHandler /* Ethernet Wakeup through EXTI line */
|
||||||
|
.word CAN2_TX_IRQHandler /* CAN2 TX */
|
||||||
|
.word CAN2_RX0_IRQHandler /* CAN2 RX0 */
|
||||||
|
.word CAN2_RX1_IRQHandler /* CAN2 RX1 */
|
||||||
|
.word CAN2_SCE_IRQHandler /* CAN2 SCE */
|
||||||
|
.word OTG_FS_IRQHandler /* USB OTG FS */
|
||||||
|
.word DMA2_Stream5_IRQHandler /* DMA2 Stream 5 */
|
||||||
|
.word DMA2_Stream6_IRQHandler /* DMA2 Stream 6 */
|
||||||
|
.word DMA2_Stream7_IRQHandler /* DMA2 Stream 7 */
|
||||||
|
.word USART6_IRQHandler /* USART6 */
|
||||||
|
.word I2C3_EV_IRQHandler /* I2C3 event */
|
||||||
|
.word I2C3_ER_IRQHandler /* I2C3 error */
|
||||||
|
.word OTG_HS_EP1_OUT_IRQHandler /* USB OTG HS End Point 1 Out */
|
||||||
|
.word OTG_HS_EP1_IN_IRQHandler /* USB OTG HS End Point 1 In */
|
||||||
|
.word OTG_HS_WKUP_IRQHandler /* USB OTG HS Wakeup through EXTI */
|
||||||
|
.word OTG_HS_IRQHandler /* USB OTG HS */
|
||||||
|
.word DCMI_IRQHandler /* DCMI */
|
||||||
|
.word 0 /* CRYP crypto */
|
||||||
|
.word HASH_RNG_IRQHandler /* Hash and Rng */
|
||||||
|
.word FPU_IRQHandler /* FPU */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* Provide weak aliases for each Exception handler to the Default_Handler.
|
||||||
|
* As they are weak aliases, any function with the same name will override
|
||||||
|
* this definition.
|
||||||
|
*
|
||||||
|
*******************************************************************************/
|
||||||
|
.weak NMI_Handler
|
||||||
|
.thumb_set NMI_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak HardFault_Handler
|
||||||
|
.thumb_set HardFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak MemManage_Handler
|
||||||
|
.thumb_set MemManage_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak BusFault_Handler
|
||||||
|
.thumb_set BusFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak UsageFault_Handler
|
||||||
|
.thumb_set UsageFault_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SVC_Handler
|
||||||
|
.thumb_set SVC_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak DebugMon_Handler
|
||||||
|
.thumb_set DebugMon_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak PendSV_Handler
|
||||||
|
.thumb_set PendSV_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak SysTick_Handler
|
||||||
|
.thumb_set SysTick_Handler,Default_Handler
|
||||||
|
|
||||||
|
.weak WWDG_IRQHandler
|
||||||
|
.thumb_set WWDG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak PVD_IRQHandler
|
||||||
|
.thumb_set PVD_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TAMP_STAMP_IRQHandler
|
||||||
|
.thumb_set TAMP_STAMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_WKUP_IRQHandler
|
||||||
|
.thumb_set RTC_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FLASH_IRQHandler
|
||||||
|
.thumb_set FLASH_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RCC_IRQHandler
|
||||||
|
.thumb_set RCC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI0_IRQHandler
|
||||||
|
.thumb_set EXTI0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI1_IRQHandler
|
||||||
|
.thumb_set EXTI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI2_IRQHandler
|
||||||
|
.thumb_set EXTI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI3_IRQHandler
|
||||||
|
.thumb_set EXTI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI4_IRQHandler
|
||||||
|
.thumb_set EXTI4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream0_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream1_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream2_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream3_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream4_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream5_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream6_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC_IRQHandler
|
||||||
|
.thumb_set ADC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_TX_IRQHandler
|
||||||
|
.thumb_set CAN1_TX_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_RX0_IRQHandler
|
||||||
|
.thumb_set CAN1_RX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_RX1_IRQHandler
|
||||||
|
.thumb_set CAN1_RX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN1_SCE_IRQHandler
|
||||||
|
.thumb_set CAN1_SCE_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI9_5_IRQHandler
|
||||||
|
.thumb_set EXTI9_5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_BRK_TIM9_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_TIM9_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_TIM10_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_TIM10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_TIM11_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_TIM11_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM3_IRQHandler
|
||||||
|
.thumb_set TIM3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM4_IRQHandler
|
||||||
|
.thumb_set TIM4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_EV_IRQHandler
|
||||||
|
.thumb_set I2C1_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C1_ER_IRQHandler
|
||||||
|
.thumb_set I2C1_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_EV_IRQHandler
|
||||||
|
.thumb_set I2C2_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C2_ER_IRQHandler
|
||||||
|
.thumb_set I2C2_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI1_IRQHandler
|
||||||
|
.thumb_set SPI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI2_IRQHandler
|
||||||
|
.thumb_set SPI2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART1_IRQHandler
|
||||||
|
.thumb_set USART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART2_IRQHandler
|
||||||
|
.thumb_set USART2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART3_IRQHandler
|
||||||
|
.thumb_set USART3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak EXTI15_10_IRQHandler
|
||||||
|
.thumb_set EXTI15_10_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RTC_Alarm_IRQHandler
|
||||||
|
.thumb_set RTC_Alarm_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_FS_WKUP_IRQHandler
|
||||||
|
.thumb_set OTG_FS_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_BRK_TIM12_IRQHandler
|
||||||
|
.thumb_set TIM8_BRK_TIM12_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_UP_TIM13_IRQHandler
|
||||||
|
.thumb_set TIM8_UP_TIM13_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_TRG_COM_TIM14_IRQHandler
|
||||||
|
.thumb_set TIM8_TRG_COM_TIM14_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM8_CC_IRQHandler
|
||||||
|
.thumb_set TIM8_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Stream7_IRQHandler
|
||||||
|
.thumb_set DMA1_Stream7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FSMC_IRQHandler
|
||||||
|
.thumb_set FSMC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SDIO_IRQHandler
|
||||||
|
.thumb_set SDIO_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM5_IRQHandler
|
||||||
|
.thumb_set TIM5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART4_IRQHandler
|
||||||
|
.thumb_set UART4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak UART5_IRQHandler
|
||||||
|
.thumb_set UART5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM6_DAC_IRQHandler
|
||||||
|
.thumb_set TIM6_DAC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM7_IRQHandler
|
||||||
|
.thumb_set TIM7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream0_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream1_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream2_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream3_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream4_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH_IRQHandler
|
||||||
|
.thumb_set ETH_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ETH_WKUP_IRQHandler
|
||||||
|
.thumb_set ETH_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN2_TX_IRQHandler
|
||||||
|
.thumb_set CAN2_TX_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN2_RX0_IRQHandler
|
||||||
|
.thumb_set CAN2_RX0_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN2_RX1_IRQHandler
|
||||||
|
.thumb_set CAN2_RX1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CAN2_SCE_IRQHandler
|
||||||
|
.thumb_set CAN2_SCE_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_FS_IRQHandler
|
||||||
|
.thumb_set OTG_FS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream5_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream6_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Stream7_IRQHandler
|
||||||
|
.thumb_set DMA2_Stream7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak USART6_IRQHandler
|
||||||
|
.thumb_set USART6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_EV_IRQHandler
|
||||||
|
.thumb_set I2C3_EV_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak I2C3_ER_IRQHandler
|
||||||
|
.thumb_set I2C3_ER_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_HS_EP1_OUT_IRQHandler
|
||||||
|
.thumb_set OTG_HS_EP1_OUT_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_HS_EP1_IN_IRQHandler
|
||||||
|
.thumb_set OTG_HS_EP1_IN_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_HS_WKUP_IRQHandler
|
||||||
|
.thumb_set OTG_HS_WKUP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak OTG_HS_IRQHandler
|
||||||
|
.thumb_set OTG_HS_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DCMI_IRQHandler
|
||||||
|
.thumb_set DCMI_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak HASH_RNG_IRQHandler
|
||||||
|
.thumb_set HASH_RNG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FPU_IRQHandler
|
||||||
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
Loading…
Reference in New Issue
Block a user