├── README.md ├── Drivers ├── CMSIS │ ├── Device │ │ └── ST │ │ │ └── STM32F4xx │ │ │ └── Include │ │ │ ├── stm32f4xx.h │ │ │ └── system_stm32f4xx.h │ └── Include │ │ ├── core_cmFunc.h │ │ ├── core_cmInstr.h │ │ ├── core_cmSimd.h │ │ ├── arm_const_structs.h │ │ └── arm_common_tables.h └── STM32F4xx_HAL_Driver │ ├── Inc │ ├── stm32f4xx_hal_flash_ramfunc.h │ ├── stm32f4xx_hal_dma_ex.h │ ├── stm32f4xx_hal_def.h │ └── stm32f4xx_hal.h │ └── Src │ ├── stm32f4xx_hal_flash_ramfunc.c │ └── stm32f4xx_hal_dma_ex.c ├── Middlewares └── Third_Party │ └── FreeRTOS │ └── Source │ ├── CMSIS_RTOS │ ├── cmsis_os.c │ └── cmsis_os.h │ ├── include │ ├── projdefs.h │ ├── FreeRTOSConfig_template.h │ ├── StackMacros.h │ ├── mpu_wrappers.h │ ├── portable.h │ └── deprecated_definitions.h │ ├── portable │ └── GCC │ │ └── ARM_CM4F │ │ └── portmacro.h │ └── list.c ├── .vscode ├── settings.json ├── launch.json └── c_cpp_properties.json ├── openocd.cfg ├── .gitignore ├── Src ├── FreeRTOS-openocd.c.bak ├── tags ├── freertos.c ├── stm32f4xx_it.c ├── stm32f4xx_hal_msp.c └── stm32f4xx_hal_timebase_TIM.c ├── Inc ├── stm32f4xx_it.h ├── FreeRTOSConfig.h └── main.h ├── makefile └── STM32F429ZITx_FLASH.ld /README.md: -------------------------------------------------------------------------------- 1 | # STM32_VSCode 2 | 3 | 这是一个用CubeMX生成的STM32工程,使用STM32F429DISCO评估板,启动了一个BLINK任务进行测试。右键在目录下使用VS Code打开,即可进行开发。 -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengyangliu/VSCode_STM32_Templet/HEAD/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengyangliu/VSCode_STM32_Templet/HEAD/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhengyangliu/VSCode_STM32_Templet/HEAD/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "stm32f4xx_hal.h": "c", 4 | "bitset": "c" 5 | }, 6 | "C_Cpp.intelliSenseEngineFallback": "Enabled", 7 | "C_Cpp.errorSquiggles": "Disabled", 8 | "editor.minimap.enabled": true 9 | } -------------------------------------------------------------------------------- /openocd.cfg: -------------------------------------------------------------------------------- 1 | # This is an STM32L discovery board with a single STM32L152RBT6 chip. 2 | # http://www.st.com/internet/evalboard/product/250990.jsp 3 | 4 | source [find interface/stlink-v2.cfg] 5 | 6 | #transport select hla_swd 7 | 8 | #set WORKAREASIZE 0x4000 9 | source [find target/stm32f4x.cfg] 10 | 11 | # use hardware reset, connect under reset 12 | #reset_config srst_only srst_nogate 13 | 14 | #$_TARGETNAME configure -rtos auto 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /Src/FreeRTOS-openocd.c.bak: -------------------------------------------------------------------------------- 1 | /* 2 | * Since at least FreeRTOS V7.5.3 uxTopUsedPriority is no longer 3 | * present in the kernel, so it has to be supplied by other means for 4 | * OpenOCD's threads awareness. 5 | * 6 | * Add this file to your project, and, if you're using --gc-sections, 7 | * ``--undefined=uxTopUsedPriority'' (or 8 | * ``-Wl,--undefined=uxTopUsedPriority'' when using gcc for final 9 | * linking) to your LDFLAGS; same with all the other symbols you need. 10 | */ 11 | 12 | #include "FreeRTOS.h" 13 | 14 | #ifdef __GNUC__ 15 | #define USED __attribute__((used)) 16 | #else 17 | #define USED 18 | #endif 19 | 20 | const int USED uxTopUsedPriority = configMAX_PRIORITIES - 1; 21 | -------------------------------------------------------------------------------- /Src/tags: -------------------------------------------------------------------------------- 1 | !_TAG_FILE_FORMAT 2 /extended format; --format=1 will not append ;" to lines/ 2 | !_TAG_FILE_SORTED 1 /0=unsorted, 1=sorted, 2=foldcase/ 3 | !_TAG_PROGRAM_AUTHOR Darren Hiebert /dhiebert@users.sourceforge.net/ 4 | !_TAG_PROGRAM_NAME Exuberant Ctags // 5 | !_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/ 6 | !_TAG_PROGRAM_VERSION 5.9~svn20110310 // 7 | AHBPrescTable system_stm32f4xx.c /^const uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};$/;" v 8 | APBPrescTable system_stm32f4xx.c /^const uint8_t APBPrescTable[8] = {0, 0, 0, 0, 1, 2, 3, 4};$/;" v 9 | Error_Handler main.c /^void Error_Handler(void)$/;" f 10 | HAL_InitTick stm32f4xx_hal_timebase_TIM.c /^HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)$/;" f 11 | HAL_MspInit stm32f4xx_hal_msp.c /^void HAL_MspInit(void)$/;" f 12 | HAL_ResumeTick stm32f4xx_hal_timebase_TIM.c /^void HAL_ResumeTick(void)$/;" f 13 | HAL_SuspendTick stm32f4xx_hal_timebase_TIM.c /^void HAL_SuspendTick(void)$/;" f 14 | HAL_TIM_PeriodElapsedCallback main.c /^void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)$/;" f 15 | HSE_VALUE system_stm32f4xx.c 70;" d file: 16 | HSI_VALUE system_stm32f4xx.c 74;" d file: 17 | LD3_GPIO_Port main.c 74;" d file: 18 | LD3_Pin main.c 73;" d file: 19 | LD4_GPIO_Port main.c 76;" d file: 20 | LD4_Pin main.c 75;" d file: 21 | Light_Task main.c /^void Light_Task(void *pvParameters)$/;" f 22 | MX_GPIO_Init main.c /^static void MX_GPIO_Init(void)$/;" f file: 23 | StartDefaultTask main.c /^void StartDefaultTask(void const * argument)$/;" f 24 | SysTick_Handler stm32f4xx_it.c /^void SysTick_Handler(void)$/;" f 25 | SystemClock_Config main.c /^void SystemClock_Config(void)$/;" f 26 | SystemCoreClock system_stm32f4xx.c /^uint32_t SystemCoreClock = 16000000;$/;" v 27 | SystemCoreClockUpdate system_stm32f4xx.c /^void SystemCoreClockUpdate(void)$/;" f 28 | SystemInit system_stm32f4xx.c /^void SystemInit(void)$/;" f 29 | SystemInit_ExtMemCtl system_stm32f4xx.c /^void SystemInit_ExtMemCtl(void)$/;" f 30 | TIM8_TRG_COM_TIM14_IRQHandler stm32f4xx_it.c /^void TIM8_TRG_COM_TIM14_IRQHandler(void)$/;" f 31 | VECT_TAB_OFFSET system_stm32f4xx.c 111;" d file: 32 | assert_failed main.c /^void assert_failed(uint8_t* file, uint32_t line)$/;" f 33 | defaultTaskHandle main.c /^osThreadId defaultTaskHandle;$/;" v 34 | htim14 stm32f4xx_hal_timebase_TIM.c /^TIM_HandleTypeDef htim14; $/;" v 35 | main main.c /^int main(void)$/;" f 36 | uwIncrementState stm32f4xx_hal_timebase_TIM.c /^uint32_t uwIncrementState = 0;$/;" v 37 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "trace": true, 4 | "configurations": [ 5 | { 6 | "name": "STM32 Launch", 7 | "type": "cppdbg", 8 | "request": "launch", 9 | "targetArchitecture": "arm", 10 | "MIMode": "gdb", 11 | "logging": { 12 | "engineLogging": true, 13 | "moduleLoad": false, 14 | "exceptions": false, 15 | "trace": false, 16 | "traceResponse": false 17 | }, 18 | "customLaunchSetupCommands": [ 19 | { 20 | "text": "target remote :3333", 21 | "description": "connect to remote target", 22 | "ignoreFailures": false 23 | }, 24 | { 25 | "text": "monitor reset halt", 26 | "description": "halt", 27 | "ignoreFailures": false 28 | }, 29 | { 30 | "text": "file C:/Users/zhengyangliu/Desktop/code/STM32CubeMX-F429DISCO/Blink.elf", 31 | "description": "load symbols", 32 | "ignoreFailures": false 33 | }, 34 | { 35 | "text": "load", 36 | "description": "load to remote MCU", 37 | "ignoreFailures": false 38 | }, 39 | { 40 | "text": "break MCU_START", 41 | "description": "halt", 42 | "ignoreFailures": false 43 | }, 44 | ], 45 | "launchCompleteCommand": "None", 46 | "program": "${workspaceRoot}\\Blink.elf", 47 | "args": [ 48 | "target remote localhost:3333" 49 | ], 50 | "stopAtEntry": true, 51 | "cwd": "${workspaceRoot}", 52 | "environment": [], 53 | "externalConsole": true, 54 | "filterStderr": true, 55 | "filterStdout": false, 56 | //"preLaunchTask": "make debug", 57 | "miDebuggerServerAddress": "localhost:3333", 58 | "serverLaunchTimeout": 5000, 59 | "windows": { 60 | "MIMode": "gdb", 61 | "MIDebuggerPath": "arm-none-eabi-gdb.exe", 62 | "serverStarted": "target halted due to debug-request, current mode: Thread", 63 | "debugServerPath": "openocd.exe", 64 | "debugServerArgs": "-f \"C:/Users/zhengyangliu/Desktop/code/STM32CubeMX-F429DISCO/openocd.cfg\" -c init -c \"reset halt\"", 65 | } 66 | } 67 | ] 68 | } -------------------------------------------------------------------------------- /Inc/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.h 4 | * @brief This file contains the headers of the interrupt handlers. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2017 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | 34 | /* Define to prevent recursive inclusion -------------------------------------*/ 35 | #ifndef __STM32F4xx_IT_H 36 | #define __STM32F4xx_IT_H 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Includes ------------------------------------------------------------------*/ 43 | /* Exported types ------------------------------------------------------------*/ 44 | /* Exported constants --------------------------------------------------------*/ 45 | /* Exported macro ------------------------------------------------------------*/ 46 | /* Exported functions ------------------------------------------------------- */ 47 | 48 | void SysTick_Handler(void); 49 | void TIM8_TRG_COM_TIM14_IRQHandler(void); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* __STM32F4xx_IT_H */ 56 | 57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 58 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Win32", 5 | "includePath": [ 6 | "${workspaceRoot}", 7 | "${workspaceRoot}/Inc", 8 | "${workspaceRoot}/Drivers/STM32F4xx_HAL_Driver/Inc", 9 | "${workspaceRoot}/Drivers/CMSIS/Device/ST/STM32F4xx/Include", 10 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F", 11 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS", 12 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/include", 13 | "${workspaceRoot}/Drivers/CMSIS/Include", 14 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include", 15 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1", 16 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1/arm-none-eabi/thumb/v7-m", 17 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1/backward", 18 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/sys", 19 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include", 20 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include-fixed" 21 | ], 22 | "defines": [ 23 | "STM32F429xx", 24 | "__weak=\"__attribute__((weak))\"", 25 | "__packed=\"__attribute__((__packed__))\"", 26 | "USE_HAL_DRIVER" 27 | ], 28 | "intelliSenseMode": "clang-x64", 29 | "browse": { 30 | "path": [ 31 | "${workspaceRoot}", 32 | "${workspaceRoot}/Inc", 33 | "${workspaceRoot}/Drivers/STM32F4xx_HAL_Driver/Inc", 34 | "${workspaceRoot}/Drivers/CMSIS/Device/ST/STM32F4xx/Include", 35 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F", 36 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS", 37 | "${workspaceRoot}/Middlewares/Third_Party/FreeRTOS/Source/include", 38 | "${workspaceRoot}/Drivers/CMSIS/Include", 39 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include", 40 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1", 41 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1/arm-none-eabi/thumb/v7-m", 42 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/c++/7.2.1/backward", 43 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/arm-none-eabi/include/sys", 44 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include", 45 | "D:/GNU Tools ARM Embedded/7 2017-q4-major/lib/gcc/arm-none-eabi/7.2.1/include-fixed" 46 | ], 47 | "limitSymbolsToIncludedHeaders": true, 48 | "databaseFilename": "" 49 | } 50 | } 51 | ], 52 | "version": 3 53 | } -------------------------------------------------------------------------------- /Src/freertos.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : freertos.c 4 | * Description : Code for freertos applications 5 | ****************************************************************************** 6 | * 7 | * Copyright (c) 2017 STMicroelectronics International N.V. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted, provided that the following conditions are met: 12 | * 13 | * 1. Redistribution of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of other 19 | * contributors to this software may be used to endorse or promote products 20 | * derived from this software without specific written permission. 21 | * 4. This software, including modifications and/or derivative works of this 22 | * software, must execute solely and exclusively on microcontroller or 23 | * microprocessor devices manufactured by or for STMicroelectronics. 24 | * 5. Redistribution and use of this software other than as permitted under 25 | * this license is void and will automatically terminate your rights under 26 | * this license. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 29 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 31 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 32 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 33 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 36 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 37 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 38 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 39 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | ****************************************************************************** 42 | */ 43 | 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "FreeRTOS.h" 46 | #include "task.h" 47 | 48 | /* USER CODE BEGIN Includes */ 49 | 50 | /* USER CODE END Includes */ 51 | 52 | /* Variables -----------------------------------------------------------------*/ 53 | 54 | /* USER CODE BEGIN Variables */ 55 | 56 | /* USER CODE END Variables */ 57 | 58 | /* Function prototypes -------------------------------------------------------*/ 59 | 60 | /* USER CODE BEGIN FunctionPrototypes */ 61 | 62 | /* USER CODE END FunctionPrototypes */ 63 | 64 | /* Hook prototypes */ 65 | 66 | /* USER CODE BEGIN Application */ 67 | 68 | /* USER CODE END Application */ 69 | 70 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 71 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_flash_ramfunc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_flash_ramfunc.h 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief Header file of FLASH RAMFUNC driver. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2016 STMicroelectronics

12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | ****************************************************************************** 36 | */ 37 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ 39 | #ifndef __STM32F4xx_FLASH_RAMFUNC_H 40 | #define __STM32F4xx_FLASH_RAMFUNC_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F412Zx) ||\ 46 | defined(STM32F412Vx) || defined(STM32F412Rx) || defined(STM32F412Cx) 47 | 48 | /* Includes ------------------------------------------------------------------*/ 49 | #include "stm32f4xx_hal_def.h" 50 | 51 | /** @addtogroup STM32F4xx_HAL_Driver 52 | * @{ 53 | */ 54 | 55 | /** @addtogroup FLASH_RAMFUNC 56 | * @{ 57 | */ 58 | 59 | /* Exported types ------------------------------------------------------------*/ 60 | /* Exported macro ------------------------------------------------------------*/ 61 | /* Exported functions --------------------------------------------------------*/ 62 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions 63 | * @{ 64 | */ 65 | 66 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1 67 | * @{ 68 | */ 69 | __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void); 70 | __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void); 71 | __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void); 72 | __RAM_FUNC HAL_FLASHEx_DisableFlashSleepMode(void); 73 | /** 74 | * @} 75 | */ 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | #endif /* STM32F410xx || STM32F411xE || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */ 90 | #ifdef __cplusplus 91 | } 92 | #endif 93 | 94 | 95 | #endif /* __STM32F4xx_FLASH_RAMFUNC_H */ 96 | 97 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 98 | -------------------------------------------------------------------------------- /Src/stm32f4xx_it.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.c 4 | * @brief Interrupt Service Routines. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2017 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | /* Includes ------------------------------------------------------------------*/ 34 | #include "stm32f4xx_hal.h" 35 | #include "stm32f4xx.h" 36 | #include "stm32f4xx_it.h" 37 | #include "cmsis_os.h" 38 | 39 | /* USER CODE BEGIN 0 */ 40 | 41 | /* USER CODE END 0 */ 42 | 43 | /* External variables --------------------------------------------------------*/ 44 | 45 | extern TIM_HandleTypeDef htim14; 46 | 47 | /******************************************************************************/ 48 | /* Cortex-M4 Processor Interruption and Exception Handlers */ 49 | /******************************************************************************/ 50 | 51 | /** 52 | * @brief This function handles System tick timer. 53 | */ 54 | void SysTick_Handler(void) 55 | { 56 | /* USER CODE BEGIN SysTick_IRQn 0 */ 57 | 58 | /* USER CODE END SysTick_IRQn 0 */ 59 | osSystickHandler(); 60 | /* USER CODE BEGIN SysTick_IRQn 1 */ 61 | 62 | /* USER CODE END SysTick_IRQn 1 */ 63 | } 64 | 65 | /******************************************************************************/ 66 | /* STM32F4xx Peripheral Interrupt Handlers */ 67 | /* Add here the Interrupt Handlers for the used peripherals. */ 68 | /* For the available peripheral interrupt handler names, */ 69 | /* please refer to the startup file (startup_stm32f4xx.s). */ 70 | /******************************************************************************/ 71 | 72 | /** 73 | * @brief This function handles TIM8 trigger and commutation interrupts and TIM14 global interrupt. 74 | */ 75 | void TIM8_TRG_COM_TIM14_IRQHandler(void) 76 | { 77 | /* USER CODE BEGIN TIM8_TRG_COM_TIM14_IRQn 0 */ 78 | 79 | /* USER CODE END TIM8_TRG_COM_TIM14_IRQn 0 */ 80 | HAL_TIM_IRQHandler(&htim14); 81 | /* USER CODE BEGIN TIM8_TRG_COM_TIM14_IRQn 1 */ 82 | 83 | /* USER CODE END TIM8_TRG_COM_TIM14_IRQn 1 */ 84 | } 85 | 86 | /* USER CODE BEGIN 1 */ 87 | 88 | /* USER CODE END 1 */ 89 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 90 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Src/stm32f4xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : stm32f4xx_hal_msp.c 4 | * Description : This file provides code for the MSP Initialization 5 | * and de-Initialization codes. 6 | ****************************************************************************** 7 | * 8 | * Copyright (c) 2017 STMicroelectronics International N.V. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted, provided that the following conditions are met: 13 | * 14 | * 1. Redistribution of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. Neither the name of STMicroelectronics nor the names of other 20 | * contributors to this software may be used to endorse or promote products 21 | * derived from this software without specific written permission. 22 | * 4. This software, including modifications and/or derivative works of this 23 | * software, must execute solely and exclusively on microcontroller or 24 | * microprocessor devices manufactured by or for STMicroelectronics. 25 | * 5. Redistribution and use of this software other than as permitted under 26 | * this license is void and will automatically terminate your rights under 27 | * this license. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 30 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 32 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 33 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 34 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 35 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 36 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 37 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 38 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 39 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 40 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 41 | * 42 | ****************************************************************************** 43 | */ 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "stm32f4xx_hal.h" 46 | 47 | extern void Error_Handler(void); 48 | /* USER CODE BEGIN 0 */ 49 | 50 | /* USER CODE END 0 */ 51 | /** 52 | * Initializes the Global MSP. 53 | */ 54 | void HAL_MspInit(void) 55 | { 56 | /* USER CODE BEGIN MspInit 0 */ 57 | 58 | /* USER CODE END MspInit 0 */ 59 | 60 | HAL_NVIC_SetPriorityGrouping(NVIC_PRIORITYGROUP_4); 61 | 62 | /* System interrupt init*/ 63 | /* MemoryManagement_IRQn interrupt configuration */ 64 | HAL_NVIC_SetPriority(MemoryManagement_IRQn, 0, 0); 65 | /* BusFault_IRQn interrupt configuration */ 66 | HAL_NVIC_SetPriority(BusFault_IRQn, 0, 0); 67 | /* UsageFault_IRQn interrupt configuration */ 68 | HAL_NVIC_SetPriority(UsageFault_IRQn, 0, 0); 69 | /* SVCall_IRQn interrupt configuration */ 70 | HAL_NVIC_SetPriority(SVCall_IRQn, 0, 0); 71 | /* DebugMonitor_IRQn interrupt configuration */ 72 | HAL_NVIC_SetPriority(DebugMonitor_IRQn, 0, 0); 73 | /* PendSV_IRQn interrupt configuration */ 74 | HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0); 75 | /* SysTick_IRQn interrupt configuration */ 76 | HAL_NVIC_SetPriority(SysTick_IRQn, 15, 0); 77 | 78 | /* USER CODE BEGIN MspInit 1 */ 79 | 80 | /* USER CODE END MspInit 1 */ 81 | } 82 | 83 | /* USER CODE BEGIN 1 */ 84 | 85 | /* USER CODE END 1 */ 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 96 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V2.6.0 6 | * @date 04-November-2016 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2016 STMicroelectronics

