编译成功
This commit is contained in:
parent
cb7fda4eb3
commit
29dfb90276
22
.clang-format
Normal file
22
.clang-format
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
Language: C
|
||||||
|
BasedOnStyle: LLVM # 或 Google / WebKit / Chromium / GNU
|
||||||
|
|
||||||
|
IndentWidth: 4 # 每层缩进使用4个空格
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Never # 或者 ForIndentation / Always
|
||||||
|
|
||||||
|
BreakBeforeBraces: Allman # 大括号换行风格,如 Allman/K&R/Stroustrup
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: InlineOnly
|
||||||
|
|
||||||
|
ColumnLimit: 100 # 最大列宽,超出会换行(可设为 0 表示不限制)
|
||||||
|
AlignAfterOpenBracket: Align # 函数参数对齐风格
|
||||||
|
|
||||||
|
PointerAlignment: Left # 指针符号 * 左对齐,如 `int* ptr` vs `int *ptr`
|
||||||
|
SpaceBeforeParens: ControlStatements # 控制语句加空格,函数调用不加空格
|
||||||
|
|
||||||
|
IndentCaseLabels: true # switch-case 中 case 分支缩进
|
||||||
|
IndentGotoLabels: true
|
||||||
|
|
||||||
|
SortIncludes: false # 是否排序 include 头文件
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
/EWARM/build
|
/EWARM/build
|
||||||
/EWARM/debug
|
/EWARM/debug
|
||||||
/EWARM/settings
|
/EWARM/settings
|
||||||
|
/build/
|
20
.vscode/c_cpp_properties.json
vendored
20
.vscode/c_cpp_properties.json
vendored
@ -1,20 +0,0 @@
|
|||||||
{
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"name": "Win32",
|
|
||||||
"includePath": [
|
|
||||||
"${workspaceFolder}/**",
|
|
||||||
"D:\\Program Files\\IAR Systems\\Embedded Workbench 9.2\\arm\\inc\\c\\"
|
|
||||||
],
|
|
||||||
"defines": [
|
|
||||||
"_DEBUG",
|
|
||||||
"UNICODE",
|
|
||||||
"_UNICODE",
|
|
||||||
"USE_HAL_DRIVER",
|
|
||||||
"STM32L431xx",
|
|
||||||
"__ICCARM__"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"version": 4
|
|
||||||
}
|
|
18
.vscode/iar-vsc.json
vendored
Normal file
18
.vscode/iar-vsc.json
vendored
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"workspace": {
|
||||||
|
"path": "${workspaceFolder}\\EWARM\\Project.eww"
|
||||||
|
},
|
||||||
|
"workspaces": {
|
||||||
|
"${workspaceFolder}\\EWARM\\Project.eww": {
|
||||||
|
"configs": {
|
||||||
|
"${workspaceFolder}\\EWARM\\bootloader.ewp": "bootloader"
|
||||||
|
},
|
||||||
|
"selected": {
|
||||||
|
"path": "${workspaceFolder}\\EWARM\\bootloader.ewp"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"workbench": {
|
||||||
|
"path": "d:\\Program Files\\IAR Systems\\Embedded Workbench 9.2"
|
||||||
|
}
|
||||||
|
}
|
26
.vscode/launch.json
vendored
Normal file
26
.vscode/launch.json
vendored
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
//测试会debug,已废弃,直接Preferences: Open Keyboard Shortcuts (JSON) 绑定F5快捷键
|
||||||
|
/*
|
||||||
|
{
|
||||||
|
"key": "f5",
|
||||||
|
"command": "workbench.action.tasks.runTask",
|
||||||
|
"args": "pyocd-flash",
|
||||||
|
"when": "editorTextFocus"
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
"version": "0.0.1",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"executable": "${workspaceFolder}/EWARM/debug/Exe/bootloader.hex",
|
||||||
|
"name": "only download",
|
||||||
|
"request": "launch",
|
||||||
|
"type": "cortex-debug",
|
||||||
|
"runToEntryPoint": "main",
|
||||||
|
"showDevDebugOutput": "none",
|
||||||
|
"servertype": "pyocd",
|
||||||
|
"preLaunchTask": "pyocd-flash",
|
||||||
|
"device": "STM32L431RCTx", // 根据芯片型号调整
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@ -10,5 +10,15 @@
|
|||||||
"stm32l431xx.h": "c",
|
"stm32l431xx.h": "c",
|
||||||
"core_cm4.h": "c",
|
"core_cm4.h": "c",
|
||||||
"system_stm32l4xx.h": "c"
|
"system_stm32l4xx.h": "c"
|
||||||
|
},
|
||||||
|
"iar-build.c-stat.showInToolbar": false,
|
||||||
|
"clangd.arguments": [
|
||||||
|
"--compile-commands-dir=build/Debug"
|
||||||
|
],
|
||||||
|
"files.watcherExclude": {
|
||||||
|
"**/build/**": true
|
||||||
|
},
|
||||||
|
"search.exclude": {
|
||||||
|
"**/build/**": true
|
||||||
}
|
}
|
||||||
}
|
}
|
14
.vscode/tasks.json
vendored
Normal file
14
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "pyocd-flash",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "pyocd flash --erase chip --target stm32l431rctx -f 10m .\\EWARM\\debug\\Exe\\bootloader.hex -W",
|
||||||
|
"group": "build",
|
||||||
|
"problemMatcher": []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
75
CMakeLists.txt
Normal file
75
CMakeLists.txt
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
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 bootloader)
|
||||||
|
|
||||||
|
# Include toolchain file
|
||||||
|
include("cmake/gcc-arm-none-eabi.cmake")
|
||||||
|
|
||||||
|
# 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
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB USER_SOURCES_ASW "${PROJECT_SOURCE_DIR}/asw/*.c")
|
||||||
|
file(GLOB USER_SOURCES_DRV "${PROJECT_SOURCE_DIR}/Drivers/Norflash/*.c")
|
||||||
|
|
||||||
|
# Add sources to executable
|
||||||
|
target_sources(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user sources here
|
||||||
|
${USER_SOURCES_ASW}
|
||||||
|
${USER_SOURCES_DRV}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add include paths
|
||||||
|
target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined include paths
|
||||||
|
${PROJECT_SOURCE_DIR}/asw/
|
||||||
|
${PROJECT_SOURCE_DIR}/Drivers/Norflash/
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add project symbols (macros)
|
||||||
|
target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE
|
||||||
|
# Add user defined symbols
|
||||||
|
)
|
||||||
|
|
||||||
|
# Add linked libraries
|
||||||
|
target_link_libraries(${CMAKE_PROJECT_NAME}
|
||||||
|
stm32cubemx
|
||||||
|
|
||||||
|
# Add user defined libraries
|
||||||
|
)
|
60
CMakePresets.json
Normal file
60
CMakePresets.json
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
{
|
||||||
|
"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": "RelWithDebInfo",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MinSizeRel",
|
||||||
|
"inherits": "default",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "MinSizeRel"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"buildPresets": [
|
||||||
|
{
|
||||||
|
"name": "Debug",
|
||||||
|
"configurePreset": "Debug"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "RelWithDebInfo",
|
||||||
|
"configurePreset": "RelWithDebInfo"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Release",
|
||||||
|
"configurePreset": "Release"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "MinSizeRel",
|
||||||
|
"configurePreset": "MinSizeRel"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -56,6 +56,7 @@ void DebugMon_Handler(void);
|
|||||||
void PendSV_Handler(void);
|
void PendSV_Handler(void);
|
||||||
void SysTick_Handler(void);
|
void SysTick_Handler(void);
|
||||||
void DMA1_Channel5_IRQHandler(void);
|
void DMA1_Channel5_IRQHandler(void);
|
||||||
|
void USART1_IRQHandler(void);
|
||||||
/* USER CODE BEGIN EFP */
|
/* USER CODE BEGIN EFP */
|
||||||
|
|
||||||
/* USER CODE END EFP */
|
/* USER CODE END EFP */
|
||||||
|
176
Core/Src/syscalls.c
Normal file
176
Core/Src/syscalls.c
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @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 libc-manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2020-2024 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;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _times(struct tms *buf)
|
||||||
|
{
|
||||||
|
(void)buf;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int _stat(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;
|
||||||
|
}
|
79
Core/Src/sysmem.c
Normal file
79
Core/Src/sysmem.c
Normal file
@ -0,0 +1,79 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @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 libc manual
|
||||||
|
******************************************************************************
|
||||||
|
* @attention
|
||||||
|
*
|
||||||
|
* Copyright (c) 2024 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>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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;
|
||||||
|
}
|
@ -393,3 +393,5 @@ void norflash_test(void)
|
|||||||
}
|
}
|
||||||
printf("\r\n");
|
printf("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ extern "C"{
|
|||||||
|
|
||||||
#define EX_FLASH_SIZE 0x00800000
|
#define EX_FLASH_SIZE 0x00800000
|
||||||
#define EX_FLASH_END_ADDR (EX_FLASH_START_ADDR+EX_FLASH_SIZE)
|
#define EX_FLASH_END_ADDR (EX_FLASH_START_ADDR+EX_FLASH_SIZE)
|
||||||
|
#define EX_FLASH_CRC_ADDR (EX_FLASH_END_ADDR - 0X100)
|
||||||
extern u16 NORFLASH_TYPE; //定义W25QXX芯片型号
|
extern u16 NORFLASH_TYPE; //定义W25QXX芯片型号
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////
|
||||||
@ -83,6 +83,7 @@ void NORFLASH_QuitMemroyMapMode(void);
|
|||||||
void norflash_test(void);
|
void norflash_test(void);
|
||||||
uint8_t NORFLASH_Check_Busy(void);
|
uint8_t NORFLASH_Check_Busy(void);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif // __cplusplus
|
#endif // __cplusplus
|
||||||
|
8
EWARM/Project.code-workspace
Normal file
8
EWARM/Project.code-workspace
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"name": "bootloader",
|
||||||
|
"path": "bootloader"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -3,5 +3,13 @@
|
|||||||
<project>
|
<project>
|
||||||
<path>$WS_DIR$\bootloader.ewp</path>
|
<path>$WS_DIR$\bootloader.ewp</path>
|
||||||
</project>
|
</project>
|
||||||
<batchBuild />
|
<batchBuild>
|
||||||
|
<batchDefinition>
|
||||||
|
<name>test</name>
|
||||||
|
<member>
|
||||||
|
<project>bootloader</project>
|
||||||
|
<configuration>bootloader</configuration>
|
||||||
|
</member>
|
||||||
|
</batchDefinition>
|
||||||
|
</batchBuild>
|
||||||
</workspace>
|
</workspace>
|
||||||
|
@ -236,7 +236,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCPreprocFile</name>
|
<name>CCPreprocFile</name>
|
||||||
<state>1</state>
|
<state>0</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCPreprocComments</name>
|
<name>CCPreprocComments</name>
|
||||||
@ -687,7 +687,7 @@
|
|||||||
<data>
|
<data>
|
||||||
<extensions></extensions>
|
<extensions></extensions>
|
||||||
<cmdline></cmdline>
|
<cmdline></cmdline>
|
||||||
<hasPrio>1</hasPrio>
|
<hasPrio>152</hasPrio>
|
||||||
<buildSequence>inputOutputBased</buildSequence>
|
<buildSequence>inputOutputBased</buildSequence>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
|
208
STM32L431XX_FLASH.ld
Normal file
208
STM32L431XX_FLASH.ld
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
/*
|
||||||
|
******************************************************************************
|
||||||
|
**
|
||||||
|
|
||||||
|
** File : LinkerScript.ld
|
||||||
|
**
|
||||||
|
** Author : STM32CubeMX
|
||||||
|
**
|
||||||
|
** Abstract : Linker script for STM32L431RCTx series
|
||||||
|
** 256Kbytes FLASH and 64Kbytes 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)
|
||||||
|
|
||||||
|
/* 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 */
|
||||||
|
|
||||||
|
/* Specify the memory areas */
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 48K
|
||||||
|
RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 16K
|
||||||
|
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 256K
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Define output sections */
|
||||||
|
SECTIONS
|
||||||
|
{
|
||||||
|
/* The startup code goes first into FLASH */
|
||||||
|
.isr_vector :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
KEEP(*(.isr_vector)) /* Startup code */
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
/* The program code and other data goes into FLASH */
|
||||||
|
.text :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
*(.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(8);
|
||||||
|
_etext = .; /* define a global symbols at end of code */
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
/* Constant data goes into FLASH */
|
||||||
|
.rodata :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
*(.rodata) /* .rodata sections (constants, strings, etc.) */
|
||||||
|
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.ARM.extab (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
*(.ARM.extab* .gnu.linkonce.armextab.*)
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.ARM (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
__exidx_start = .;
|
||||||
|
*(.ARM.exidx*)
|
||||||
|
__exidx_end = .;
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.preinit_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_start = .);
|
||||||
|
KEEP (*(.preinit_array*))
|
||||||
|
PROVIDE_HIDDEN (__preinit_array_end = .);
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.init_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
PROVIDE_HIDDEN (__init_array_start = .);
|
||||||
|
KEEP (*(SORT(.init_array.*)))
|
||||||
|
KEEP (*(.init_array*))
|
||||||
|
PROVIDE_HIDDEN (__init_array_end = .);
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
.fini_array (READONLY) : /* The "READONLY" keyword is only supported in GCC11 and later, remove it if using GCC10 or earlier. */
|
||||||
|
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
PROVIDE_HIDDEN (__fini_array_start = .);
|
||||||
|
KEEP (*(SORT(.fini_array.*)))
|
||||||
|
KEEP (*(.fini_array*))
|
||||||
|
PROVIDE_HIDDEN (__fini_array_end = .);
|
||||||
|
. = ALIGN(8);
|
||||||
|
} >FLASH
|
||||||
|
|
||||||
|
/* used by the startup to initialize data */
|
||||||
|
_sidata = LOADADDR(.data);
|
||||||
|
|
||||||
|
/* Initialized data sections goes into RAM, load LMA copy after code */
|
||||||
|
.data :
|
||||||
|
{
|
||||||
|
. = ALIGN(8);
|
||||||
|
_sdata = .; /* create a global symbol at data start */
|
||||||
|
*(.data) /* .data sections */
|
||||||
|
*(.data*) /* .data* sections */
|
||||||
|
*(.RamFunc) /* .RamFunc sections */
|
||||||
|
*(.RamFunc*) /* .RamFunc* sections */
|
||||||
|
|
||||||
|
. = ALIGN(8);
|
||||||
|
_edata = .; /* define a global symbol at data end */
|
||||||
|
} >RAM AT> FLASH
|
||||||
|
|
||||||
|
|
||||||
|
/* Uninitialized data section */
|
||||||
|
. = ALIGN(4);
|
||||||
|
.bss :
|
||||||
|
{
|
||||||
|
/* This is used by the startup in order to initialize the .bss secion */
|
||||||
|
_sbss = .; /* define a global symbol at bss start */
|
||||||
|
__bss_start__ = _sbss;
|
||||||
|
*(.bss)
|
||||||
|
*(.bss*)
|
||||||
|
*(COMMON)
|
||||||
|
|
||||||
|
. = ALIGN(4);
|
||||||
|
_ebss = .; /* define a global symbol at bss end */
|
||||||
|
__bss_end__ = _ebss;
|
||||||
|
} >RAM
|
||||||
|
|
||||||
|
/* User_heap_stack section, used to check that there is enough RAM left */
|
||||||
|
._user_heap_stack :
|
||||||
|
{
|
||||||
|
. = 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 ( * )
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
118
asw/bootapp.c
Normal file
118
asw/bootapp.c
Normal file
@ -0,0 +1,118 @@
|
|||||||
|
/*******************************************************************************
|
||||||
|
* the includes
|
||||||
|
******************************************************************************/
|
||||||
|
#include "bootapp.h"
|
||||||
|
#include "norflash.h"
|
||||||
|
#include "uartapp.h"
|
||||||
|
/*******************************************************************************
|
||||||
|
* the defines
|
||||||
|
******************************************************************************/
|
||||||
|
#define ENABLE_INT() __set_PRIMASK(0) /* 使能全局中断 */
|
||||||
|
#define DISABLE_INT() __set_PRIMASK(1) /* 禁止全局中断 */
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the typedefs
|
||||||
|
******************************************************************************/
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
uint32_t startflag;
|
||||||
|
uint32_t len;
|
||||||
|
uint32_t AppCRC;
|
||||||
|
uint32_t reverse;
|
||||||
|
} APPCRC_type;
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the globals
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the const
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the functions
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
void BspQspiBoot_JumpToApp(void)
|
||||||
|
{
|
||||||
|
uint32_t i = 0;
|
||||||
|
void (*AppJump)(void); /* 声明一个函数指针 */
|
||||||
|
__IO uint32_t AppAddr = 0x90000000; /* APP 地址 */
|
||||||
|
|
||||||
|
/* 关闭全局中断 */
|
||||||
|
DISABLE_INT();
|
||||||
|
|
||||||
|
/* 设置所有时钟到默认状态,使用HSI时钟 */
|
||||||
|
HAL_RCC_DeInit();
|
||||||
|
|
||||||
|
/* 关闭滴答定时器,复位到默认值 */
|
||||||
|
SysTick->CTRL = 0;
|
||||||
|
SysTick->LOAD = 0;
|
||||||
|
SysTick->VAL = 0;
|
||||||
|
|
||||||
|
/* 关闭所有中断,清除所有中断挂起标志 */
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
{
|
||||||
|
NVIC->ICER[i] = 0xFFFFFFFF;
|
||||||
|
NVIC->ICPR[i] = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 使能全局中断 */
|
||||||
|
ENABLE_INT();
|
||||||
|
|
||||||
|
/* 跳转到应用程序,首地址是MSP,地址+4是复位中断服务程序地址 */
|
||||||
|
AppJump = (void (*)(void))(*((uint32_t*)(AppAddr + 4)));
|
||||||
|
|
||||||
|
/* 设置主堆栈指针 */
|
||||||
|
__set_MSP(*(uint32_t*)AppAddr);
|
||||||
|
|
||||||
|
/* 在RTOS工程,这条语句很重要,设置为特权级模式,使用MSP指针 */
|
||||||
|
__set_CONTROL(0);
|
||||||
|
|
||||||
|
/* 跳转到系统BootLoader */
|
||||||
|
AppJump();
|
||||||
|
|
||||||
|
/* 跳转成功的话,不会执行到这里,用户可以在这里添加代码 */
|
||||||
|
}
|
||||||
|
|
||||||
|
void WriteCRCInfo(uint32_t len, uint32_t crc)
|
||||||
|
{
|
||||||
|
APPCRC_type appcrc;
|
||||||
|
appcrc.startflag = 0xAA5555AA;
|
||||||
|
appcrc.len = len;
|
||||||
|
appcrc.AppCRC = crc;
|
||||||
|
appcrc.reverse = 0xAAAAAAAA;
|
||||||
|
NORFLASH_Write_NoCheck((uint8_t*)&appcrc, EX_FLASH_CRC_ADDR, 0x10);
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t ReadCRCInfo(uint32_t* len, uint32_t* crc)
|
||||||
|
{
|
||||||
|
APPCRC_type* appcrc = (APPCRC_type*)EX_FLASH_CRC_ADDR;
|
||||||
|
if (appcrc->startflag == 0xAA5555AA)
|
||||||
|
{
|
||||||
|
*len = appcrc->len;
|
||||||
|
*crc = appcrc->AppCRC;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t Boot_checkApp(void)
|
||||||
|
{
|
||||||
|
uint32_t len, crc;
|
||||||
|
if (ReadCRCInfo(&len, &crc) == 1)
|
||||||
|
{
|
||||||
|
if (crc_calc(EX_FLASH_START_ADDR, len) == crc)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
38
asw/bootapp.h
Normal file
38
asw/bootapp.h
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
#ifndef __BOOTAPP_H__
|
||||||
|
#define __BOOTAPP_H__
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the includes
|
||||||
|
******************************************************************************/
|
||||||
|
#include "stm32l4xx_hal.h"
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the defines
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the typedefs
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the globals
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
* the functions
|
||||||
|
******************************************************************************/
|
||||||
|
|
||||||
|
void WriteCRCInfo(uint32_t len, uint32_t crc);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
@ -34,7 +34,7 @@
|
|||||||
#include "uartapp.h"
|
#include "uartapp.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "norflash.h"
|
#include "norflash.h"
|
||||||
|
#include "hardware.h"
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
- D E F I N E S / M A C R O S
|
- D E F I N E S / M A C R O S
|
||||||
----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
@ -63,6 +63,7 @@ typedef enum
|
|||||||
CMD31_MapMode,
|
CMD31_MapMode,
|
||||||
CMD31_QuitMapMode,
|
CMD31_QuitMapMode,
|
||||||
CMD31_MapModeTest,
|
CMD31_MapModeTest,
|
||||||
|
CMD31_WriteCRC,
|
||||||
CMD31_NUM,
|
CMD31_NUM,
|
||||||
}CMD31_type;
|
}CMD31_type;
|
||||||
/*---------------------------------------------------------------------------
|
/*---------------------------------------------------------------------------
|
||||||
@ -342,6 +343,9 @@ static void uartapp_cmd31(uint8_t *data,uint16_t len)
|
|||||||
break;
|
break;
|
||||||
case CMD31_MapModeTest:
|
case CMD31_MapModeTest:
|
||||||
norflash_test();
|
norflash_test();
|
||||||
|
break;
|
||||||
|
case CMD31_WriteCRC:
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
----------------------------------------------------------------------------*/
|
----------------------------------------------------------------------------*/
|
||||||
void uartapp_init(void);
|
void uartapp_init(void);
|
||||||
void uartapp_maintask(void);
|
void uartapp_maintask(void);
|
||||||
|
uint32_t crc_calc(uint32_t addr,uint32_t len);
|
||||||
|
|
||||||
#endif /*DEFINES_NAME*/
|
#endif /*DEFINES_NAME*/
|
||||||
|
|
||||||
|
45
cmake/gcc-arm-none-eabi.cmake
Normal file
45
cmake/gcc-arm-none-eabi.cmake
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
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 -Wextra -Wpedantic -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_C_LINK_FLAGS "${TARGET_FLAGS}")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -T \"${CMAKE_SOURCE_DIR}/STM32L431XX_FLASH.ld\"")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} --specs=nano.specs")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,-Map=${CMAKE_PROJECT_NAME}.map -Wl,--gc-sections")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group -lc -lm -Wl,--end-group")
|
||||||
|
set(CMAKE_C_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--print-memory-usage")
|
||||||
|
|
||||||
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_C_LINK_FLAGS} -Wl,--start-group -lstdc++ -lsupc++ -Wl,--end-group")
|
95
cmake/stm32cubemx/CMakeLists.txt
Normal file
95
cmake/stm32cubemx/CMakeLists.txt
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
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
|
||||||
|
STM32L431xx
|
||||||
|
$<$<CONFIG:Debug>:DEBUG>
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32CubeMX generated include paths
|
||||||
|
set(MX_Include_Dirs
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Inc
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Inc
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Inc/Legacy
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/CMSIS/Device/ST/STM32L4xx/Include
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/CMSIS/Include
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32CubeMX generated application sources
|
||||||
|
set(MX_Application_Src
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/main.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/stm32l4xx_it.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/stm32l4xx_hal_msp.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/sysmem.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/syscalls.c
|
||||||
|
${CMAKE_SOURCE_DIR}/startup_stm32l431xx.s
|
||||||
|
)
|
||||||
|
|
||||||
|
# STM32 HAL/LL Drivers
|
||||||
|
set(STM32_Drivers_Src
|
||||||
|
${CMAKE_SOURCE_DIR}/Core/Src/system_stm32l4xx.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_crc.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_crc_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_qspi.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rng.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c
|
||||||
|
${CMAKE_SOURCE_DIR}/Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c
|
||||||
|
)
|
||||||
|
|
||||||
|
# Drivers Midllewares
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Link directories setup
|
||||||
|
set(MX_LINK_DIRS
|
||||||
|
|
||||||
|
)
|
||||||
|
# Project static libraries
|
||||||
|
set(MX_LINK_LIBS
|
||||||
|
STM32_Drivers
|
||||||
|
|
||||||
|
)
|
||||||
|
# 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)
|
||||||
|
|
||||||
|
|
||||||
|
# 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()
|
461
startup_stm32l431xx.s
Normal file
461
startup_stm32l431xx.s
Normal file
@ -0,0 +1,461 @@
|
|||||||
|
/**
|
||||||
|
******************************************************************************
|
||||||
|
* @file startup_stm32l431xx.s
|
||||||
|
* @author MCD Application Team
|
||||||
|
* @brief STM32L431xx devices vector table for GCC toolchain.
|
||||||
|
* This module performs:
|
||||||
|
* - Set the initial SP
|
||||||
|
* - Set the initial PC == Reset_Handler,
|
||||||
|
* - Set the vector table entries with the exceptions ISR address,
|
||||||
|
* - Configure the clock system
|
||||||
|
* - 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
|
||||||
|
|
||||||
|
.equ BootRAM, 0xF1E0F85F
|
||||||
|
/**
|
||||||
|
* @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
|
||||||
|
|
||||||
|
LoopForever:
|
||||||
|
b LoopForever
|
||||||
|
|
||||||
|
.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-M4. 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
|
||||||
|
.size g_pfnVectors, .-g_pfnVectors
|
||||||
|
|
||||||
|
|
||||||
|
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
|
||||||
|
.word WWDG_IRQHandler
|
||||||
|
.word PVD_PVM_IRQHandler
|
||||||
|
.word TAMP_STAMP_IRQHandler
|
||||||
|
.word RTC_WKUP_IRQHandler
|
||||||
|
.word FLASH_IRQHandler
|
||||||
|
.word RCC_IRQHandler
|
||||||
|
.word EXTI0_IRQHandler
|
||||||
|
.word EXTI1_IRQHandler
|
||||||
|
.word EXTI2_IRQHandler
|
||||||
|
.word EXTI3_IRQHandler
|
||||||
|
.word EXTI4_IRQHandler
|
||||||
|
.word DMA1_Channel1_IRQHandler
|
||||||
|
.word DMA1_Channel2_IRQHandler
|
||||||
|
.word DMA1_Channel3_IRQHandler
|
||||||
|
.word DMA1_Channel4_IRQHandler
|
||||||
|
.word DMA1_Channel5_IRQHandler
|
||||||
|
.word DMA1_Channel6_IRQHandler
|
||||||
|
.word DMA1_Channel7_IRQHandler
|
||||||
|
.word ADC1_IRQHandler
|
||||||
|
.word CAN1_TX_IRQHandler
|
||||||
|
.word CAN1_RX0_IRQHandler
|
||||||
|
.word CAN1_RX1_IRQHandler
|
||||||
|
.word CAN1_SCE_IRQHandler
|
||||||
|
.word EXTI9_5_IRQHandler
|
||||||
|
.word TIM1_BRK_TIM15_IRQHandler
|
||||||
|
.word TIM1_UP_TIM16_IRQHandler
|
||||||
|
.word TIM1_TRG_COM_IRQHandler
|
||||||
|
.word TIM1_CC_IRQHandler
|
||||||
|
.word TIM2_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word I2C1_EV_IRQHandler
|
||||||
|
.word I2C1_ER_IRQHandler
|
||||||
|
.word I2C2_EV_IRQHandler
|
||||||
|
.word I2C2_ER_IRQHandler
|
||||||
|
.word SPI1_IRQHandler
|
||||||
|
.word SPI2_IRQHandler
|
||||||
|
.word USART1_IRQHandler
|
||||||
|
.word USART2_IRQHandler
|
||||||
|
.word USART3_IRQHandler
|
||||||
|
.word EXTI15_10_IRQHandler
|
||||||
|
.word RTC_Alarm_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word SDMMC1_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word SPI3_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word TIM6_DAC_IRQHandler
|
||||||
|
.word TIM7_IRQHandler
|
||||||
|
.word DMA2_Channel1_IRQHandler
|
||||||
|
.word DMA2_Channel2_IRQHandler
|
||||||
|
.word DMA2_Channel3_IRQHandler
|
||||||
|
.word DMA2_Channel4_IRQHandler
|
||||||
|
.word DMA2_Channel5_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word COMP_IRQHandler
|
||||||
|
.word LPTIM1_IRQHandler
|
||||||
|
.word LPTIM2_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word DMA2_Channel6_IRQHandler
|
||||||
|
.word DMA2_Channel7_IRQHandler
|
||||||
|
.word LPUART1_IRQHandler
|
||||||
|
.word QUADSPI_IRQHandler
|
||||||
|
.word I2C3_EV_IRQHandler
|
||||||
|
.word I2C3_ER_IRQHandler
|
||||||
|
.word SAI1_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word SWPMI1_IRQHandler
|
||||||
|
.word TSC_IRQHandler
|
||||||
|
.word 0
|
||||||
|
.word 0
|
||||||
|
.word RNG_IRQHandler
|
||||||
|
.word FPU_IRQHandler
|
||||||
|
.word CRS_IRQHandler
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
*
|
||||||
|
* 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_PVM_IRQHandler
|
||||||
|
.thumb_set PVD_PVM_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_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA1_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA1_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak ADC1_IRQHandler
|
||||||
|
.thumb_set ADC1_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_TIM15_IRQHandler
|
||||||
|
.thumb_set TIM1_BRK_TIM15_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_UP_TIM16_IRQHandler
|
||||||
|
.thumb_set TIM1_UP_TIM16_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_TRG_COM_IRQHandler
|
||||||
|
.thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM1_CC_IRQHandler
|
||||||
|
.thumb_set TIM1_CC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TIM2_IRQHandler
|
||||||
|
.thumb_set TIM2_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 SDMMC1_IRQHandler
|
||||||
|
.thumb_set SDMMC1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SPI3_IRQHandler
|
||||||
|
.thumb_set SPI3_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_Channel1_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel2_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel3_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel3_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel4_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel4_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel5_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel5_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak COMP_IRQHandler
|
||||||
|
.thumb_set COMP_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM1_IRQHandler
|
||||||
|
.thumb_set LPTIM1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPTIM2_IRQHandler
|
||||||
|
.thumb_set LPTIM2_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel6_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel6_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak DMA2_Channel7_IRQHandler
|
||||||
|
.thumb_set DMA2_Channel7_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak LPUART1_IRQHandler
|
||||||
|
.thumb_set LPUART1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak QUADSPI_IRQHandler
|
||||||
|
.thumb_set QUADSPI_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 SAI1_IRQHandler
|
||||||
|
.thumb_set SAI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak SWPMI1_IRQHandler
|
||||||
|
.thumb_set SWPMI1_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak TSC_IRQHandler
|
||||||
|
.thumb_set TSC_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak RNG_IRQHandler
|
||||||
|
.thumb_set RNG_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak FPU_IRQHandler
|
||||||
|
.thumb_set FPU_IRQHandler,Default_Handler
|
||||||
|
|
||||||
|
.weak CRS_IRQHandler
|
||||||
|
.thumb_set CRS_IRQHandler,Default_Handler
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user