12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | ****************************************************************************** 36 | */ 37 | 38 | /** @addtogroup CMSIS 39 | * @{ 40 | */ 41 | 42 | /** @addtogroup stm32f4xx_system 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @brief Define to prevent recursive inclusion 48 | */ 49 | #ifndef __SYSTEM_STM32F4XX_H 50 | #define __SYSTEM_STM32F4XX_H 51 | 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | /** @addtogroup STM32F4xx_System_Includes 57 | * @{ 58 | */ 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | 65 | /** @addtogroup STM32F4xx_System_Exported_types 66 | * @{ 67 | */ 68 | /* This variable is updated in three ways: 69 | 1) by calling CMSIS function SystemCoreClockUpdate() 70 | 2) by calling HAL API function HAL_RCC_GetSysClockFreq() 71 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 72 | Note: If you use this function to configure the system clock; then there 73 | is no need to call the 2 first functions listed above, since SystemCoreClock 74 | variable is updated automatically. 75 | */ 76 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 77 | 78 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 79 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /** @addtogroup STM32F4xx_System_Exported_Constants 86 | * @{ 87 | */ 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | /** @addtogroup STM32F4xx_System_Exported_Macros 94 | * @{ 95 | */ 96 | 97 | /** 98 | * @} 99 | */ 100 | 101 | /** @addtogroup STM32F4xx_System_Exported_Functions 102 | * @{ 103 | */ 104 | 105 | extern void SystemInit(void); 106 | extern void SystemCoreClockUpdate(void); 107 | /** 108 | * @} 109 | */ 110 | 111 | #ifdef __cplusplus 112 | } 113 | #endif 114 | 115 | #endif /*__SYSTEM_STM32F4XX_H */ 116 | 117 | /** 118 | * @} 119 | */ 120 | 121 | /** 122 | * @} 123 | */ 124 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 125 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_dma_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_dma_ex.h 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief Header file of DMA HAL extension module. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2016 STMicroelectronics

12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 1. Redistributions of source code must retain the above copyright notice, 16 | * this list of conditions and the following disclaimer. 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, 18 | * this list of conditions and the following disclaimer in the documentation 19 | * and/or other materials provided with the distribution. 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 21 | * may be used to endorse or promote products derived from this software 22 | * without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | ****************************************************************************** 36 | */ 37 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ 39 | #ifndef __STM32F4xx_HAL_DMA_EX_H 40 | #define __STM32F4xx_HAL_DMA_EX_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /* Includes ------------------------------------------------------------------*/ 47 | #include "stm32f4xx_hal_def.h" 48 | 49 | /** @addtogroup STM32F4xx_HAL_Driver 50 | * @{ 51 | */ 52 | 53 | /** @addtogroup DMAEx 54 | * @{ 55 | */ 56 | 57 | /* Exported types ------------------------------------------------------------*/ 58 | /** @defgroup DMAEx_Exported_Types DMAEx Exported Types 59 | * @brief DMAEx Exported types 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @brief HAL DMA Memory definition 65 | */ 66 | typedef enum 67 | { 68 | MEMORY0 = 0x00U, /*!< Memory 0 */ 69 | MEMORY1 = 0x01U /*!< Memory 1 */ 70 | }HAL_DMA_MemoryTypeDef; 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /* Exported functions --------------------------------------------------------*/ 77 | /** @defgroup DMAEx_Exported_Functions DMAEx Exported Functions 78 | * @brief DMAEx Exported functions 79 | * @{ 80 | */ 81 | 82 | /** @defgroup DMAEx_Exported_Functions_Group1 Extended features functions 83 | * @brief Extended features functions 84 | * @{ 85 | */ 86 | 87 | /* IO operation functions *******************************************************/ 88 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); 89 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength); 90 | HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory); 91 | 92 | /** 93 | * @} 94 | */ 95 | /** 96 | * @} 97 | */ 98 | 99 | /* Private functions ---------------------------------------------------------*/ 100 | /** @defgroup DMAEx_Private_Functions DMAEx Private Functions 101 | * @brief DMAEx Private functions 102 | * @{ 103 | */ 104 | /** 105 | * @} 106 | */ 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | /** 113 | * @} 114 | */ 115 | 116 | #ifdef __cplusplus 117 | } 118 | #endif 119 | 120 | #endif /*__STM32F4xx_HAL_DMA_EX_H*/ 121 | 122 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 123 | -------------------------------------------------------------------------------- /makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # 3 | # 简介:通用的stm32 makefile,根据自己的工程进行设定就可以使用了 4 | # 5 | # 作者:yangliu 6 | # 日期:2017.2.14 7 | # 8 | ################################################################################ 9 | 10 | 11 | #--------------------------------- 编译参数 ------------------------------------ 12 | ifneq ($(V),1) 13 | Q := @ 14 | NULL := 2>/dev/null 15 | endif 16 | 17 | 18 | TARGET := Blink 19 | OPT := -O0 20 | CSTD := -std=c11 21 | CXXSTD := -std=c++11 22 | 23 | INC_FLAGS += -I ./Inc 24 | INC_FLAGS += -I ./Drivers/STM32F4xx_HAL_Driver/Inc 25 | INC_FLAGS += -I ./Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F 26 | INC_FLAGS += -I ./Middlewares/Third_Party/FreeRTOS/Source/include 27 | INC_FLAGS += -I ./Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS 28 | INC_FLAGS += -I ./Drivers/CMSIS/Include 29 | INC_FLAGS += -I ./Drivers/CMSIS/Device/ST/STM32F4xx/Include 30 | 31 | DEFINES += -D __weak="__attribute__((weak))" 32 | DEFINES += -D __packed="__attribute__((__packed__))" 33 | DEFINES += -D USE_HAL_DRIVER 34 | DEFINES += -D STM32F429xx 35 | 36 | LDSCRIPT := STM32F429ZITx_FLASH.ld 37 | 38 | FP_FLAGS += -mfpu=fpv4-sp-d16 39 | FP_FLAGS += -mfloat-abi=softfp 40 | 41 | ARCH_FLAGS += -mthumb 42 | ARCH_FLAGS += -mcpu=cortex-m4 43 | 44 | 45 | CWARN_FLAGS += -Wall -Wshadow 46 | #CWARN_FLAGS += -Wundef -Wextra -Wredundant-decls 47 | CWARN_FLAGS += -fno-common -ffunction-sections -fdata-sections 48 | CWARN_FLAGS += -Wimplicit-function-declaration 49 | #CWARN_FLAGS += -Wmissing-prototypes 50 | CWARN_FLAGS += -Wstrict-prototypes 51 | 52 | CXXWARN_CXXFLAGS += -Wall -Wshadow 53 | #CXXWARN_CXXFLAGS += -Wundef -Wextra -Wredundant-decls 54 | CXXWARN_CXXFLAGS += -fno-common -ffunction-sections -fdata-sections 55 | CXXWARN_CXXFLAGS += -Weffc++ 56 | 57 | LDLIBS += -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group 58 | 59 | 60 | #----------------------------- 搜索工程目录下的源代码 --------------------------- 61 | 62 | AS_SRC := $(shell find ./ -name '*.s') 63 | AS_OBJ := $(AS_SRC:%.s=%.o) 64 | 65 | C_SRC := $(shell find ./ -name '*.c') 66 | C_OBJ := $(C_SRC:%.c=%.o) 67 | 68 | CXX_SRC := $(shell find ./ -name '*.cpp') 69 | CXX_OBJ := $(CXX_SRC:%.cpp=%.o) 70 | 71 | 72 | #--------------------------------- 参数整合 ------------------------------------ 73 | # C flags 74 | CFLAGS := $(OPT) $ $(CSTD) $(INC_FLAGS) $(FP_FLAGS) 75 | CFLAGS += $(DEFINES) $(ARCH_FLAGS) $(CWARN_FLAGS) -g 76 | 77 | # C++ flags 78 | CXXFLAGS := $(OPT) $ $(CSTD) $(INC_FLAGS) $(FP_FLAGS) 79 | CXXFLAGS += $(DEFINES) $(ARCH_FLAGS) $(CXXWARN_CXXFLAGS) -g 80 | 81 | # Linker flags 82 | LDFLAGS := --static 83 | LDFLAGS += -Wl,-Map=$(TARGET).map -Wl,--gc-sections 84 | LDFLAGS += -T$(LDSCRIPT) $(ARCH_FLAGS) $(LDLIBS) 85 | 86 | # OBJ 87 | OBJ = $(AS_OBJ) $(C_OBJ) $(CXX_OBJ) 88 | 89 | #-------------------------------- 编译器调用指令 -------------------------------- 90 | PREFIX := arm-none-eabi 91 | 92 | CC := $(PREFIX)-gcc 93 | CXX := $(PREFIX)-g++ 94 | LD := $(PREFIX)-gcc 95 | AR := $(PREFIX)-ar 96 | AS := $(PREFIX)-as 97 | OBJCOPY := $(PREFIX)-objcopy 98 | OBJDUMP := $(PREFIX)-objdump 99 | GDB := $(PREFIX)-gdb 100 | 101 | 102 | #----------------------------------- 编译对象 ----------------------------------- 103 | .SUFFIXES: .elf .bin .hex .list .map .images 104 | .SECONDEXPANSION: 105 | .SECONDARY: 106 | 107 | all: elf 108 | 109 | elf: $(TARGET).elf 110 | bin: $(TARGET).bin 111 | hex: $(TARGET).hex 112 | list: $(TARGET).list 113 | images: $(TARGET).images 114 | 115 | %.images: %.bin %.hex %.list %.map 116 | @printf "*** $* images generated ***\n" 117 | 118 | %.bin: %.elf 119 | @printf " OBJCOPY $(*).bin\n" 120 | $(Q)$(OBJCOPY) -Obinary $(*).elf $(*).bin 121 | 122 | %.hex: %.elf 123 | @printf " OBJCOPY $(*).hex\n" 124 | $(Q)$(OBJCOPY) -Oihex $(*).elf $(*).hex 125 | 126 | %.list: %.elf 127 | @printf " OBJDUMP $(*).list\n" 128 | $(Q)$(OBJDUMP) -S $(*).elf > $(*).list 129 | 130 | %.elf %.map: $(OBJ) $(LDSCRIPT) 131 | @printf " LD $(TARGET).elf\n" 132 | $(Q)$(LD) $(OBJ) $(LDFLAGS) -o $(TARGET).elf 133 | 134 | $(AS_OBJ): %.o:%.s 135 | @printf " AS $(*).s\n" 136 | $(Q)$(CC) $(ARCH_FLAGS) $(FP_FLAGS) -g -Wa,--no-warn -x assembler-with-cpp -o $(*).o -c $(*).s 137 | 138 | $(C_OBJ): %.o:%.c 139 | @printf " CC $(*).c\n" 140 | $(Q)$(CC) $(CFLAGS) -o $(*).o -c $(*).c 141 | 142 | $(CXX_OBJ): %.o:%.cxx 143 | @printf " CXX $(*).cpp\n" 144 | $(Q)$(CXX) $(CXXFLAGS) -o $(*).o -c $(*).cpp 145 | 146 | clean: 147 | @#printf " CLEAN\n" 148 | $(Q)$(RM) $(shell find -name '*.o' -o -name '*.d' -o -name '*.elf' -o -name '*.bin') 149 | $(Q)$(RM) $(shell find -name '*.hex' -o -name '*.srec' -o -name '*.list' -o -name '*.map') 150 | $(Q)$(RM) $(shell find -name 'generated.*' -o -name '*.srec' -o -name '*.list' -o -name '*.map') 151 | 152 | OOCD := openocd 153 | #OOCDFLAGS := -f /usr/local/share/openocd/scripts/interface/stlink-v2.cfg 154 | #OOCDFLAGS += -f /usr/local/share/openocd/scripts/target/stm32f4x.cfg 155 | OOCDFLAGS += -f openocd.cfg 156 | 157 | flash: $(TARGET).hex 158 | @printf " OPEN_OCD FLASH $<\n" 159 | $(Q)$(OOCD) $(OOCDFLAGS) -c "program $(TARGET).hex verify reset exit" 160 | 161 | debug: $(TARGET).elf 162 | @printf " GDB DEBUG $<\n" 163 | $(Q)$(GDB) -iex 'target extended | $(OOCD) $(OOCDFLAGS) -c "gdb_port pipe"' \ 164 | -iex 'monitor reset halt' -ex 'load' $(TARGET).elf 165 | 166 | .PHONY: images clean elf bin hex list flash debug 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | -------------------------------------------------------------------------------- /Src/stm32f4xx_hal_timebase_TIM.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_timebase_TIM.c 4 | * @brief HAL time base based on the hardware TIM. 5 | ****************************************************************************** 6 | * 7 | * Copyright (c) 2017 STMicroelectronics International N.V. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted, provided that the following conditions are met: 12 | * 13 | * 1. Redistribution of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of other 19 | * contributors to this software may be used to endorse or promote products 20 | * derived from this software without specific written permission. 21 | * 4. This software, including modifications and/or derivative works of this 22 | * software, must execute solely and exclusively on microcontroller or 23 | * microprocessor devices manufactured by or for STMicroelectronics. 24 | * 5. Redistribution and use of this software other than as permitted under 25 | * this license is void and will automatically terminate your rights under 26 | * this license. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 29 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 31 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 32 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 33 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 36 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 37 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 38 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 39 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | ****************************************************************************** 42 | */ 43 | 44 | /* Includes ------------------------------------------------------------------*/ 45 | #include "stm32f4xx_hal.h" 46 | #include "stm32f4xx_hal_tim.h" 47 | /** @addtogroup STM32F7xx_HAL_Examples 48 | * @{ 49 | */ 50 | 51 | /** @addtogroup HAL_TimeBase 52 | * @{ 53 | */ 54 | 55 | /* Private typedef -----------------------------------------------------------*/ 56 | /* Private define ------------------------------------------------------------*/ 57 | /* Private macro -------------------------------------------------------------*/ 58 | /* Private variables ---------------------------------------------------------*/ 59 | TIM_HandleTypeDef htim14; 60 | uint32_t uwIncrementState = 0; 61 | /* Private function prototypes -----------------------------------------------*/ 62 | /* Private functions ---------------------------------------------------------*/ 63 | 64 | /** 65 | * @brief This function configures the TIM14 as a time base source. 66 | * The time source is configured to have 1ms time base with a dedicated 67 | * Tick interrupt priority. 68 | * @note This function is called automatically at the beginning of program after 69 | * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig(). 70 | * @param TickPriority: Tick interrupt priorty. 71 | * @retval HAL status 72 | */ 73 | HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority) 74 | { 75 | RCC_ClkInitTypeDef clkconfig; 76 | uint32_t uwTimclock = 0; 77 | uint32_t uwPrescalerValue = 0; 78 | uint32_t pFLatency; 79 | 80 | /*Configure the TIM14 IRQ priority */ 81 | HAL_NVIC_SetPriority(TIM8_TRG_COM_TIM14_IRQn, TickPriority ,0); 82 | 83 | /* Enable the TIM14 global Interrupt */ 84 | HAL_NVIC_EnableIRQ(TIM8_TRG_COM_TIM14_IRQn); 85 | 86 | /* Enable TIM14 clock */ 87 | __HAL_RCC_TIM14_CLK_ENABLE(); 88 | 89 | /* Get clock configuration */ 90 | HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); 91 | 92 | /* Compute TIM14 clock */ 93 | uwTimclock = 2*HAL_RCC_GetPCLK1Freq(); 94 | 95 | /* Compute the prescaler value to have TIM14 counter clock equal to 1MHz */ 96 | uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1); 97 | 98 | /* Initialize TIM14 */ 99 | htim14.Instance = TIM14; 100 | 101 | /* Initialize TIMx peripheral as follow: 102 | + Period = [(TIM14CLK/1000) - 1]. to have a (1/1000) s time base. 103 | + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock. 104 | + ClockDivision = 0 105 | + Counter direction = Up 106 | */ 107 | htim14.Init.Period = (1000000 / 1000) - 1; 108 | htim14.Init.Prescaler = uwPrescalerValue; 109 | htim14.Init.ClockDivision = 0; 110 | htim14.Init.CounterMode = TIM_COUNTERMODE_UP; 111 | if(HAL_TIM_Base_Init(&htim14) == HAL_OK) 112 | { 113 | /* Start the TIM time Base generation in interrupt mode */ 114 | return HAL_TIM_Base_Start_IT(&htim14); 115 | } 116 | 117 | /* Return function status */ 118 | return HAL_ERROR; 119 | } 120 | 121 | /** 122 | * @brief Suspend Tick increment. 123 | * @note Disable the tick increment by disabling TIM14 update interrupt. 124 | * @param None 125 | * @retval None 126 | */ 127 | void HAL_SuspendTick(void) 128 | { 129 | /* Disable TIM14 update Interrupt */ 130 | __HAL_TIM_DISABLE_IT(&htim14, TIM_IT_UPDATE); 131 | } 132 | 133 | /** 134 | * @brief Resume Tick increment. 135 | * @note Enable the tick increment by Enabling TIM14 update interrupt. 136 | * @param None 137 | * @retval None 138 | */ 139 | void HAL_ResumeTick(void) 140 | { 141 | /* Enable TIM14 Update interrupt */ 142 | __HAL_TIM_ENABLE_IT(&htim14, TIM_IT_UPDATE); 143 | } 144 | 145 | /** 146 | * @} 147 | */ 148 | 149 | /** 150 | * @} 151 | */ 152 | 153 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 154 | -------------------------------------------------------------------------------- /STM32F429ZITx_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ***************************************************************************** 3 | ** 4 | 5 | ** File : LinkerScript.ld 6 | ** 7 | ** Abstract : Linker script for STM32F429ZITx Device with 8 | ** 2048KByte FLASH, 192KByte RAM 9 | ** 10 | ** Set heap size, stack size and stack location according 11 | ** to application requirements. 12 | ** 13 | ** Set memory bank area and size if external memory is used. 14 | ** 15 | ** Target : STMicroelectronics STM32 16 | ** 17 | ** 18 | ** Distribution: The file is distributed as is, without any warranty 19 | ** of any kind. 20 | ** 21 | ***************************************************************************** 22 | ** @attention 23 | ** 24 | **

© COPYRIGHT(c) 2014 Ac6

25 | ** 26 | ** Redistribution and use in source and binary forms, with or without modification, 27 | ** are permitted provided that the following conditions are met: 28 | ** 1. Redistributions of source code must retain the above copyright notice, 29 | ** this list of conditions and the following disclaimer. 30 | ** 2. Redistributions in binary form must reproduce the above copyright notice, 31 | ** this list of conditions and the following disclaimer in the documentation 32 | ** and/or other materials provided with the distribution. 33 | ** 3. Neither the name of Ac6 nor the names of its contributors 34 | ** may be used to endorse or promote products derived from this software 35 | ** without specific prior written permission. 36 | ** 37 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 38 | ** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 39 | ** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 40 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 41 | ** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 42 | ** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 43 | ** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 44 | ** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 45 | ** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 46 | ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | ** 48 | ***************************************************************************** 49 | */ 50 | 51 | /* Entry Point */ 52 | ENTRY(Reset_Handler) 53 | 54 | /* Highest address of the user mode stack */ 55 | _estack = 0x20030000; /* end of RAM */ 56 | /* Generate a link error if heap and stack don't fit into RAM */ 57 | _Min_Heap_Size = 0x200; /* required amount of heap */ 58 | _Min_Stack_Size = 0x400; /* required amount of stack */ 59 | 60 | /* Specify the memory areas */ 61 | MEMORY 62 | { 63 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K 64 | CCMRAM (rw) : ORIGIN = 0x10000000, LENGTH = 64K 65 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 2048K 66 | } 67 | 68 | /* Define output sections */ 69 | SECTIONS 70 | { 71 | /* The startup code goes first into FLASH */ 72 | .isr_vector : 73 | { 74 | . = ALIGN(4); 75 | KEEP(*(.isr_vector)) /* Startup code */ 76 | . = ALIGN(4); 77 | } >FLASH 78 | 79 | /* The program code and other data goes into FLASH */ 80 | .text : 81 | { 82 | . = ALIGN(4); 83 | *(.text) /* .text sections (code) */ 84 | *(.text*) /* .text* sections (code) */ 85 | *(.glue_7) /* glue arm to thumb code */ 86 | *(.glue_7t) /* glue thumb to arm code */ 87 | *(.eh_frame) 88 | 89 | KEEP (*(.init)) 90 | KEEP (*(.fini)) 91 | 92 | . = ALIGN(4); 93 | _etext = .; /* define a global symbols at end of code */ 94 | } >FLASH 95 | 96 | /* Constant data goes into FLASH */ 97 | .rodata : 98 | { 99 | . = ALIGN(4); 100 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 101 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 102 | . = ALIGN(4); 103 | } >FLASH 104 | 105 | .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH 106 | .ARM : { 107 | __exidx_start = .; 108 | *(.ARM.exidx*) 109 | __exidx_end = .; 110 | } >FLASH 111 | 112 | .preinit_array : 113 | { 114 | PROVIDE_HIDDEN (__preinit_array_start = .); 115 | KEEP (*(.preinit_array*)) 116 | PROVIDE_HIDDEN (__preinit_array_end = .); 117 | } >FLASH 118 | .init_array : 119 | { 120 | PROVIDE_HIDDEN (__init_array_start = .); 121 | KEEP (*(SORT(.init_array.*))) 122 | KEEP (*(.init_array*)) 123 | PROVIDE_HIDDEN (__init_array_end = .); 124 | } >FLASH 125 | .fini_array : 126 | { 127 | PROVIDE_HIDDEN (__fini_array_start = .); 128 | KEEP (*(SORT(.fini_array.*))) 129 | KEEP (*(.fini_array*)) 130 | PROVIDE_HIDDEN (__fini_array_end = .); 131 | } >FLASH 132 | 133 | /* used by the startup to initialize data */ 134 | _sidata = LOADADDR(.data); 135 | 136 | /* Initialized data sections goes into RAM, load LMA copy after code */ 137 | .data : 138 | { 139 | . = ALIGN(4); 140 | _sdata = .; /* create a global symbol at data start */ 141 | *(.data) /* .data sections */ 142 | *(.data*) /* .data* sections */ 143 | 144 | . = ALIGN(4); 145 | _edata = .; /* define a global symbol at data end */ 146 | } >RAM AT> FLASH 147 | 148 | _siccmram = LOADADDR(.ccmram); 149 | 150 | /* CCM-RAM section 151 | * 152 | * IMPORTANT NOTE! 153 | * If initialized variables will be placed in this section, 154 | * the startup code needs to be modified to copy the init-values. 155 | */ 156 | .ccmram : 157 | { 158 | . = ALIGN(4); 159 | _sccmram = .; /* create a global symbol at ccmram start */ 160 | *(.ccmram) 161 | *(.ccmram*) 162 | 163 | . = ALIGN(4); 164 | _eccmram = .; /* create a global symbol at ccmram end */ 165 | } >CCMRAM AT> FLASH 166 | 167 | 168 | /* Uninitialized data section */ 169 | . = ALIGN(4); 170 | .bss : 171 | { 172 | /* This is used by the startup in order to initialize the .bss secion */ 173 | _sbss = .; /* define a global symbol at bss start */ 174 | __bss_start__ = _sbss; 175 | *(.bss) 176 | *(.bss*) 177 | *(COMMON) 178 | 179 | . = ALIGN(4); 180 | _ebss = .; /* define a global symbol at bss end */ 181 | __bss_end__ = _ebss; 182 | } >RAM 183 | 184 | /* User_heap_stack section, used to check that there is enough RAM left */ 185 | ._user_heap_stack : 186 | { 187 | . = ALIGN(8); 188 | PROVIDE ( end = . ); 189 | PROVIDE ( _end = . ); 190 | . = . + _Min_Heap_Size; 191 | . = . + _Min_Stack_Size; 192 | . = ALIGN(8); 193 | } >RAM 194 | 195 | 196 | 197 | /* Remove information from the standard libraries */ 198 | /DISCARD/ : 199 | { 200 | libc.a ( * ) 201 | libm.a ( * ) 202 | libgcc.a ( * ) 203 | } 204 | 205 | .ARM.attributes 0 : { *(.ARM.attributes) } 206 | } 207 | 208 | 209 | -------------------------------------------------------------------------------- /Drivers/CMSIS/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. October 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #ifndef _ARM_COMMON_TABLES_H 42 | #define _ARM_COMMON_TABLES_H 43 | 44 | #include "arm_math.h" 45 | 46 | extern const uint16_t armBitRevTable[1024]; 47 | extern const q15_t armRecipTableQ15[64]; 48 | extern const q31_t armRecipTableQ31[64]; 49 | /* extern const q31_t realCoefAQ31[1024]; */ 50 | /* extern const q31_t realCoefBQ31[1024]; */ 51 | extern const float32_t twiddleCoef_16[32]; 52 | extern const float32_t twiddleCoef_32[64]; 53 | extern const float32_t twiddleCoef_64[128]; 54 | extern const float32_t twiddleCoef_128[256]; 55 | extern const float32_t twiddleCoef_256[512]; 56 | extern const float32_t twiddleCoef_512[1024]; 57 | extern const float32_t twiddleCoef_1024[2048]; 58 | extern const float32_t twiddleCoef_2048[4096]; 59 | extern const float32_t twiddleCoef_4096[8192]; 60 | #define twiddleCoef twiddleCoef_4096 61 | extern const q31_t twiddleCoef_16_q31[24]; 62 | extern const q31_t twiddleCoef_32_q31[48]; 63 | extern const q31_t twiddleCoef_64_q31[96]; 64 | extern const q31_t twiddleCoef_128_q31[192]; 65 | extern const q31_t twiddleCoef_256_q31[384]; 66 | extern const q31_t twiddleCoef_512_q31[768]; 67 | extern const q31_t twiddleCoef_1024_q31[1536]; 68 | extern const q31_t twiddleCoef_2048_q31[3072]; 69 | extern const q31_t twiddleCoef_4096_q31[6144]; 70 | extern const q15_t twiddleCoef_16_q15[24]; 71 | extern const q15_t twiddleCoef_32_q15[48]; 72 | extern const q15_t twiddleCoef_64_q15[96]; 73 | extern const q15_t twiddleCoef_128_q15[192]; 74 | extern const q15_t twiddleCoef_256_q15[384]; 75 | extern const q15_t twiddleCoef_512_q15[768]; 76 | extern const q15_t twiddleCoef_1024_q15[1536]; 77 | extern const q15_t twiddleCoef_2048_q15[3072]; 78 | extern const q15_t twiddleCoef_4096_q15[6144]; 79 | extern const float32_t twiddleCoef_rfft_32[32]; 80 | extern const float32_t twiddleCoef_rfft_64[64]; 81 | extern const float32_t twiddleCoef_rfft_128[128]; 82 | extern const float32_t twiddleCoef_rfft_256[256]; 83 | extern const float32_t twiddleCoef_rfft_512[512]; 84 | extern const float32_t twiddleCoef_rfft_1024[1024]; 85 | extern const float32_t twiddleCoef_rfft_2048[2048]; 86 | extern const float32_t twiddleCoef_rfft_4096[4096]; 87 | 88 | 89 | /* floating-point bit reversal tables */ 90 | #define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) 91 | #define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) 92 | #define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) 93 | #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) 94 | #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) 95 | #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) 96 | #define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) 97 | #define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) 98 | #define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) 99 | 100 | extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; 101 | extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; 102 | extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; 103 | extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; 104 | extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; 105 | extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; 106 | extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; 107 | extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; 108 | extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; 109 | 110 | /* fixed-point bit reversal tables */ 111 | #define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) 112 | #define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) 113 | #define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) 114 | #define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) 115 | #define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) 116 | #define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) 117 | #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) 118 | #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) 119 | #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) 120 | 121 | extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; 122 | extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; 123 | extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; 124 | extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; 125 | extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; 126 | extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; 127 | extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; 128 | extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; 129 | extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; 130 | 131 | /* Tables for Fast Math Sine and Cosine */ 132 | extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; 133 | extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; 134 | extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; 135 | 136 | #endif /* ARM_COMMON_TABLES_H */ 137 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_flash_ramfunc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_flash_ramfunc.c 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief FLASH RAMFUNC module driver. 8 | * This file provides a FLASH firmware functions which should be 9 | * executed from internal SRAM 10 | * + Stop/Start the flash interface while System Run 11 | * + Enable/Disable the flash sleep while System Run 12 | @verbatim 13 | ============================================================================== 14 | ##### APIs executed from Internal RAM ##### 15 | ============================================================================== 16 | [..] 17 | *** ARM Compiler *** 18 | -------------------- 19 | [..] RAM functions are defined using the toolchain options. 20 | Functions that are be executed in RAM should reside in a separate 21 | source module. Using the 'Options for File' dialog you can simply change 22 | the 'Code / Const' area of a module to a memory space in physical RAM. 23 | Available memory areas are declared in the 'Target' tab of the 24 | Options for Target' dialog. 25 | 26 | *** ICCARM Compiler *** 27 | ----------------------- 28 | [..] RAM functions are defined using a specific toolchain keyword "__ramfunc". 29 | 30 | *** GNU Compiler *** 31 | -------------------- 32 | [..] RAM functions are defined using a specific toolchain attribute 33 | "__attribute__((section(".RamFunc")))". 34 | 35 | @endverbatim 36 | ****************************************************************************** 37 | * @attention 38 | * 39 | *

© COPYRIGHT(c) 2016 STMicroelectronics

40 | * 41 | * Redistribution and use in source and binary forms, with or without modification, 42 | * are permitted provided that the following conditions are met: 43 | * 1. Redistributions of source code must retain the above copyright notice, 44 | * this list of conditions and the following disclaimer. 45 | * 2. Redistributions in binary form must reproduce the above copyright notice, 46 | * this list of conditions and the following disclaimer in the documentation 47 | * and/or other materials provided with the distribution. 48 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 49 | * may be used to endorse or promote products derived from this software 50 | * without specific prior written permission. 51 | * 52 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 53 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 54 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 55 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 56 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 57 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 58 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 59 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 60 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 61 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62 | * 63 | ****************************************************************************** 64 | */ 65 | 66 | /* Includes ------------------------------------------------------------------*/ 67 | #include "stm32f4xx_hal.h" 68 | 69 | /** @addtogroup STM32F4xx_HAL_Driver 70 | * @{ 71 | */ 72 | 73 | /** @defgroup FLASH_RAMFUNC FLASH RAMFUNC 74 | * @brief FLASH functions executed from RAM 75 | * @{ 76 | */ 77 | #ifdef HAL_FLASH_MODULE_ENABLED 78 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F411xE) || defined(STM32F446xx) || defined(STM32F412Zx) || defined(STM32F412Vx) || \ 79 | defined(STM32F412Rx) || defined(STM32F412Cx) 80 | 81 | /* Private typedef -----------------------------------------------------------*/ 82 | /* Private define ------------------------------------------------------------*/ 83 | /* Private macro -------------------------------------------------------------*/ 84 | /* Private variables ---------------------------------------------------------*/ 85 | /* Private function prototypes -----------------------------------------------*/ 86 | /* Exported functions --------------------------------------------------------*/ 87 | /** @defgroup FLASH_RAMFUNC_Exported_Functions FLASH RAMFUNC Exported Functions 88 | * @{ 89 | */ 90 | 91 | /** @defgroup FLASH_RAMFUNC_Exported_Functions_Group1 Peripheral features functions executed from internal RAM 92 | * @brief Peripheral Extended features functions 93 | * 94 | @verbatim 95 | 96 | =============================================================================== 97 | ##### ramfunc functions ##### 98 | =============================================================================== 99 | [..] 100 | This subsection provides a set of functions that should be executed from RAM 101 | transfers. 102 | 103 | @endverbatim 104 | * @{ 105 | */ 106 | 107 | /** 108 | * @brief Stop the flash interface while System Run 109 | * @note This mode is only available for STM32F41xxx/STM32F446xx devices. 110 | * @note This mode couldn't be set while executing with the flash itself. 111 | * It should be done with specific routine executed from RAM. 112 | * @retval None 113 | */ 114 | __RAM_FUNC HAL_FLASHEx_StopFlashInterfaceClk(void) 115 | { 116 | /* Enable Power ctrl clock */ 117 | __HAL_RCC_PWR_CLK_ENABLE(); 118 | /* Stop the flash interface while System Run */ 119 | SET_BIT(PWR->CR, PWR_CR_FISSR); 120 | 121 | return HAL_OK; 122 | } 123 | 124 | /** 125 | * @brief Start the flash interface while System Run 126 | * @note This mode is only available for STM32F411xx/STM32F446xx devices. 127 | * @note This mode couldn't be set while executing with the flash itself. 128 | * It should be done with specific routine executed from RAM. 129 | * @retval None 130 | */ 131 | __RAM_FUNC HAL_FLASHEx_StartFlashInterfaceClk(void) 132 | { 133 | /* Enable Power ctrl clock */ 134 | __HAL_RCC_PWR_CLK_ENABLE(); 135 | /* Start the flash interface while System Run */ 136 | CLEAR_BIT(PWR->CR, PWR_CR_FISSR); 137 | 138 | return HAL_OK; 139 | } 140 | 141 | /** 142 | * @brief Enable the flash sleep while System Run 143 | * @note This mode is only available for STM32F41xxx/STM32F446xx devices. 144 | * @note This mode could n't be set while executing with the flash itself. 145 | * It should be done with specific routine executed from RAM. 146 | * @retval None 147 | */ 148 | __RAM_FUNC HAL_FLASHEx_EnableFlashSleepMode(void) 149 | { 150 | /* Enable Power ctrl clock */ 151 | __HAL_RCC_PWR_CLK_ENABLE(); 152 | /* Enable the flash sleep while System Run */ 153 | SET_BIT(PWR->CR, PWR_CR_FMSSR); 154 | 155 | return HAL_OK; 156 | } 157 | 158 | /** 159 | * @brief Disable the flash sleep while System Run 160 | * @note This mode is only available for STM32F41xxx/STM32F446xx devices. 161 | * @note This mode couldn't be set while executing with the flash itself. 162 | * It should be done with specific routine executed from RAM. 163 | * @retval None 164 | */ 165 | __RAM_FUNC HAL_FLASHEx_DisableFlashSleepMode(void) 166 | { 167 | /* Enable Power ctrl clock */ 168 | __HAL_RCC_PWR_CLK_ENABLE(); 169 | /* Disable the flash sleep while System Run */ 170 | CLEAR_BIT(PWR->CR, PWR_CR_FMSSR); 171 | 172 | return HAL_OK; 173 | } 174 | 175 | /** 176 | * @} 177 | */ 178 | 179 | /** 180 | * @} 181 | */ 182 | 183 | #endif /* STM32F410xx || STM32F411xE || STM32F446xx || STM32F412Zx || STM32F412Vx || STM32F412Rx || STM32F412Cx */ 184 | #endif /* HAL_FLASH_MODULE_ENABLED */ 185 | /** 186 | * @} 187 | */ 188 | 189 | /** 190 | * @} 191 | */ 192 | 193 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 194 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | #ifndef PROJDEFS_H 71 | #define PROJDEFS_H 72 | 73 | /* 74 | * Defines the prototype to which task functions must conform. Defined in this 75 | * file to ensure the type is known before portable.h is included. 76 | */ 77 | typedef void (*TaskFunction_t)( void * ); 78 | 79 | /* Converts a time in milliseconds to a time in ticks. */ 80 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) 81 | 82 | #define pdFALSE ( ( BaseType_t ) 0 ) 83 | #define pdTRUE ( ( BaseType_t ) 1 ) 84 | 85 | #define pdPASS ( pdTRUE ) 86 | #define pdFAIL ( pdFALSE ) 87 | #define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) 88 | #define errQUEUE_FULL ( ( BaseType_t ) 0 ) 89 | 90 | /* FreeRTOS error definitions. */ 91 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 92 | #define errQUEUE_BLOCKED ( -4 ) 93 | #define errQUEUE_YIELD ( -5 ) 94 | 95 | /* Macros used for basic data corruption checks. */ 96 | #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 97 | #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 98 | #endif 99 | 100 | #if( configUSE_16_BIT_TICKS == 1 ) 101 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a 102 | #else 103 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL 104 | #endif 105 | 106 | /* The following errno values are used by FreeRTOS+ components, not FreeRTOS 107 | itself. */ 108 | #define pdFREERTOS_ERRNO_NONE 0 /* No errors */ 109 | #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ 110 | #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ 111 | #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ 112 | #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ 113 | #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ 114 | #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ 115 | #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ 116 | #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ 117 | #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ 118 | #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ 119 | #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ 120 | #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ 121 | #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ 122 | #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ 123 | #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ 124 | #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ 125 | #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ 126 | #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ 127 | #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ 128 | #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ 129 | #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ 130 | #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */ 131 | #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ 132 | #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ 133 | #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ 134 | #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ 135 | #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ 136 | #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ 137 | #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ 138 | #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */ 139 | #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */ 140 | #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ 141 | #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */ 142 | #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */ 143 | #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */ 144 | #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */ 145 | #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */ 146 | #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */ 147 | 148 | /* The following endian values are used by FreeRTOS+ components, not FreeRTOS 149 | itself. */ 150 | #define pdFREERTOS_LITTLE_ENDIAN 0 151 | #define pdFREERTOS_BIG_ENDIAN 1 152 | 153 | #endif /* PROJDEFS_H */ 154 | 155 | 156 | 157 | -------------------------------------------------------------------------------- /Inc/FreeRTOSConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | #ifndef FREERTOS_CONFIG_H 71 | #define FREERTOS_CONFIG_H 72 | 73 | /*----------------------------------------------------------- 74 | * Application specific definitions. 75 | * 76 | * These definitions should be adjusted for your particular hardware and 77 | * application requirements. 78 | * 79 | * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 80 | * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 81 | * 82 | * See http://www.freertos.org/a00110.html. 83 | *----------------------------------------------------------*/ 84 | 85 | /* USER CODE BEGIN Includes */ 86 | /* Section where include file can be added */ 87 | /* USER CODE END Includes */ 88 | 89 | /* Ensure stdint is only used by the compiler, and not the assembler. */ 90 | #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) 91 | #include 92 | #include "main.h" 93 | extern uint32_t SystemCoreClock; 94 | #endif 95 | 96 | #define configUSE_PREEMPTION 1 97 | #define configUSE_IDLE_HOOK 0 98 | #define configUSE_TICK_HOOK 0 99 | #define configCPU_CLOCK_HZ ( SystemCoreClock ) 100 | #define configTICK_RATE_HZ ((TickType_t)1000) 101 | #define configMAX_PRIORITIES ( 7 ) 102 | #define configMINIMAL_STACK_SIZE ((uint16_t)128) 103 | #define configTOTAL_HEAP_SIZE ((size_t)15360) 104 | #define configMAX_TASK_NAME_LEN ( 16 ) 105 | #define configUSE_TRACE_FACILITY 1 106 | #define configUSE_16_BIT_TICKS 0 107 | #define configUSE_MUTEXES 1 108 | #define configQUEUE_REGISTRY_SIZE 8 109 | 110 | /* Co-routine definitions. */ 111 | #define configUSE_CO_ROUTINES 0 112 | #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) 113 | 114 | /* Set the following definitions to 1 to include the API function, or zero 115 | to exclude the API function. */ 116 | #define INCLUDE_vTaskPrioritySet 1 117 | #define INCLUDE_uxTaskPriorityGet 1 118 | #define INCLUDE_vTaskDelete 1 119 | #define INCLUDE_vTaskCleanUpResources 0 120 | #define INCLUDE_vTaskSuspend 1 121 | #define INCLUDE_vTaskDelayUntil 0 122 | #define INCLUDE_vTaskDelay 1 123 | #define INCLUDE_xTaskGetSchedulerState 1 124 | 125 | /* Cortex-M specific definitions. */ 126 | #ifdef __NVIC_PRIO_BITS 127 | /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ 128 | #define configPRIO_BITS __NVIC_PRIO_BITS 129 | #else 130 | #define configPRIO_BITS 4 131 | #endif 132 | 133 | /* The lowest interrupt priority that can be used in a call to a "set priority" 134 | function. */ 135 | #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15 136 | 137 | /* The highest interrupt priority that can be used by any interrupt service 138 | routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL 139 | INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER 140 | PRIORITY THAN THIS! (higher priorities are lower numeric values. */ 141 | #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 142 | 143 | /* Interrupt priorities used by the kernel port layer itself. These are generic 144 | to all Cortex-M ports, and do not rely on any particular library functions. */ 145 | #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) 146 | /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! 147 | See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ 148 | #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) 149 | 150 | /* Normal assert() semantics without relying on the provision of an assert.h 151 | header file. */ 152 | /* USER CODE BEGIN 1 */ 153 | #define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );} 154 | /* USER CODE END 1 */ 155 | 156 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS 157 | standard names. */ 158 | #define vPortSVCHandler SVC_Handler 159 | #define xPortPendSVHandler PendSV_Handler 160 | 161 | /* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, 162 | to prevent overwriting SysTick_Handler defined within STM32Cube HAL */ 163 | /* #define xPortSysTickHandler SysTick_Handler */ 164 | 165 | /* USER CODE BEGIN Defines */ 166 | /* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */ 167 | /* USER CODE END Defines */ 168 | 169 | #endif /* FREERTOS_CONFIG_H */ 170 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOSConfig_template.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | 71 | #ifndef FREERTOS_CONFIG_H 72 | #define FREERTOS_CONFIG_H 73 | 74 | /*----------------------------------------------------------- 75 | * Application specific definitions. 76 | * 77 | * These definitions should be adjusted for your particular hardware and 78 | * application requirements. 79 | * 80 | * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE 81 | * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. 82 | * 83 | * See http://www.freertos.org/a00110.html. 84 | *----------------------------------------------------------*/ 85 | 86 | /* Ensure stdint is only used by the compiler, and not the assembler. */ 87 | #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__) 88 | #include 89 | extern uint32_t SystemCoreClock; 90 | #endif 91 | 92 | #define configUSE_PREEMPTION 1 93 | #define configUSE_IDLE_HOOK 0 94 | #define configUSE_TICK_HOOK 0 95 | #define configCPU_CLOCK_HZ (SystemCoreClock) 96 | #define configTICK_RATE_HZ ((TickType_t)1000) 97 | #define configMAX_PRIORITIES (7) 98 | #define configMINIMAL_STACK_SIZE ((uint16_t)128) 99 | #define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024)) 100 | #define configMAX_TASK_NAME_LEN (16) 101 | #define configUSE_TRACE_FACILITY 1 102 | #define configUSE_16_BIT_TICKS 0 103 | #define configIDLE_SHOULD_YIELD 1 104 | #define configUSE_MUTEXES 1 105 | #define configQUEUE_REGISTRY_SIZE 8 106 | #define configCHECK_FOR_STACK_OVERFLOW 0 107 | #define configUSE_RECURSIVE_MUTEXES 1 108 | #define configUSE_MALLOC_FAILED_HOOK 0 109 | #define configUSE_APPLICATION_TASK_TAG 0 110 | #define configUSE_COUNTING_SEMAPHORES 1 111 | #define configGENERATE_RUN_TIME_STATS 0 112 | 113 | /* Co-routine definitions. */ 114 | #define configUSE_CO_ROUTINES 0 115 | #define configMAX_CO_ROUTINE_PRIORITIES (2) 116 | 117 | /* Software timer definitions. */ 118 | #define configUSE_TIMERS 0 119 | #define configTIMER_TASK_PRIORITY (2) 120 | #define configTIMER_QUEUE_LENGTH 10 121 | #define configTIMER_TASK_STACK_DEPTH (configMINIMAL_STACK_SIZE * 2) 122 | 123 | /* Set the following definitions to 1 to include the API function, or zero 124 | to exclude the API function. */ 125 | #define INCLUDE_vTaskPrioritySet 1 126 | #define INCLUDE_uxTaskPriorityGet 1 127 | #define INCLUDE_vTaskDelete 1 128 | #define INCLUDE_vTaskCleanUpResources 0 129 | #define INCLUDE_vTaskSuspend 1 130 | #define INCLUDE_vTaskDelayUntil 0 131 | #define INCLUDE_vTaskDelay 1 132 | #define INCLUDE_xTaskGetSchedulerState 1 133 | 134 | /* Cortex-M specific definitions. */ 135 | #ifdef __NVIC_PRIO_BITS 136 | /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */ 137 | #define configPRIO_BITS __NVIC_PRIO_BITS 138 | #else 139 | #define configPRIO_BITS 4 /* 15 priority levels */ 140 | #endif 141 | 142 | /* The lowest interrupt priority that can be used in a call to a "set priority" 143 | function. */ 144 | #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0xf 145 | 146 | /* The highest interrupt priority that can be used by any interrupt service 147 | routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL 148 | INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER 149 | PRIORITY THAN THIS! (higher priorities are lower numeric values. */ 150 | #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5 151 | 152 | /* Interrupt priorities used by the kernel port layer itself. These are generic 153 | to all Cortex-M ports, and do not rely on any particular library functions. */ 154 | #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) 155 | /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!! 156 | See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */ 157 | #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) ) 158 | 159 | /* Normal assert() semantics without relying on the provision of an assert.h 160 | header file. */ 161 | #define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } 162 | 163 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS 164 | standard names. */ 165 | #define vPortSVCHandler SVC_Handler 166 | #define xPortPendSVHandler PendSV_Handler 167 | 168 | /* IMPORTANT: This define MUST be commented when used with STM32Cube firmware, 169 | to prevent overwriting SysTick_Handler defined within STM32Cube HAL */ 170 | /* #define xPortSysTickHandler SysTick_Handler */ 171 | 172 | #endif /* FREERTOS_CONFIG_H */ 173 | 174 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | #ifndef STACK_MACROS_H 71 | #define STACK_MACROS_H 72 | 73 | /* 74 | * Call the stack overflow hook function if the stack of the task being swapped 75 | * out is currently overflowed, or looks like it might have overflowed in the 76 | * past. 77 | * 78 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check 79 | * the current stack state only - comparing the current top of stack value to 80 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 81 | * will also cause the last few stack bytes to be checked to ensure the value 82 | * to which the bytes were set when the task was created have not been 83 | * overwritten. Note this second test does not guarantee that an overflowed 84 | * stack will always be recognised. 85 | */ 86 | 87 | /*-----------------------------------------------------------*/ 88 | 89 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 90 | 91 | /* Only the current stack state is to be checked. */ 92 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 93 | { \ 94 | /* Is the currently saved stack pointer within the stack limit? */ \ 95 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 96 | { \ 97 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 98 | } \ 99 | } 100 | 101 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 102 | /*-----------------------------------------------------------*/ 103 | 104 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 105 | 106 | /* Only the current stack state is to be checked. */ 107 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 108 | { \ 109 | \ 110 | /* Is the currently saved stack pointer within the stack limit? */ \ 111 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 112 | { \ 113 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 114 | } \ 115 | } 116 | 117 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 118 | /*-----------------------------------------------------------*/ 119 | 120 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 121 | 122 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 123 | { \ 124 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 125 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 126 | \ 127 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ 128 | ( pulStack[ 1 ] != ulCheckValue ) || \ 129 | ( pulStack[ 2 ] != ulCheckValue ) || \ 130 | ( pulStack[ 3 ] != ulCheckValue ) ) \ 131 | { \ 132 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 133 | } \ 134 | } 135 | 136 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 137 | /*-----------------------------------------------------------*/ 138 | 139 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 140 | 141 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 142 | { \ 143 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 144 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 145 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 146 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 147 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 148 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 149 | \ 150 | \ 151 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 152 | \ 153 | /* Has the extremity of the task stack ever been written over? */ \ 154 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 155 | { \ 156 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 157 | } \ 158 | } 159 | 160 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 161 | /*-----------------------------------------------------------*/ 162 | 163 | /* Remove stack overflow macro if not being used. */ 164 | #ifndef taskCHECK_FOR_STACK_OVERFLOW 165 | #define taskCHECK_FOR_STACK_OVERFLOW() 166 | #endif 167 | 168 | 169 | 170 | #endif /* STACK_MACROS_H */ 171 | 172 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal_def.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_def.h 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief This file contains HAL common defines, enumeration, macros and 8 | * structures definitions. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT(c) 2016 STMicroelectronics

13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ****************************************************************************** 37 | */ 38 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ 40 | #ifndef __STM32F4xx_HAL_DEF 41 | #define __STM32F4xx_HAL_DEF 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* Includes ------------------------------------------------------------------*/ 48 | #include "stm32f4xx.h" 49 | #include "Legacy/stm32_hal_legacy.h" 50 | #include 51 | 52 | /* Exported types ------------------------------------------------------------*/ 53 | 54 | /** 55 | * @brief HAL Status structures definition 56 | */ 57 | typedef enum 58 | { 59 | HAL_OK = 0x00U, 60 | HAL_ERROR = 0x01U, 61 | HAL_BUSY = 0x02U, 62 | HAL_TIMEOUT = 0x03U 63 | } HAL_StatusTypeDef; 64 | 65 | /** 66 | * @brief HAL Lock structures definition 67 | */ 68 | typedef enum 69 | { 70 | HAL_UNLOCKED = 0x00U, 71 | HAL_LOCKED = 0x01U 72 | } HAL_LockTypeDef; 73 | 74 | /* Exported macro ------------------------------------------------------------*/ 75 | #define HAL_MAX_DELAY 0xFFFFFFFFU 76 | 77 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != RESET) 78 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == RESET) 79 | 80 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \ 81 | do{ \ 82 | (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \ 83 | (__DMA_HANDLE__).Parent = (__HANDLE__); \ 84 | } while(0) 85 | 86 | #define UNUSED(x) ((void)(x)) 87 | 88 | /** @brief Reset the Handle's State field. 89 | * @param __HANDLE__: specifies the Peripheral Handle. 90 | * @note This macro can be used for the following purpose: 91 | * - When the Handle is declared as local variable; before passing it as parameter 92 | * to HAL_PPP_Init() for the first time, it is mandatory to use this macro 93 | * to set to 0 the Handle's "State" field. 94 | * Otherwise, "State" field may have any random value and the first time the function 95 | * HAL_PPP_Init() is called, the low level hardware initialization will be missed 96 | * (i.e. HAL_PPP_MspInit() will not be executed). 97 | * - When there is a need to reconfigure the low level hardware: instead of calling 98 | * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). 99 | * In this later function, when the Handle's "State" field is set to 0, it will execute the function 100 | * HAL_PPP_MspInit() which will reconfigure the low level hardware. 101 | * @retval None 102 | */ 103 | #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) 104 | 105 | #if (USE_RTOS == 1) 106 | /* Reserved for future use */ 107 | #error "USE_RTOS should be 0 in the current HAL release" 108 | #else 109 | #define __HAL_LOCK(__HANDLE__) \ 110 | do{ \ 111 | if((__HANDLE__)->Lock == HAL_LOCKED) \ 112 | { \ 113 | return HAL_BUSY; \ 114 | } \ 115 | else \ 116 | { \ 117 | (__HANDLE__)->Lock = HAL_LOCKED; \ 118 | } \ 119 | }while (0) 120 | 121 | #define __HAL_UNLOCK(__HANDLE__) \ 122 | do{ \ 123 | (__HANDLE__)->Lock = HAL_UNLOCKED; \ 124 | }while (0) 125 | #endif /* USE_RTOS */ 126 | 127 | #if defined ( __GNUC__ ) 128 | #ifndef __weak 129 | #define __weak __attribute__((weak)) 130 | #endif /* __weak */ 131 | #ifndef __packed 132 | #define __packed __attribute__((__packed__)) 133 | #endif /* __packed */ 134 | #endif /* __GNUC__ */ 135 | 136 | 137 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ 138 | #if defined (__GNUC__) /* GNU Compiler */ 139 | #ifndef __ALIGN_END 140 | #define __ALIGN_END __attribute__ ((aligned (4))) 141 | #endif /* __ALIGN_END */ 142 | #ifndef __ALIGN_BEGIN 143 | #define __ALIGN_BEGIN 144 | #endif /* __ALIGN_BEGIN */ 145 | #else 146 | #ifndef __ALIGN_END 147 | #define __ALIGN_END 148 | #endif /* __ALIGN_END */ 149 | #ifndef __ALIGN_BEGIN 150 | #if defined (__CC_ARM) /* ARM Compiler */ 151 | #define __ALIGN_BEGIN __align(4) 152 | #elif defined (__ICCARM__) /* IAR Compiler */ 153 | #define __ALIGN_BEGIN 154 | #endif /* __CC_ARM */ 155 | #endif /* __ALIGN_BEGIN */ 156 | #endif /* __GNUC__ */ 157 | 158 | 159 | /** 160 | * @brief __RAM_FUNC definition 161 | */ 162 | #if defined ( __CC_ARM ) 163 | /* ARM Compiler 164 | ------------ 165 | RAM functions are defined using the toolchain options. 166 | Functions that are executed in RAM should reside in a separate source module. 167 | Using the 'Options for File' dialog you can simply change the 'Code / Const' 168 | area of a module to a memory space in physical RAM. 169 | Available memory areas are declared in the 'Target' tab of the 'Options for Target' 170 | dialog. 171 | */ 172 | #define __RAM_FUNC HAL_StatusTypeDef 173 | 174 | #elif defined ( __ICCARM__ ) 175 | /* ICCARM Compiler 176 | --------------- 177 | RAM functions are defined using a specific toolchain keyword "__ramfunc". 178 | */ 179 | #define __RAM_FUNC __ramfunc HAL_StatusTypeDef 180 | 181 | #elif defined ( __GNUC__ ) 182 | /* GNU Compiler 183 | ------------ 184 | RAM functions are defined using a specific toolchain attribute 185 | "__attribute__((section(".RamFunc")))". 186 | */ 187 | #define __RAM_FUNC HAL_StatusTypeDef __attribute__((section(".RamFunc"))) 188 | 189 | #endif 190 | 191 | /** 192 | * @brief __NOINLINE definition 193 | */ 194 | #if defined ( __CC_ARM ) || defined ( __GNUC__ ) 195 | /* ARM & GNUCompiler 196 | ---------------- 197 | */ 198 | #define __NOINLINE __attribute__ ( (noinline) ) 199 | 200 | #elif defined ( __ICCARM__ ) 201 | /* ICCARM Compiler 202 | --------------- 203 | */ 204 | #define __NOINLINE _Pragma("optimize = no_inline") 205 | 206 | #endif 207 | 208 | #ifdef __cplusplus 209 | } 210 | #endif 211 | 212 | #endif /* ___STM32F4xx_HAL_DEF */ 213 | 214 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 215 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | #ifndef MPU_WRAPPERS_H 71 | #define MPU_WRAPPERS_H 72 | 73 | /* This file redefines API functions to be called through a wrapper macro, but 74 | only for ports that are using the MPU. */ 75 | #ifdef portUSING_MPU_WRAPPERS 76 | 77 | /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is 78 | included from queue.c or task.c to prevent it from having an effect within 79 | those files. */ 80 | #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE 81 | 82 | #define xTaskGenericCreate MPU_xTaskGenericCreate 83 | #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions 84 | #define vTaskDelete MPU_vTaskDelete 85 | #define vTaskDelayUntil MPU_vTaskDelayUntil 86 | #define vTaskDelay MPU_vTaskDelay 87 | #define uxTaskPriorityGet MPU_uxTaskPriorityGet 88 | #define vTaskPrioritySet MPU_vTaskPrioritySet 89 | #define eTaskGetState MPU_eTaskGetState 90 | #define vTaskSuspend MPU_vTaskSuspend 91 | #define vTaskResume MPU_vTaskResume 92 | #define vTaskSuspendAll MPU_vTaskSuspendAll 93 | #define xTaskResumeAll MPU_xTaskResumeAll 94 | #define xTaskGetTickCount MPU_xTaskGetTickCount 95 | #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks 96 | #define vTaskList MPU_vTaskList 97 | #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats 98 | #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag 99 | #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag 100 | #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook 101 | #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark 102 | #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle 103 | #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState 104 | #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle 105 | #define uxTaskGetSystemState MPU_uxTaskGetSystemState 106 | #define xTaskGenericNotify MPU_xTaskGenericNotify 107 | #define xTaskNotifyWait MPU_xTaskNotifyWait 108 | #define ulTaskNotifyTake MPU_ulTaskNotifyTake 109 | 110 | #define xQueueGenericCreate MPU_xQueueGenericCreate 111 | #define xQueueCreateMutex MPU_xQueueCreateMutex 112 | #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive 113 | #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive 114 | #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore 115 | #define xQueueGenericSend MPU_xQueueGenericSend 116 | #define xQueueAltGenericSend MPU_xQueueAltGenericSend 117 | #define xQueueAltGenericReceive MPU_xQueueAltGenericReceive 118 | #define xQueueGenericReceive MPU_xQueueGenericReceive 119 | #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting 120 | #define vQueueDelete MPU_vQueueDelete 121 | #define xQueueGenericReset MPU_xQueueGenericReset 122 | #define xQueueCreateSet MPU_xQueueCreateSet 123 | #define xQueueSelectFromSet MPU_xQueueSelectFromSet 124 | #define xQueueAddToSet MPU_xQueueAddToSet 125 | #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet 126 | #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder 127 | #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder 128 | 129 | #define pvPortMalloc MPU_pvPortMalloc 130 | #define vPortFree MPU_vPortFree 131 | #define xPortGetFreeHeapSize MPU_xPortGetFreeHeapSize 132 | #define vPortInitialiseBlocks MPU_vPortInitialiseBlocks 133 | #define xPortGetMinimumEverFreeHeapSize MPU_xPortGetMinimumEverFreeHeapSize 134 | 135 | #if configQUEUE_REGISTRY_SIZE > 0 136 | #define vQueueAddToRegistry MPU_vQueueAddToRegistry 137 | #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue 138 | #endif 139 | 140 | #define xTimerCreate MPU_xTimerCreate 141 | #define pvTimerGetTimerID MPU_pvTimerGetTimerID 142 | #define vTimerSetTimerID MPU_vTimerSetTimerID 143 | #define xTimerIsTimerActive MPU_xTimerIsTimerActive 144 | #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle 145 | #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall 146 | #define pcTimerGetTimerName MPU_pcTimerGetTimerName 147 | #define xTimerGenericCommand MPU_xTimerGenericCommand 148 | 149 | #define xEventGroupCreate MPU_xEventGroupCreate 150 | #define xEventGroupWaitBits MPU_xEventGroupWaitBits 151 | #define xEventGroupClearBits MPU_xEventGroupClearBits 152 | #define xEventGroupSetBits MPU_xEventGroupSetBits 153 | #define xEventGroupSync MPU_xEventGroupSync 154 | #define vEventGroupDelete MPU_vEventGroupDelete 155 | 156 | /* Remove the privileged function macro. */ 157 | #define PRIVILEGED_FUNCTION 158 | 159 | #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ 160 | 161 | /* Ensure API functions go in the privileged execution section. */ 162 | #define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions"))) 163 | #define PRIVILEGED_DATA __attribute__((section("privileged_data"))) 164 | 165 | #endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */ 166 | 167 | #else /* portUSING_MPU_WRAPPERS */ 168 | 169 | #define PRIVILEGED_FUNCTION 170 | #define PRIVILEGED_DATA 171 | #define portUSING_MPU_WRAPPERS 0 172 | 173 | #endif /* portUSING_MPU_WRAPPERS */ 174 | 175 | 176 | #endif /* MPU_WRAPPERS_H */ 177 | 178 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/portable.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | /*----------------------------------------------------------- 71 | * Portable layer API. Each function must be defined for each port. 72 | *----------------------------------------------------------*/ 73 | 74 | #ifndef PORTABLE_H 75 | #define PORTABLE_H 76 | 77 | /* Each FreeRTOS port has a unique portmacro.h header file. Originally a 78 | pre-processor definition was used to ensure the pre-processor found the correct 79 | portmacro.h file for the port being used. That scheme was deprecated in favour 80 | of setting the compiler's include path such that it found the correct 81 | portmacro.h file - removing the need for the constant and allowing the 82 | portmacro.h file to be located anywhere in relation to the port being used. 83 | Purely for reasons of backward compatibility the old method is still valid, but 84 | to make it clear that new projects should not use it, support for the port 85 | specific constants has been moved into the deprecated_definitions.h header 86 | file. */ 87 | #include "deprecated_definitions.h" 88 | 89 | /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h 90 | did not result in a portmacro.h header file being included - and it should be 91 | included here. In this case the path to the correct portmacro.h header file 92 | must be set in the compiler's include path. */ 93 | #ifndef portENTER_CRITICAL 94 | #include "portmacro.h" 95 | #endif 96 | 97 | #if portBYTE_ALIGNMENT == 32 98 | #define portBYTE_ALIGNMENT_MASK ( 0x001f ) 99 | #endif 100 | 101 | #if portBYTE_ALIGNMENT == 16 102 | #define portBYTE_ALIGNMENT_MASK ( 0x000f ) 103 | #endif 104 | 105 | #if portBYTE_ALIGNMENT == 8 106 | #define portBYTE_ALIGNMENT_MASK ( 0x0007 ) 107 | #endif 108 | 109 | #if portBYTE_ALIGNMENT == 4 110 | #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) 111 | #endif 112 | 113 | #if portBYTE_ALIGNMENT == 2 114 | #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) 115 | #endif 116 | 117 | #if portBYTE_ALIGNMENT == 1 118 | #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) 119 | #endif 120 | 121 | #ifndef portBYTE_ALIGNMENT_MASK 122 | #error "Invalid portBYTE_ALIGNMENT definition" 123 | #endif 124 | 125 | #ifndef portNUM_CONFIGURABLE_REGIONS 126 | #define portNUM_CONFIGURABLE_REGIONS 1 127 | #endif 128 | 129 | #ifdef __cplusplus 130 | extern "C" { 131 | #endif 132 | 133 | #include "mpu_wrappers.h" 134 | 135 | /* 136 | * Setup the stack of a new task so it is ready to be placed under the 137 | * scheduler control. The registers have to be placed on the stack in 138 | * the order that the port expects to find them. 139 | * 140 | */ 141 | #if( portUSING_MPU_WRAPPERS == 1 ) 142 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION; 143 | #else 144 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION; 145 | #endif 146 | 147 | /* Used by heap_5.c. */ 148 | typedef struct HeapRegion 149 | { 150 | uint8_t *pucStartAddress; 151 | size_t xSizeInBytes; 152 | } HeapRegion_t; 153 | 154 | /* 155 | * Used to define multiple heap regions for use by heap_5.c. This function 156 | * must be called before any calls to pvPortMalloc() - not creating a task, 157 | * queue, semaphore, mutex, software timer, event group, etc. will result in 158 | * pvPortMalloc being called. 159 | * 160 | * pxHeapRegions passes in an array of HeapRegion_t structures - each of which 161 | * defines a region of memory that can be used as the heap. The array is 162 | * terminated by a HeapRegions_t structure that has a size of 0. The region 163 | * with the lowest start address must appear first in the array. 164 | */ 165 | void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION; 166 | 167 | 168 | /* 169 | * Map to the memory management routines required for the port. 170 | */ 171 | void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION; 172 | void vPortFree( void *pv ) PRIVILEGED_FUNCTION; 173 | void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION; 174 | size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION; 175 | size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION; 176 | 177 | /* 178 | * Setup the hardware ready for the scheduler to take control. This generally 179 | * sets up a tick interrupt and sets timers for the correct tick frequency. 180 | */ 181 | BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION; 182 | 183 | /* 184 | * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so 185 | * the hardware is left in its original condition after the scheduler stops 186 | * executing. 187 | */ 188 | void vPortEndScheduler( void ) PRIVILEGED_FUNCTION; 189 | 190 | /* 191 | * The structures and methods of manipulating the MPU are contained within the 192 | * port layer. 193 | * 194 | * Fills the xMPUSettings structure with the memory region information 195 | * contained in xRegions. 196 | */ 197 | #if( portUSING_MPU_WRAPPERS == 1 ) 198 | struct xMEMORY_REGION; 199 | void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint16_t usStackDepth ) PRIVILEGED_FUNCTION; 200 | #endif 201 | 202 | #ifdef __cplusplus 203 | } 204 | #endif 205 | 206 | #endif /* PORTABLE_H */ 207 | 208 | -------------------------------------------------------------------------------- /Inc/main.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * File Name : main.h 4 | * Description : This file contains the common defines of the application 5 | ****************************************************************************** 6 | * 7 | * Copyright (c) 2017 STMicroelectronics International N.V. 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted, provided that the following conditions are met: 12 | * 13 | * 1. Redistribution of source code must retain the above copyright notice, 14 | * this list of conditions and the following disclaimer. 15 | * 2. Redistributions in binary form must reproduce the above copyright notice, 16 | * this list of conditions and the following disclaimer in the documentation 17 | * and/or other materials provided with the distribution. 18 | * 3. Neither the name of STMicroelectronics nor the names of other 19 | * contributors to this software may be used to endorse or promote products 20 | * derived from this software without specific written permission. 21 | * 4. This software, including modifications and/or derivative works of this 22 | * software, must execute solely and exclusively on microcontroller or 23 | * microprocessor devices manufactured by or for STMicroelectronics. 24 | * 5. Redistribution and use of this software other than as permitted under 25 | * this license is void and will automatically terminate your rights under 26 | * this license. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY STMICROELECTRONICS AND CONTRIBUTORS "AS IS" 29 | * AND ANY EXPRESS, IMPLIED OR STATUTORY WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 31 | * PARTICULAR PURPOSE AND NON-INFRINGEMENT OF THIRD PARTY INTELLECTUAL PROPERTY 32 | * RIGHTS ARE DISCLAIMED TO THE FULLEST EXTENT PERMITTED BY LAW. IN NO EVENT 33 | * SHALL STMICROELECTRONICS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 35 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 36 | * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 37 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 38 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 39 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 40 | * 41 | ****************************************************************************** 42 | */ 43 | /* Define to prevent recursive inclusion -------------------------------------*/ 44 | #ifndef __MAIN_H 45 | #define __MAIN_H 46 | /* Includes ------------------------------------------------------------------*/ 47 | 48 | /* USER CODE BEGIN Includes */ 49 | 50 | /* USER CODE END Includes */ 51 | 52 | /* Private define ------------------------------------------------------------*/ 53 | 54 | #define PC14_OSC32_IN_Pin GPIO_PIN_14 55 | #define PC14_OSC32_IN_GPIO_Port GPIOC 56 | #define PC15_OSC32_OUT_Pin GPIO_PIN_15 57 | #define PC15_OSC32_OUT_GPIO_Port GPIOC 58 | #define A0_Pin GPIO_PIN_0 59 | #define A0_GPIO_Port GPIOF 60 | #define A1_Pin GPIO_PIN_1 61 | #define A1_GPIO_Port GPIOF 62 | #define A2_Pin GPIO_PIN_2 63 | #define A2_GPIO_Port GPIOF 64 | #define A3_Pin GPIO_PIN_3 65 | #define A3_GPIO_Port GPIOF 66 | #define A4_Pin GPIO_PIN_4 67 | #define A4_GPIO_Port GPIOF 68 | #define A5_Pin GPIO_PIN_5 69 | #define A5_GPIO_Port GPIOF 70 | #define SPI5_SCK_Pin GPIO_PIN_7 71 | #define SPI5_SCK_GPIO_Port GPIOF 72 | #define SPI5_MISO_Pin GPIO_PIN_8 73 | #define SPI5_MISO_GPIO_Port GPIOF 74 | #define SPI5_MOSI_Pin GPIO_PIN_9 75 | #define SPI5_MOSI_GPIO_Port GPIOF 76 | #define ENABLE_Pin GPIO_PIN_10 77 | #define ENABLE_GPIO_Port GPIOF 78 | #define PH0_OSC_IN_Pin GPIO_PIN_0 79 | #define PH0_OSC_IN_GPIO_Port GPIOH 80 | #define PH1_OSC_OUT_Pin GPIO_PIN_1 81 | #define PH1_OSC_OUT_GPIO_Port GPIOH 82 | #define SDNWE_Pin GPIO_PIN_0 83 | #define SDNWE_GPIO_Port GPIOC 84 | #define NCS_MEMS_SPI_Pin GPIO_PIN_1 85 | #define NCS_MEMS_SPI_GPIO_Port GPIOC 86 | #define CSX_Pin GPIO_PIN_2 87 | #define CSX_GPIO_Port GPIOC 88 | #define B1_Pin GPIO_PIN_0 89 | #define B1_GPIO_Port GPIOA 90 | #define MEMS_INT2_Pin GPIO_PIN_1 91 | #define MEMS_INT2_GPIO_Port GPIOA 92 | #define MEMS_INT2A2_Pin GPIO_PIN_2 93 | #define MEMS_INT2A2_GPIO_Port GPIOA 94 | #define B5_Pin GPIO_PIN_3 95 | #define B5_GPIO_Port GPIOA 96 | #define VSYNC_Pin GPIO_PIN_4 97 | #define VSYNC_GPIO_Port GPIOA 98 | #define G2_Pin GPIO_PIN_6 99 | #define G2_GPIO_Port GPIOA 100 | #define ACP_RST_Pin GPIO_PIN_7 101 | #define ACP_RST_GPIO_Port GPIOA 102 | #define OTG_FS_PSO_Pin GPIO_PIN_4 103 | #define OTG_FS_PSO_GPIO_Port GPIOC 104 | #define OTG_FS_OC_Pin GPIO_PIN_5 105 | #define OTG_FS_OC_GPIO_Port GPIOC 106 | #define R3_Pin GPIO_PIN_0 107 | #define R3_GPIO_Port GPIOB 108 | #define R6_Pin GPIO_PIN_1 109 | #define R6_GPIO_Port GPIOB 110 | #define BOOT1_Pin GPIO_PIN_2 111 | #define BOOT1_GPIO_Port GPIOB 112 | #define SDNRAS_Pin GPIO_PIN_11 113 | #define SDNRAS_GPIO_Port GPIOF 114 | #define A6_Pin GPIO_PIN_12 115 | #define A6_GPIO_Port GPIOF 116 | #define A7_Pin GPIO_PIN_13 117 | #define A7_GPIO_Port GPIOF 118 | #define A8_Pin GPIO_PIN_14 119 | #define A8_GPIO_Port GPIOF 120 | #define A9_Pin GPIO_PIN_15 121 | #define A9_GPIO_Port GPIOF 122 | #define A10_Pin GPIO_PIN_0 123 | #define A10_GPIO_Port GPIOG 124 | #define A11_Pin GPIO_PIN_1 125 | #define A11_GPIO_Port GPIOG 126 | #define D4_Pin GPIO_PIN_7 127 | #define D4_GPIO_Port GPIOE 128 | #define D5_Pin GPIO_PIN_8 129 | #define D5_GPIO_Port GPIOE 130 | #define D6_Pin GPIO_PIN_9 131 | #define D6_GPIO_Port GPIOE 132 | #define D7_Pin GPIO_PIN_10 133 | #define D7_GPIO_Port GPIOE 134 | #define D8_Pin GPIO_PIN_11 135 | #define D8_GPIO_Port GPIOE 136 | #define D9_Pin GPIO_PIN_12 137 | #define D9_GPIO_Port GPIOE 138 | #define D10_Pin GPIO_PIN_13 139 | #define D10_GPIO_Port GPIOE 140 | #define D11_Pin GPIO_PIN_14 141 | #define D11_GPIO_Port GPIOE 142 | #define D12_Pin GPIO_PIN_15 143 | #define D12_GPIO_Port GPIOE 144 | #define G4_Pin GPIO_PIN_10 145 | #define G4_GPIO_Port GPIOB 146 | #define G5_Pin GPIO_PIN_11 147 | #define G5_GPIO_Port GPIOB 148 | #define OTG_FS_ID_Pin GPIO_PIN_12 149 | #define OTG_FS_ID_GPIO_Port GPIOB 150 | #define VBUS_FS_Pin GPIO_PIN_13 151 | #define VBUS_FS_GPIO_Port GPIOB 152 | #define OTG_FS_DM_Pin GPIO_PIN_14 153 | #define OTG_FS_DM_GPIO_Port GPIOB 154 | #define OTG_FS_DP_Pin GPIO_PIN_15 155 | #define OTG_FS_DP_GPIO_Port GPIOB 156 | #define D13_Pin GPIO_PIN_8 157 | #define D13_GPIO_Port GPIOD 158 | #define D14_Pin GPIO_PIN_9 159 | #define D14_GPIO_Port GPIOD 160 | #define D15_Pin GPIO_PIN_10 161 | #define D15_GPIO_Port GPIOD 162 | #define TE_Pin GPIO_PIN_11 163 | #define TE_GPIO_Port GPIOD 164 | #define RDX_Pin GPIO_PIN_12 165 | #define RDX_GPIO_Port GPIOD 166 | #define WRX_DCX_Pin GPIO_PIN_13 167 | #define WRX_DCX_GPIO_Port GPIOD 168 | #define D0_Pin GPIO_PIN_14 169 | #define D0_GPIO_Port GPIOD 170 | #define D1_Pin GPIO_PIN_15 171 | #define D1_GPIO_Port GPIOD 172 | #define BA0_Pin GPIO_PIN_4 173 | #define BA0_GPIO_Port GPIOG 174 | #define BA1_Pin GPIO_PIN_5 175 | #define BA1_GPIO_Port GPIOG 176 | #define R7_Pin GPIO_PIN_6 177 | #define R7_GPIO_Port GPIOG 178 | #define DOTCLK_Pin GPIO_PIN_7 179 | #define DOTCLK_GPIO_Port GPIOG 180 | #define SDCLK_Pin GPIO_PIN_8 181 | #define SDCLK_GPIO_Port GPIOG 182 | #define HSYNC_Pin GPIO_PIN_6 183 | #define HSYNC_GPIO_Port GPIOC 184 | #define G6_Pin GPIO_PIN_7 185 | #define G6_GPIO_Port GPIOC 186 | #define I2C3_SDA_Pin GPIO_PIN_9 187 | #define I2C3_SDA_GPIO_Port GPIOC 188 | #define I2C3_SCL_Pin GPIO_PIN_8 189 | #define I2C3_SCL_GPIO_Port GPIOA 190 | #define R4_Pin GPIO_PIN_11 191 | #define R4_GPIO_Port GPIOA 192 | #define R5_Pin GPIO_PIN_12 193 | #define R5_GPIO_Port GPIOA 194 | #define SWDIO_Pin GPIO_PIN_13 195 | #define SWDIO_GPIO_Port GPIOA 196 | #define SWCLK_Pin GPIO_PIN_14 197 | #define SWCLK_GPIO_Port GPIOA 198 | #define TP_INT1_Pin GPIO_PIN_15 199 | #define TP_INT1_GPIO_Port GPIOA 200 | #define R2_Pin GPIO_PIN_10 201 | #define R2_GPIO_Port GPIOC 202 | #define D2_Pin GPIO_PIN_0 203 | #define D2_GPIO_Port GPIOD 204 | #define D3_Pin GPIO_PIN_1 205 | #define D3_GPIO_Port GPIOD 206 | #define G7_Pin GPIO_PIN_3 207 | #define G7_GPIO_Port GPIOD 208 | #define B2_Pin GPIO_PIN_6 209 | #define B2_GPIO_Port GPIOD 210 | #define G3_Pin GPIO_PIN_10 211 | #define G3_GPIO_Port GPIOG 212 | #define B3_Pin GPIO_PIN_11 213 | #define B3_GPIO_Port GPIOG 214 | #define B4_Pin GPIO_PIN_12 215 | #define B4_GPIO_Port GPIOG 216 | #define LD3_Pin GPIO_PIN_13 217 | #define LD3_GPIO_Port GPIOG 218 | #define LD4_Pin GPIO_PIN_14 219 | #define LD4_GPIO_Port GPIOG 220 | #define SDNCAS_Pin GPIO_PIN_15 221 | #define SDNCAS_GPIO_Port GPIOG 222 | #define SDCKE1_Pin GPIO_PIN_5 223 | #define SDCKE1_GPIO_Port GPIOB 224 | #define SDNE1_Pin GPIO_PIN_6 225 | #define SDNE1_GPIO_Port GPIOB 226 | #define B6_Pin GPIO_PIN_8 227 | #define B6_GPIO_Port GPIOB 228 | #define B7_Pin GPIO_PIN_9 229 | #define B7_GPIO_Port GPIOB 230 | #define NBL0_Pin GPIO_PIN_0 231 | #define NBL0_GPIO_Port GPIOE 232 | #define NBL1_Pin GPIO_PIN_1 233 | #define NBL1_GPIO_Port GPIOE 234 | /* USER CODE BEGIN Private defines */ 235 | 236 | /* USER CODE END Private defines */ 237 | 238 | /** 239 | * @} 240 | */ 241 | 242 | /** 243 | * @} 244 | */ 245 | 246 | #endif /* __MAIN_H */ 247 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 248 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | #ifndef DEPRECATED_DEFINITIONS_H 71 | #define DEPRECATED_DEFINITIONS_H 72 | 73 | 74 | /* Each FreeRTOS port has a unique portmacro.h header file. Originally a 75 | pre-processor definition was used to ensure the pre-processor found the correct 76 | portmacro.h file for the port being used. That scheme was deprecated in favour 77 | of setting the compiler's include path such that it found the correct 78 | portmacro.h file - removing the need for the constant and allowing the 79 | portmacro.h file to be located anywhere in relation to the port being used. The 80 | definitions below remain in the code for backward compatibility only. New 81 | projects should not use them. */ 82 | 83 | #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT 84 | #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h" 85 | typedef void ( __interrupt __far *pxISR )(); 86 | #endif 87 | 88 | #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT 89 | #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h" 90 | typedef void ( __interrupt __far *pxISR )(); 91 | #endif 92 | 93 | #ifdef GCC_MEGA_AVR 94 | #include "../portable/GCC/ATMega323/portmacro.h" 95 | #endif 96 | 97 | #ifdef IAR_MEGA_AVR 98 | #include "../portable/IAR/ATMega323/portmacro.h" 99 | #endif 100 | 101 | #ifdef MPLAB_PIC24_PORT 102 | #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" 103 | #endif 104 | 105 | #ifdef MPLAB_DSPIC_PORT 106 | #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h" 107 | #endif 108 | 109 | #ifdef MPLAB_PIC18F_PORT 110 | #include "../../Source/portable/MPLAB/PIC18F/portmacro.h" 111 | #endif 112 | 113 | #ifdef MPLAB_PIC32MX_PORT 114 | #include "../../Source/portable/MPLAB/PIC32MX/portmacro.h" 115 | #endif 116 | 117 | #ifdef _FEDPICC 118 | #include "libFreeRTOS/Include/portmacro.h" 119 | #endif 120 | 121 | #ifdef SDCC_CYGNAL 122 | #include "../../Source/portable/SDCC/Cygnal/portmacro.h" 123 | #endif 124 | 125 | #ifdef GCC_ARM7 126 | #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h" 127 | #endif 128 | 129 | #ifdef GCC_ARM7_ECLIPSE 130 | #include "portmacro.h" 131 | #endif 132 | 133 | #ifdef ROWLEY_LPC23xx 134 | #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h" 135 | #endif 136 | 137 | #ifdef IAR_MSP430 138 | #include "..\..\Source\portable\IAR\MSP430\portmacro.h" 139 | #endif 140 | 141 | #ifdef GCC_MSP430 142 | #include "../../Source/portable/GCC/MSP430F449/portmacro.h" 143 | #endif 144 | 145 | #ifdef ROWLEY_MSP430 146 | #include "../../Source/portable/Rowley/MSP430F449/portmacro.h" 147 | #endif 148 | 149 | #ifdef ARM7_LPC21xx_KEIL_RVDS 150 | #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h" 151 | #endif 152 | 153 | #ifdef SAM7_GCC 154 | #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h" 155 | #endif 156 | 157 | #ifdef SAM7_IAR 158 | #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h" 159 | #endif 160 | 161 | #ifdef SAM9XE_IAR 162 | #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h" 163 | #endif 164 | 165 | #ifdef LPC2000_IAR 166 | #include "..\..\Source\portable\IAR\LPC2000\portmacro.h" 167 | #endif 168 | 169 | #ifdef STR71X_IAR 170 | #include "..\..\Source\portable\IAR\STR71x\portmacro.h" 171 | #endif 172 | 173 | #ifdef STR75X_IAR 174 | #include "..\..\Source\portable\IAR\STR75x\portmacro.h" 175 | #endif 176 | 177 | #ifdef STR75X_GCC 178 | #include "..\..\Source\portable\GCC\STR75x\portmacro.h" 179 | #endif 180 | 181 | #ifdef STR91X_IAR 182 | #include "..\..\Source\portable\IAR\STR91x\portmacro.h" 183 | #endif 184 | 185 | #ifdef GCC_H8S 186 | #include "../../Source/portable/GCC/H8S2329/portmacro.h" 187 | #endif 188 | 189 | #ifdef GCC_AT91FR40008 190 | #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h" 191 | #endif 192 | 193 | #ifdef RVDS_ARMCM3_LM3S102 194 | #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h" 195 | #endif 196 | 197 | #ifdef GCC_ARMCM3_LM3S102 198 | #include "../../Source/portable/GCC/ARM_CM3/portmacro.h" 199 | #endif 200 | 201 | #ifdef GCC_ARMCM3 202 | #include "../../Source/portable/GCC/ARM_CM3/portmacro.h" 203 | #endif 204 | 205 | #ifdef IAR_ARM_CM3 206 | #include "../../Source/portable/IAR/ARM_CM3/portmacro.h" 207 | #endif 208 | 209 | #ifdef IAR_ARMCM3_LM 210 | #include "../../Source/portable/IAR/ARM_CM3/portmacro.h" 211 | #endif 212 | 213 | #ifdef HCS12_CODE_WARRIOR 214 | #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h" 215 | #endif 216 | 217 | #ifdef MICROBLAZE_GCC 218 | #include "../../Source/portable/GCC/MicroBlaze/portmacro.h" 219 | #endif 220 | 221 | #ifdef TERN_EE 222 | #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h" 223 | #endif 224 | 225 | #ifdef GCC_HCS12 226 | #include "../../Source/portable/GCC/HCS12/portmacro.h" 227 | #endif 228 | 229 | #ifdef GCC_MCF5235 230 | #include "../../Source/portable/GCC/MCF5235/portmacro.h" 231 | #endif 232 | 233 | #ifdef COLDFIRE_V2_GCC 234 | #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h" 235 | #endif 236 | 237 | #ifdef COLDFIRE_V2_CODEWARRIOR 238 | #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h" 239 | #endif 240 | 241 | #ifdef GCC_PPC405 242 | #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h" 243 | #endif 244 | 245 | #ifdef GCC_PPC440 246 | #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h" 247 | #endif 248 | 249 | #ifdef _16FX_SOFTUNE 250 | #include "..\..\Source\portable\Softune\MB96340\portmacro.h" 251 | #endif 252 | 253 | #ifdef BCC_INDUSTRIAL_PC_PORT 254 | /* A short file name has to be used in place of the normal 255 | FreeRTOSConfig.h when using the Borland compiler. */ 256 | #include "frconfig.h" 257 | #include "..\portable\BCC\16BitDOS\PC\prtmacro.h" 258 | typedef void ( __interrupt __far *pxISR )(); 259 | #endif 260 | 261 | #ifdef BCC_FLASH_LITE_186_PORT 262 | /* A short file name has to be used in place of the normal 263 | FreeRTOSConfig.h when using the Borland compiler. */ 264 | #include "frconfig.h" 265 | #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h" 266 | typedef void ( __interrupt __far *pxISR )(); 267 | #endif 268 | 269 | #ifdef __GNUC__ 270 | #ifdef __AVR32_AVR32A__ 271 | #include "portmacro.h" 272 | #endif 273 | #endif 274 | 275 | #ifdef __ICCAVR32__ 276 | #ifdef __CORE__ 277 | #if __CORE__ == __AVR32A__ 278 | #include "portmacro.h" 279 | #endif 280 | #endif 281 | #endif 282 | 283 | #ifdef __91467D 284 | #include "portmacro.h" 285 | #endif 286 | 287 | #ifdef __96340 288 | #include "portmacro.h" 289 | #endif 290 | 291 | 292 | #ifdef __IAR_V850ES_Fx3__ 293 | #include "../../Source/portable/IAR/V850ES/portmacro.h" 294 | #endif 295 | 296 | #ifdef __IAR_V850ES_Jx3__ 297 | #include "../../Source/portable/IAR/V850ES/portmacro.h" 298 | #endif 299 | 300 | #ifdef __IAR_V850ES_Jx3_L__ 301 | #include "../../Source/portable/IAR/V850ES/portmacro.h" 302 | #endif 303 | 304 | #ifdef __IAR_V850ES_Jx2__ 305 | #include "../../Source/portable/IAR/V850ES/portmacro.h" 306 | #endif 307 | 308 | #ifdef __IAR_V850ES_Hx2__ 309 | #include "../../Source/portable/IAR/V850ES/portmacro.h" 310 | #endif 311 | 312 | #ifdef __IAR_78K0R_Kx3__ 313 | #include "../../Source/portable/IAR/78K0R/portmacro.h" 314 | #endif 315 | 316 | #ifdef __IAR_78K0R_Kx3L__ 317 | #include "../../Source/portable/IAR/78K0R/portmacro.h" 318 | #endif 319 | 320 | #endif /* DEPRECATED_DEFINITIONS_H */ 321 | 322 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | 71 | #ifndef PORTMACRO_H 72 | #define PORTMACRO_H 73 | 74 | #ifdef __cplusplus 75 | extern "C" { 76 | #endif 77 | 78 | /*----------------------------------------------------------- 79 | * Port specific definitions. 80 | * 81 | * The settings in this file configure FreeRTOS correctly for the 82 | * given hardware and compiler. 83 | * 84 | * These settings should not be altered. 85 | *----------------------------------------------------------- 86 | */ 87 | 88 | /* Type definitions. */ 89 | #define portCHAR char 90 | #define portFLOAT float 91 | #define portDOUBLE double 92 | #define portLONG long 93 | #define portSHORT short 94 | #define portSTACK_TYPE uint32_t 95 | #define portBASE_TYPE long 96 | 97 | typedef portSTACK_TYPE StackType_t; 98 | typedef long BaseType_t; 99 | typedef unsigned long UBaseType_t; 100 | 101 | #if( configUSE_16_BIT_TICKS == 1 ) 102 | typedef uint16_t TickType_t; 103 | #define portMAX_DELAY ( TickType_t ) 0xffff 104 | #else 105 | typedef uint32_t TickType_t; 106 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL 107 | 108 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do 109 | not need to be guarded with a critical section. */ 110 | #define portTICK_TYPE_IS_ATOMIC 1 111 | #endif 112 | /*-----------------------------------------------------------*/ 113 | 114 | /* Architecture specifics. */ 115 | #define portSTACK_GROWTH ( -1 ) 116 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ ) 117 | #define portBYTE_ALIGNMENT 8 118 | /*-----------------------------------------------------------*/ 119 | 120 | /* Scheduler utilities. */ 121 | #define portYIELD() \ 122 | { \ 123 | /* Set a PendSV to request a context switch. */ \ 124 | portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \ 125 | \ 126 | /* Barriers are normally not required but do ensure the code is completely \ 127 | within the specified behaviour for the architecture. */ \ 128 | __asm volatile( "dsb" ); \ 129 | __asm volatile( "isb" ); \ 130 | } 131 | 132 | #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) ) 133 | #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL ) 134 | #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD() 135 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x ) 136 | /*-----------------------------------------------------------*/ 137 | 138 | /* Critical section management. */ 139 | extern void vPortEnterCritical( void ); 140 | extern void vPortExitCritical( void ); 141 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI() 142 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x) 143 | #define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI() 144 | #define portENABLE_INTERRUPTS() vPortSetBASEPRI(0) 145 | #define portENTER_CRITICAL() vPortEnterCritical() 146 | #define portEXIT_CRITICAL() vPortExitCritical() 147 | 148 | /*-----------------------------------------------------------*/ 149 | 150 | /* Task function macros as described on the FreeRTOS.org WEB site. These are 151 | not necessary for to use this port. They are defined so the common demo files 152 | (which build with all the ports) will build. */ 153 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters ) 154 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters ) 155 | /*-----------------------------------------------------------*/ 156 | 157 | /* Tickless idle/low power functionality. */ 158 | #ifndef portSUPPRESS_TICKS_AND_SLEEP 159 | extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime ); 160 | #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime ) 161 | #endif 162 | /*-----------------------------------------------------------*/ 163 | 164 | /* Architecture specific optimisations. */ 165 | #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION 166 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 167 | #endif 168 | 169 | #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1 170 | 171 | /* Generic helper function. */ 172 | __attribute__( ( always_inline ) ) static inline uint8_t ucPortCountLeadingZeros( uint32_t ulBitmap ) 173 | { 174 | uint8_t ucReturn; 175 | 176 | __asm volatile ( "clz %0, %1" : "=r" ( ucReturn ) : "r" ( ulBitmap ) ); 177 | return ucReturn; 178 | } 179 | 180 | /* Check the configuration. */ 181 | #if( configMAX_PRIORITIES > 32 ) 182 | #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice. 183 | #endif 184 | 185 | /* Store/clear the ready priorities in a bit map. */ 186 | #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) ) 187 | #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) ) 188 | 189 | /*-----------------------------------------------------------*/ 190 | 191 | #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31 - ucPortCountLeadingZeros( ( uxReadyPriorities ) ) ) 192 | 193 | #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */ 194 | 195 | /*-----------------------------------------------------------*/ 196 | 197 | #ifdef configASSERT 198 | void vPortValidateInterruptPriority( void ); 199 | #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority() 200 | #endif 201 | 202 | /* portNOP() is not required by this port. */ 203 | #define portNOP() 204 | 205 | #ifndef portFORCE_INLINE 206 | #define portFORCE_INLINE inline __attribute__(( always_inline)) 207 | #endif 208 | 209 | /*-----------------------------------------------------------*/ 210 | 211 | portFORCE_INLINE static void vPortRaiseBASEPRI( void ) 212 | { 213 | uint32_t ulNewBASEPRI; 214 | 215 | __asm volatile 216 | ( 217 | " mov %0, %1 \n" \ 218 | " msr basepri, %0 \n" \ 219 | " isb \n" \ 220 | " dsb \n" \ 221 | :"=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) 222 | ); 223 | } 224 | 225 | /*-----------------------------------------------------------*/ 226 | 227 | portFORCE_INLINE static uint32_t ulPortRaiseBASEPRI( void ) 228 | { 229 | uint32_t ulOriginalBASEPRI, ulNewBASEPRI; 230 | 231 | __asm volatile 232 | ( 233 | " mrs %0, basepri \n" \ 234 | " mov %1, %2 \n" \ 235 | " msr basepri, %1 \n" \ 236 | " isb \n" \ 237 | " dsb \n" \ 238 | :"=r" (ulOriginalBASEPRI), "=r" (ulNewBASEPRI) : "i" ( configMAX_SYSCALL_INTERRUPT_PRIORITY ) 239 | ); 240 | 241 | /* This return will not be reached but is necessary to prevent compiler 242 | warnings. */ 243 | return ulOriginalBASEPRI; 244 | } 245 | /*-----------------------------------------------------------*/ 246 | 247 | portFORCE_INLINE static void vPortSetBASEPRI( uint32_t ulNewMaskValue ) 248 | { 249 | __asm volatile 250 | ( 251 | " msr basepri, %0 " :: "r" ( ulNewMaskValue ) 252 | ); 253 | } 254 | /*-----------------------------------------------------------*/ 255 | 256 | 257 | #ifdef __cplusplus 258 | } 259 | #endif 260 | 261 | #endif /* PORTMACRO_H */ 262 | 263 | -------------------------------------------------------------------------------- /Middlewares/Third_Party/FreeRTOS/Source/list.c: -------------------------------------------------------------------------------- 1 | /* 2 | FreeRTOS V8.2.3 - Copyright (C) 2015 Real Time Engineers Ltd. 3 | All rights reserved 4 | 5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. 6 | 7 | This file is part of the FreeRTOS distribution. 8 | 9 | FreeRTOS is free software; you can redistribute it and/or modify it under 10 | the terms of the GNU General Public License (version 2) as published by the 11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. 12 | 13 | *************************************************************************** 14 | >>! NOTE: The modification to the GPL is included to allow you to !<< 15 | >>! distribute a combined work that includes FreeRTOS without being !<< 16 | >>! obliged to provide the source code for proprietary components !<< 17 | >>! outside of the FreeRTOS kernel. !<< 18 | *************************************************************************** 19 | 20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY 21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following 23 | link: http://www.freertos.org/a00114.html 24 | 25 | *************************************************************************** 26 | * * 27 | * FreeRTOS provides completely free yet professionally developed, * 28 | * robust, strictly quality controlled, supported, and cross * 29 | * platform software that is more than just the market leader, it * 30 | * is the industry's de facto standard. * 31 | * * 32 | * Help yourself get started quickly while simultaneously helping * 33 | * to support the FreeRTOS project by purchasing a FreeRTOS * 34 | * tutorial book, reference manual, or both: * 35 | * http://www.FreeRTOS.org/Documentation * 36 | * * 37 | *************************************************************************** 38 | 39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading 40 | the FAQ page "My application does not run, what could be wrong?". Have you 41 | defined configASSERT()? 42 | 43 | http://www.FreeRTOS.org/support - In return for receiving this top quality 44 | embedded software for free we request you assist our global community by 45 | participating in the support forum. 46 | 47 | http://www.FreeRTOS.org/training - Investing in training allows your team to 48 | be as productive as possible as early as possible. Now you can receive 49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers 50 | Ltd, and the world's leading authority on the world's leading RTOS. 51 | 52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, 53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS 54 | compatible FAT file system, and our tiny thread aware UDP/IP stack. 55 | 56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate. 57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS. 58 | 59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High 60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS 61 | licenses offer ticketed support, indemnification and commercial middleware. 62 | 63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety 64 | engineered and independently SIL3 certified version for use in safety and 65 | mission critical applications that require provable dependability. 66 | 67 | 1 tab == 4 spaces! 68 | */ 69 | 70 | 71 | #include 72 | #include "FreeRTOS.h" 73 | #include "list.h" 74 | 75 | /*----------------------------------------------------------- 76 | * PUBLIC LIST API documented in list.h 77 | *----------------------------------------------------------*/ 78 | 79 | void vListInitialise( List_t * const pxList ) 80 | { 81 | /* The list structure contains a list item which is used to mark the 82 | end of the list. To initialise the list the list end is inserted 83 | as the only list entry. */ 84 | pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ 85 | 86 | /* The list end value is the highest possible value in the list to 87 | ensure it remains at the end of the list. */ 88 | pxList->xListEnd.xItemValue = portMAX_DELAY; 89 | 90 | /* The list end next and previous pointers point to itself so we know 91 | when the list is empty. */ 92 | pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ 93 | pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ 94 | 95 | pxList->uxNumberOfItems = ( UBaseType_t ) 0U; 96 | 97 | /* Write known values into the list if 98 | configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ 99 | listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList ); 100 | listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList ); 101 | } 102 | /*-----------------------------------------------------------*/ 103 | 104 | void vListInitialiseItem( ListItem_t * const pxItem ) 105 | { 106 | /* Make sure the list item is not recorded as being on a list. */ 107 | pxItem->pvContainer = NULL; 108 | 109 | /* Write known values into the list item if 110 | configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */ 111 | listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); 112 | listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem ); 113 | } 114 | /*-----------------------------------------------------------*/ 115 | 116 | void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem ) 117 | { 118 | ListItem_t * const pxIndex = pxList->pxIndex; 119 | 120 | /* Only effective when configASSERT() is also defined, these tests may catch 121 | the list data structures being overwritten in memory. They will not catch 122 | data errors caused by incorrect configuration or use of FreeRTOS. */ 123 | listTEST_LIST_INTEGRITY( pxList ); 124 | listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); 125 | 126 | /* Insert a new list item into pxList, but rather than sort the list, 127 | makes the new list item the last item to be removed by a call to 128 | listGET_OWNER_OF_NEXT_ENTRY(). */ 129 | pxNewListItem->pxNext = pxIndex; 130 | pxNewListItem->pxPrevious = pxIndex->pxPrevious; 131 | 132 | /* Only used during decision coverage testing. */ 133 | mtCOVERAGE_TEST_DELAY(); 134 | 135 | pxIndex->pxPrevious->pxNext = pxNewListItem; 136 | pxIndex->pxPrevious = pxNewListItem; 137 | 138 | /* Remember which list the item is in. */ 139 | pxNewListItem->pvContainer = ( void * ) pxList; 140 | 141 | ( pxList->uxNumberOfItems )++; 142 | } 143 | /*-----------------------------------------------------------*/ 144 | 145 | void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem ) 146 | { 147 | ListItem_t *pxIterator; 148 | const TickType_t xValueOfInsertion = pxNewListItem->xItemValue; 149 | 150 | /* Only effective when configASSERT() is also defined, these tests may catch 151 | the list data structures being overwritten in memory. They will not catch 152 | data errors caused by incorrect configuration or use of FreeRTOS. */ 153 | listTEST_LIST_INTEGRITY( pxList ); 154 | listTEST_LIST_ITEM_INTEGRITY( pxNewListItem ); 155 | 156 | /* Insert the new list item into the list, sorted in xItemValue order. 157 | 158 | If the list already contains a list item with the same item value then the 159 | new list item should be placed after it. This ensures that TCB's which are 160 | stored in ready lists (all of which have the same xItemValue value) get a 161 | share of the CPU. However, if the xItemValue is the same as the back marker 162 | the iteration loop below will not end. Therefore the value is checked 163 | first, and the algorithm slightly modified if necessary. */ 164 | if( xValueOfInsertion == portMAX_DELAY ) 165 | { 166 | pxIterator = pxList->xListEnd.pxPrevious; 167 | } 168 | else 169 | { 170 | /* *** NOTE *********************************************************** 171 | If you find your application is crashing here then likely causes are 172 | listed below. In addition see http://www.freertos.org/FAQHelp.html for 173 | more tips, and ensure configASSERT() is defined! 174 | http://www.freertos.org/a00110.html#configASSERT 175 | 176 | 1) Stack overflow - 177 | see http://www.freertos.org/Stacks-and-stack-overflow-checking.html 178 | 2) Incorrect interrupt priority assignment, especially on Cortex-M 179 | parts where numerically high priority values denote low actual 180 | interrupt priorities, which can seem counter intuitive. See 181 | http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition 182 | of configMAX_SYSCALL_INTERRUPT_PRIORITY on 183 | http://www.freertos.org/a00110.html 184 | 3) Calling an API function from within a critical section or when 185 | the scheduler is suspended, or calling an API function that does 186 | not end in "FromISR" from an interrupt. 187 | 4) Using a queue or semaphore before it has been initialised or 188 | before the scheduler has been started (are interrupts firing 189 | before vTaskStartScheduler() has been called?). 190 | **********************************************************************/ 191 | 192 | for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */ 193 | { 194 | /* There is nothing to do here, just iterating to the wanted 195 | insertion position. */ 196 | } 197 | } 198 | 199 | pxNewListItem->pxNext = pxIterator->pxNext; 200 | pxNewListItem->pxNext->pxPrevious = pxNewListItem; 201 | pxNewListItem->pxPrevious = pxIterator; 202 | pxIterator->pxNext = pxNewListItem; 203 | 204 | /* Remember which list the item is in. This allows fast removal of the 205 | item later. */ 206 | pxNewListItem->pvContainer = ( void * ) pxList; 207 | 208 | ( pxList->uxNumberOfItems )++; 209 | } 210 | /*-----------------------------------------------------------*/ 211 | 212 | UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove ) 213 | { 214 | /* The list item knows which list it is in. Obtain the list from the list 215 | item. */ 216 | List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer; 217 | 218 | pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious; 219 | pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext; 220 | 221 | /* Only used during decision coverage testing. */ 222 | mtCOVERAGE_TEST_DELAY(); 223 | 224 | /* Make sure the index is left pointing to a valid item. */ 225 | if( pxList->pxIndex == pxItemToRemove ) 226 | { 227 | pxList->pxIndex = pxItemToRemove->pxPrevious; 228 | } 229 | else 230 | { 231 | mtCOVERAGE_TEST_MARKER(); 232 | } 233 | 234 | pxItemToRemove->pvContainer = NULL; 235 | ( pxList->uxNumberOfItems )--; 236 | 237 | return pxList->uxNumberOfItems; 238 | } 239 | /*-----------------------------------------------------------*/ 240 | 241 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal_dma_ex.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal_dma_ex.c 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief DMA Extension HAL module driver 8 | * This file provides firmware functions to manage the following 9 | * functionalities of the DMA Extension peripheral: 10 | * + Extended features functions 11 | * 12 | @verbatim 13 | ============================================================================== 14 | ##### How to use this driver ##### 15 | ============================================================================== 16 | [..] 17 | The DMA Extension HAL driver can be used as follows: 18 | (#) Start a multi buffer transfer using the HAL_DMA_MultiBufferStart() function 19 | for polling mode or HAL_DMA_MultiBufferStart_IT() for interrupt mode. 20 | 21 | -@- In Memory-to-Memory transfer mode, Multi (Double) Buffer mode is not allowed. 22 | -@- When Multi (Double) Buffer mode is enabled the, transfer is circular by default. 23 | -@- In Multi (Double) buffer mode, it is possible to update the base address for 24 | the AHB memory port on the fly (DMA_SxM0AR or DMA_SxM1AR) when the stream is enabled. 25 | 26 | @endverbatim 27 | ****************************************************************************** 28 | * @attention 29 | * 30 | *

© COPYRIGHT(c) 2016 STMicroelectronics

31 | * 32 | * Redistribution and use in source and binary forms, with or without modification, 33 | * are permitted provided that the following conditions are met: 34 | * 1. Redistributions of source code must retain the above copyright notice, 35 | * this list of conditions and the following disclaimer. 36 | * 2. Redistributions in binary form must reproduce the above copyright notice, 37 | * this list of conditions and the following disclaimer in the documentation 38 | * and/or other materials provided with the distribution. 39 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 40 | * may be used to endorse or promote products derived from this software 41 | * without specific prior written permission. 42 | * 43 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 44 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 45 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 46 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 47 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 48 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 49 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 50 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 51 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 52 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 53 | * 54 | ****************************************************************************** 55 | */ 56 | 57 | /* Includes ------------------------------------------------------------------*/ 58 | #include "stm32f4xx_hal.h" 59 | 60 | /** @addtogroup STM32F4xx_HAL_Driver 61 | * @{ 62 | */ 63 | 64 | /** @defgroup DMAEx DMAEx 65 | * @brief DMA Extended HAL module driver 66 | * @{ 67 | */ 68 | 69 | #ifdef HAL_DMA_MODULE_ENABLED 70 | 71 | /* Private types -------------------------------------------------------------*/ 72 | /* Private variables ---------------------------------------------------------*/ 73 | /* Private Constants ---------------------------------------------------------*/ 74 | /* Private macros ------------------------------------------------------------*/ 75 | /* Private functions ---------------------------------------------------------*/ 76 | /** @addtogroup DMAEx_Private_Functions 77 | * @{ 78 | */ 79 | static void DMA_MultiBufferSetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); 80 | /** 81 | * @} 82 | */ 83 | 84 | /* Exported functions ---------------------------------------------------------*/ 85 | 86 | /** @addtogroup DMAEx_Exported_Functions 87 | * @{ 88 | */ 89 | 90 | 91 | /** @addtogroup DMAEx_Exported_Functions_Group1 92 | * 93 | @verbatim 94 | =============================================================================== 95 | ##### Extended features functions ##### 96 | =============================================================================== 97 | [..] This section provides functions allowing to: 98 | (+) Configure the source, destination address and data length and 99 | Start MultiBuffer DMA transfer 100 | (+) Configure the source, destination address and data length and 101 | Start MultiBuffer DMA transfer with interrupt 102 | (+) Change on the fly the memory0 or memory1 address. 103 | 104 | @endverbatim 105 | * @{ 106 | */ 107 | 108 | 109 | /** 110 | * @brief Starts the multi_buffer DMA Transfer. 111 | * @param hdma : pointer to a DMA_HandleTypeDef structure that contains 112 | * the configuration information for the specified DMA Stream. 113 | * @param SrcAddress: The source memory Buffer address 114 | * @param DstAddress: The destination memory Buffer address 115 | * @param SecondMemAddress: The second memory Buffer address in case of multi buffer Transfer 116 | * @param DataLength: The length of data to be transferred from source to destination 117 | * @retval HAL status 118 | */ 119 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength) 120 | { 121 | HAL_StatusTypeDef status = HAL_OK; 122 | 123 | /* Check the parameters */ 124 | assert_param(IS_DMA_BUFFER_SIZE(DataLength)); 125 | 126 | /* Memory-to-memory transfer not supported in double buffering mode */ 127 | if (hdma->Init.Direction == DMA_MEMORY_TO_MEMORY) 128 | { 129 | hdma->ErrorCode = HAL_DMA_ERROR_NOT_SUPPORTED; 130 | status = HAL_ERROR; 131 | } 132 | else 133 | { 134 | /* Process Locked */ 135 | __HAL_LOCK(hdma); 136 | 137 | if(HAL_DMA_STATE_READY == hdma->State) 138 | { 139 | /* Change DMA peripheral state */ 140 | hdma->State = HAL_DMA_STATE_BUSY; 141 | 142 | /* Enable the double buffer mode */ 143 | hdma->Instance->CR |= (uint32_t)DMA_SxCR_DBM; 144 | 145 | /* Configure DMA Stream destination address */ 146 | hdma->Instance->M1AR = SecondMemAddress; 147 | 148 | /* Configure the source, destination address and the data length */ 149 | DMA_MultiBufferSetConfig(hdma, SrcAddress, DstAddress, DataLength); 150 | 151 | /* Enable the peripheral */ 152 | __HAL_DMA_ENABLE(hdma); 153 | } 154 | else 155 | { 156 | /* Return error status */ 157 | status = HAL_BUSY; 158 | } 159 | } 160 | return status; 161 | } 162 | 163 | /** 164 | * @brief Starts the multi_buffer DMA Transfer with interrupt enabled. 165 | * @param hdma: pointer to a DMA_HandleTypeDef structure that contains 166 | * the configuration information for the specified DMA Stream. 167 | * @param SrcAddress: The source memory Buffer address 168 | * @param DstAddress: The destination memory Buffer address 169 | * @param SecondMemAddress: The second memory Buffer address in case of multi buffer Transfer 170 | * @param DataLength: The length of data to be transferred from source to destination 171 | * @retval HAL status 172 | */ 173 | HAL_StatusTypeDef HAL_DMAEx_MultiBufferStart_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t SecondMemAddress, uint32_t DataLength) 174 | { 175 | HAL_StatusTypeDef status = HAL_OK; 176 | 177 | /* Check the parameters */ 178 | assert_param(IS_DMA_BUFFER_SIZE(DataLength)); 179 | 180 | /* Memory-to-memory transfer not supported in double buffering mode */ 181 | if (hdma->Init.Direction == DMA_MEMORY_TO_MEMORY) 182 | { 183 | hdma->ErrorCode = HAL_DMA_ERROR_NOT_SUPPORTED; 184 | return HAL_ERROR; 185 | } 186 | 187 | /* Check callback functions */ 188 | if ((NULL == hdma->XferCpltCallback) || (NULL == hdma->XferM1CpltCallback) || (NULL == hdma->XferErrorCallback)) 189 | { 190 | hdma->ErrorCode = HAL_DMA_ERROR_PARAM; 191 | return HAL_ERROR; 192 | } 193 | 194 | /* Process locked */ 195 | __HAL_LOCK(hdma); 196 | 197 | if(HAL_DMA_STATE_READY == hdma->State) 198 | { 199 | /* Change DMA peripheral state */ 200 | hdma->State = HAL_DMA_STATE_BUSY; 201 | 202 | /* Initialize the error code */ 203 | hdma->ErrorCode = HAL_DMA_ERROR_NONE; 204 | 205 | /* Enable the Double buffer mode */ 206 | hdma->Instance->CR |= (uint32_t)DMA_SxCR_DBM; 207 | 208 | /* Configure DMA Stream destination address */ 209 | hdma->Instance->M1AR = SecondMemAddress; 210 | 211 | /* Configure the source, destination address and the data length */ 212 | DMA_MultiBufferSetConfig(hdma, SrcAddress, DstAddress, DataLength); 213 | 214 | /* Clear all flags */ 215 | __HAL_DMA_CLEAR_FLAG (hdma, __HAL_DMA_GET_TC_FLAG_INDEX(hdma)); 216 | __HAL_DMA_CLEAR_FLAG (hdma, __HAL_DMA_GET_HT_FLAG_INDEX(hdma)); 217 | __HAL_DMA_CLEAR_FLAG (hdma, __HAL_DMA_GET_TE_FLAG_INDEX(hdma)); 218 | __HAL_DMA_CLEAR_FLAG (hdma, __HAL_DMA_GET_DME_FLAG_INDEX(hdma)); 219 | __HAL_DMA_CLEAR_FLAG (hdma, __HAL_DMA_GET_FE_FLAG_INDEX(hdma)); 220 | 221 | /* Enable Common interrupts*/ 222 | hdma->Instance->CR |= DMA_IT_TC | DMA_IT_TE | DMA_IT_DME; 223 | hdma->Instance->FCR |= DMA_IT_FE; 224 | 225 | if((hdma->XferHalfCpltCallback != NULL) || (hdma->XferM1HalfCpltCallback != NULL)) 226 | { 227 | hdma->Instance->CR |= DMA_IT_HT; 228 | } 229 | 230 | /* Enable the peripheral */ 231 | __HAL_DMA_ENABLE(hdma); 232 | } 233 | else 234 | { 235 | /* Process unlocked */ 236 | __HAL_UNLOCK(hdma); 237 | 238 | /* Return error status */ 239 | status = HAL_BUSY; 240 | } 241 | return status; 242 | } 243 | 244 | /** 245 | * @brief Change the memory0 or memory1 address on the fly. 246 | * @param hdma: pointer to a DMA_HandleTypeDef structure that contains 247 | * the configuration information for the specified DMA Stream. 248 | * @param Address: The new address 249 | * @param memory: the memory to be changed, This parameter can be one of 250 | * the following values: 251 | * MEMORY0 / 252 | * MEMORY1 253 | * @note The MEMORY0 address can be changed only when the current transfer use 254 | * MEMORY1 and the MEMORY1 address can be changed only when the current 255 | * transfer use MEMORY0. 256 | * @retval HAL status 257 | */ 258 | HAL_StatusTypeDef HAL_DMAEx_ChangeMemory(DMA_HandleTypeDef *hdma, uint32_t Address, HAL_DMA_MemoryTypeDef memory) 259 | { 260 | if(memory == MEMORY0) 261 | { 262 | /* change the memory0 address */ 263 | hdma->Instance->M0AR = Address; 264 | } 265 | else 266 | { 267 | /* change the memory1 address */ 268 | hdma->Instance->M1AR = Address; 269 | } 270 | 271 | return HAL_OK; 272 | } 273 | 274 | /** 275 | * @} 276 | */ 277 | 278 | /** 279 | * @} 280 | */ 281 | 282 | /** @addtogroup DMAEx_Private_Functions 283 | * @{ 284 | */ 285 | 286 | /** 287 | * @brief Set the DMA Transfer parameter. 288 | * @param hdma: pointer to a DMA_HandleTypeDef structure that contains 289 | * the configuration information for the specified DMA Stream. 290 | * @param SrcAddress: The source memory Buffer address 291 | * @param DstAddress: The destination memory Buffer address 292 | * @param DataLength: The length of data to be transferred from source to destination 293 | * @retval HAL status 294 | */ 295 | static void DMA_MultiBufferSetConfig(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength) 296 | { 297 | /* Configure DMA Stream data length */ 298 | hdma->Instance->NDTR = DataLength; 299 | 300 | /* Peripheral to Memory */ 301 | if((hdma->Init.Direction) == DMA_MEMORY_TO_PERIPH) 302 | { 303 | /* Configure DMA Stream destination address */ 304 | hdma->Instance->PAR = DstAddress; 305 | 306 | /* Configure DMA Stream source address */ 307 | hdma->Instance->M0AR = SrcAddress; 308 | } 309 | /* Memory to Peripheral */ 310 | else 311 | { 312 | /* Configure DMA Stream source address */ 313 | hdma->Instance->PAR = SrcAddress; 314 | 315 | /* Configure DMA Stream destination address */ 316 | hdma->Instance->M0AR = DstAddress; 317 | } 318 | } 319 | 320 | /** 321 | * @} 322 | */ 323 | 324 | #endif /* HAL_DMA_MODULE_ENABLED */ 325 | /** 326 | * @} 327 | */ 328 | 329 | /** 330 | * @} 331 | */ 332 | 333 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 334 | -------------------------------------------------------------------------------- /Drivers/STM32F4xx_HAL_Driver/Inc/stm32f4xx_hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_hal.h 4 | * @author MCD Application Team 5 | * @version V1.6.0 6 | * @date 04-November-2016 7 | * @brief This file contains all the functions prototypes for the HAL 8 | * module driver. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT(c) 2016 STMicroelectronics

13 | * 14 | * Redistribution and use in source and binary forms, with or without modification, 15 | * are permitted provided that the following conditions are met: 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 22 | * may be used to endorse or promote products derived from this software 23 | * without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | ****************************************************************************** 37 | */ 38 | 39 | /* Define to prevent recursive inclusion -------------------------------------*/ 40 | #ifndef __STM32F4xx_HAL_H 41 | #define __STM32F4xx_HAL_H 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* Includes ------------------------------------------------------------------*/ 48 | #include "stm32f4xx_hal_conf.h" 49 | 50 | /** @addtogroup STM32F4xx_HAL_Driver 51 | * @{ 52 | */ 53 | 54 | /** @addtogroup HAL 55 | * @{ 56 | */ 57 | 58 | /* Exported types ------------------------------------------------------------*/ 59 | /* Exported constants --------------------------------------------------------*/ 60 | 61 | /* Exported macro ------------------------------------------------------------*/ 62 | /** @defgroup HAL_Exported_Macros HAL Exported Macros 63 | * @{ 64 | */ 65 | 66 | /** @brief Freeze/Unfreeze Peripherals in Debug mode 67 | */ 68 | #define __HAL_DBGMCU_FREEZE_TIM2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM2_STOP)) 69 | #define __HAL_DBGMCU_FREEZE_TIM3() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM3_STOP)) 70 | #define __HAL_DBGMCU_FREEZE_TIM4() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM4_STOP)) 71 | #define __HAL_DBGMCU_FREEZE_TIM5() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM5_STOP)) 72 | #define __HAL_DBGMCU_FREEZE_TIM6() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM6_STOP)) 73 | #define __HAL_DBGMCU_FREEZE_TIM7() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM7_STOP)) 74 | #define __HAL_DBGMCU_FREEZE_TIM12() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM12_STOP)) 75 | #define __HAL_DBGMCU_FREEZE_TIM13() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM13_STOP)) 76 | #define __HAL_DBGMCU_FREEZE_TIM14() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_TIM14_STOP)) 77 | #define __HAL_DBGMCU_FREEZE_RTC() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_RTC_STOP)) 78 | #define __HAL_DBGMCU_FREEZE_WWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_WWDG_STOP)) 79 | #define __HAL_DBGMCU_FREEZE_IWDG() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_IWDG_STOP)) 80 | #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) 81 | #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) 82 | #define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) 83 | #define __HAL_DBGMCU_FREEZE_CAN1() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN1_STOP)) 84 | #define __HAL_DBGMCU_FREEZE_CAN2() (DBGMCU->APB1FZ |= (DBGMCU_APB1_FZ_DBG_CAN2_STOP)) 85 | #define __HAL_DBGMCU_FREEZE_TIM1() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM1_STOP)) 86 | #define __HAL_DBGMCU_FREEZE_TIM8() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM8_STOP)) 87 | #define __HAL_DBGMCU_FREEZE_TIM9() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM9_STOP)) 88 | #define __HAL_DBGMCU_FREEZE_TIM10() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM10_STOP)) 89 | #define __HAL_DBGMCU_FREEZE_TIM11() (DBGMCU->APB2FZ |= (DBGMCU_APB2_FZ_DBG_TIM11_STOP)) 90 | 91 | #define __HAL_DBGMCU_UNFREEZE_TIM2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM2_STOP)) 92 | #define __HAL_DBGMCU_UNFREEZE_TIM3() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM3_STOP)) 93 | #define __HAL_DBGMCU_UNFREEZE_TIM4() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM4_STOP)) 94 | #define __HAL_DBGMCU_UNFREEZE_TIM5() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM5_STOP)) 95 | #define __HAL_DBGMCU_UNFREEZE_TIM6() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM6_STOP)) 96 | #define __HAL_DBGMCU_UNFREEZE_TIM7() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM7_STOP)) 97 | #define __HAL_DBGMCU_UNFREEZE_TIM12() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM12_STOP)) 98 | #define __HAL_DBGMCU_UNFREEZE_TIM13() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM13_STOP)) 99 | #define __HAL_DBGMCU_UNFREEZE_TIM14() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_TIM14_STOP)) 100 | #define __HAL_DBGMCU_UNFREEZE_RTC() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_RTC_STOP)) 101 | #define __HAL_DBGMCU_UNFREEZE_WWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_WWDG_STOP)) 102 | #define __HAL_DBGMCU_UNFREEZE_IWDG() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_IWDG_STOP)) 103 | #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C1_SMBUS_TIMEOUT)) 104 | #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C2_SMBUS_TIMEOUT)) 105 | #define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_I2C3_SMBUS_TIMEOUT)) 106 | #define __HAL_DBGMCU_UNFREEZE_CAN1() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN1_STOP)) 107 | #define __HAL_DBGMCU_UNFREEZE_CAN2() (DBGMCU->APB1FZ &= ~(DBGMCU_APB1_FZ_DBG_CAN2_STOP)) 108 | #define __HAL_DBGMCU_UNFREEZE_TIM1() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM1_STOP)) 109 | #define __HAL_DBGMCU_UNFREEZE_TIM8() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM8_STOP)) 110 | #define __HAL_DBGMCU_UNFREEZE_TIM9() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM9_STOP)) 111 | #define __HAL_DBGMCU_UNFREEZE_TIM10() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM10_STOP)) 112 | #define __HAL_DBGMCU_UNFREEZE_TIM11() (DBGMCU->APB2FZ &= ~(DBGMCU_APB2_FZ_DBG_TIM11_STOP)) 113 | 114 | /** @brief Main Flash memory mapped at 0x00000000 115 | */ 116 | #define __HAL_SYSCFG_REMAPMEMORY_FLASH() (SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE)) 117 | 118 | /** @brief System Flash memory mapped at 0x00000000 119 | */ 120 | #define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ 121 | SYSCFG->MEMRMP |= SYSCFG_MEMRMP_MEM_MODE_0;\ 122 | }while(0); 123 | 124 | /** @brief Embedded SRAM mapped at 0x00000000 125 | */ 126 | #define __HAL_SYSCFG_REMAPMEMORY_SRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ 127 | SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_0 | SYSCFG_MEMRMP_MEM_MODE_1);\ 128 | }while(0); 129 | 130 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) 131 | /** @brief FSMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 132 | */ 133 | #define __HAL_SYSCFG_REMAPMEMORY_FSMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ 134 | SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ 135 | }while(0); 136 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ 137 | 138 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ 139 | defined(STM32F469xx) || defined(STM32F479xx) 140 | /** @brief FMC Bank1 (NOR/PSRAM 1 and 2) mapped at 0x00000000 141 | */ 142 | #define __HAL_SYSCFG_REMAPMEMORY_FMC() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ 143 | SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_1);\ 144 | }while(0); 145 | 146 | /** @brief FMC/SDRAM Bank 1 and 2 mapped at 0x00000000 147 | */ 148 | #define __HAL_SYSCFG_REMAPMEMORY_FMC_SDRAM() do {SYSCFG->MEMRMP &= ~(SYSCFG_MEMRMP_MEM_MODE);\ 149 | SYSCFG->MEMRMP |= (SYSCFG_MEMRMP_MEM_MODE_2);\ 150 | }while(0); 151 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ 152 | 153 | #if defined(STM32F410Tx) || defined(STM32F410Cx) || defined(STM32F410Rx) || defined(STM32F413xx) || defined(STM32F423xx) 154 | /** @defgroup Cortex_Lockup_Enable Cortex Lockup Enable 155 | * @{ 156 | */ 157 | /** @brief SYSCFG Break Lockup lock 158 | * Enables and locks the connection of Cortex-M4 LOCKUP (Hardfault) output to TIM1/8 input 159 | * @note The selected configuration is locked and can be unlocked by system reset 160 | */ 161 | #define __HAL_SYSCFG_BREAK_PVD_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_PVD_LOCK); \ 162 | SYSCFG->CFGR2 |= SYSCFG_CFGR2_PVD_LOCK; \ 163 | }while(0) 164 | /** 165 | * @} 166 | */ 167 | 168 | /** @defgroup PVD_Lock_Enable PVD Lock 169 | * @{ 170 | */ 171 | /** @brief SYSCFG Break PVD lock 172 | * Enables and locks the PVD connection with Timer1/8 Break Input, , as well as the PVDE and PLS[2:0] in the PWR_CR register 173 | * @note The selected configuration is locked and can be unlocked by system reset 174 | */ 175 | #define __HAL_SYSCFG_BREAK_LOCKUP_LOCK() do {SYSCFG->CFGR2 &= ~(SYSCFG_CFGR2_LOCKUP_LOCK); \ 176 | SYSCFG->CFGR2 |= SYSCFG_CFGR2_LOCKUP_LOCK; \ 177 | }while(0) 178 | /** 179 | * @} 180 | */ 181 | #endif /* STM32F410Tx || STM32F410Cx || STM32F410Rx || STM32F413xx || STM32F423xx */ 182 | /** 183 | * @} 184 | */ 185 | 186 | /* Exported functions --------------------------------------------------------*/ 187 | /** @addtogroup HAL_Exported_Functions 188 | * @{ 189 | */ 190 | /** @addtogroup HAL_Exported_Functions_Group1 191 | * @{ 192 | */ 193 | /* Initialization and de-initialization functions ******************************/ 194 | HAL_StatusTypeDef HAL_Init(void); 195 | HAL_StatusTypeDef HAL_DeInit(void); 196 | void HAL_MspInit(void); 197 | void HAL_MspDeInit(void); 198 | HAL_StatusTypeDef HAL_InitTick (uint32_t TickPriority); 199 | /** 200 | * @} 201 | */ 202 | 203 | /** @addtogroup HAL_Exported_Functions_Group2 204 | * @{ 205 | */ 206 | /* Peripheral Control functions ************************************************/ 207 | void HAL_IncTick(void); 208 | void HAL_Delay(__IO uint32_t Delay); 209 | uint32_t HAL_GetTick(void); 210 | void HAL_SuspendTick(void); 211 | void HAL_ResumeTick(void); 212 | uint32_t HAL_GetHalVersion(void); 213 | uint32_t HAL_GetREVID(void); 214 | uint32_t HAL_GetDEVID(void); 215 | void HAL_DBGMCU_EnableDBGSleepMode(void); 216 | void HAL_DBGMCU_DisableDBGSleepMode(void); 217 | void HAL_DBGMCU_EnableDBGStopMode(void); 218 | void HAL_DBGMCU_DisableDBGStopMode(void); 219 | void HAL_DBGMCU_EnableDBGStandbyMode(void); 220 | void HAL_DBGMCU_DisableDBGStandbyMode(void); 221 | void HAL_EnableCompensationCell(void); 222 | void HAL_DisableCompensationCell(void); 223 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) ||\ 224 | defined(STM32F469xx) || defined(STM32F479xx) 225 | void HAL_EnableMemorySwappingBank(void); 226 | void HAL_DisableMemorySwappingBank(void); 227 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx || STM32F469xx || STM32F479xx */ 228 | /** 229 | * @} 230 | */ 231 | 232 | /** 233 | * @} 234 | */ 235 | /* Private types -------------------------------------------------------------*/ 236 | /* Private variables ---------------------------------------------------------*/ 237 | /** @defgroup HAL_Private_Variables HAL Private Variables 238 | * @{ 239 | */ 240 | /** 241 | * @} 242 | */ 243 | /* Private constants ---------------------------------------------------------*/ 244 | /** @defgroup HAL_Private_Constants HAL Private Constants 245 | * @{ 246 | */ 247 | /** 248 | * @} 249 | */ 250 | /* Private macros ------------------------------------------------------------*/ 251 | /* Private functions ---------------------------------------------------------*/ 252 | /** 253 | * @} 254 | */ 255 | 256 | /** 257 | * @} 258 | */ 259 | 260 | #ifdef __cplusplus 261 | } 262 | #endif 263 | 264 | #endif /* __STM32F4xx_HAL_H */ 265 | 266 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 267 | --------------------------------------------------------------------------------