| @@ -0,0 +1,238 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx.h | |||
| * @author MCD Application Team | |||
| * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer Header File. | |||
| * This file contains all the peripheral register's definitions, bits | |||
| * definitions and memory mapping for STM32L0xx devices. | |||
| * | |||
| * The file is the unique include file that the application programmer | |||
| * is using in the C source code, usually in main.c. This file contains: | |||
| * - Configuration section that allows to select: | |||
| * - The device used in the target application | |||
| * - To use or not the peripheral's drivers in application code(i.e. | |||
| * code will be based on direct access to peripheral's registers | |||
| * rather than drivers API), this option is controlled by | |||
| * "#define USE_HAL_DRIVER" | |||
| * | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /** @addtogroup CMSIS | |||
| * @{ | |||
| */ | |||
| /** @addtogroup stm32l0xx | |||
| * @{ | |||
| */ | |||
| #ifndef __STM32L0xx_H | |||
| #define __STM32L0xx_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif /* __cplusplus */ | |||
| /** @addtogroup Library_configuration_section | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief STM32 Family | |||
| */ | |||
| #if !defined (STM32L0) | |||
| #define STM32L0 | |||
| #endif /* STM32L0 */ | |||
| /* Uncomment the line below according to the target STM32 device used in your | |||
| application | |||
| */ | |||
| #if !defined (STM32L010x4) && !defined (STM32L010x6) && !defined (STM32L010x8) && !defined (STM32L010xB) && \ | |||
| !defined (STM32L011xx) && !defined (STM32L021xx) && \ | |||
| !defined (STM32L031xx) && !defined (STM32L041xx) && \ | |||
| !defined (STM32L051xx) && !defined (STM32L052xx) && !defined (STM32L053xx) && \ | |||
| !defined (STM32L061xx) && !defined (STM32L062xx) && !defined (STM32L063xx) && \ | |||
| !defined (STM32L071xx) && !defined (STM32L072xx) && !defined (STM32L073xx) && \ | |||
| !defined (STM32L081xx) && !defined (STM32L082xx) && !defined (STM32L083xx) | |||
| /* #define STM32L010x4 */ /*!< STM32L010K4, STM32L010F4 Devices */ | |||
| /* #define STM32L010x6 */ /*!< STM32L010C6 Devices */ | |||
| /* #define STM32L010x8 */ /*!< STM32L010K8, STM32L010R8 Devices */ | |||
| /* #define STM32L010xB */ /*!< STM32L010RB Devices */ | |||
| /* #define STM32L011xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */ | |||
| /* #define STM32L021xx */ /*!< STM32L021D4, STM32L021F4, STM32L021G4, STM32L021K4 Devices */ | |||
| /* #define STM32L031xx */ /*!< STM32L031C6, STM32L031E6, STM32L031F6, STM32L031G6, STM32L031K6 Devices */ | |||
| /* #define STM32L041xx */ /*!< STM32L041C6, STM32L041K6, STM32L041G6, STM32L041F6, STM32L041E6 Devices */ | |||
| /* #define STM32L051xx */ /*!< STM32L051K8, STM32L051C6, STM32L051C8, STM32L051R6, STM32L051R8, STM32L051K6, STM32L051T6, STM32L051T8 Devices */ | |||
| /* #define STM32L052xx */ /*!< STM32L052K6, STM32L052K8, STM32L052C6, STM32L052C8, STM32L052R6, STM32L052R8, STM32L052T6, STM32L052T8 Devices */ | |||
| /* #define STM32L053xx */ /*!< STM32L053C6, STM32L053C8, STM32L053R6, STM32L053R8 Devices */ | |||
| /* #define STM32L061xx */ /*!< */ | |||
| /* #define STM32L062xx */ /*!< STM32L062K8 Devices */ | |||
| /* #define STM32L063xx */ /*!< STM32L063C8, STM32L063R8 Devices */ | |||
| /* #define STM32L071xx */ /*!< STM32L071V8, STM32L071K8, STM32L071VB, STM32L071RB, STM32L071CB, STM32L071KB, STM32L071VZ, STM32L071RZ, STM32L071CZ, STM32L071KZ, STM32L071C8 Devices */ | |||
| /* #define STM32L072xx */ /*!< STM32L072V8, STM32L072VB, STM32L072RB, STM32L072CB, STM32L072VZ, STM32L072RZ, STM32L072CZ, STM32L072KB, STM32L072KZ Devices */ | |||
| /* #define STM32L073xx */ /*!< STM32L073V8, STM32L073VB, STM32L073RB, STM32L073VZ, STM32L073RZ, STM32L073CB, STM32L073CZ Devices */ | |||
| /* #define STM32L081xx */ /*!< STM32L081CB, STM32L081CZ, STM32L081KZ Devices */ | |||
| /* #define STM32L082xx */ /*!< STM32L082KB, STM32L082KZ, STM32L082CZ Devices */ | |||
| /* #define STM32L083xx */ /*!< STM32L083V8, STM32L083VB, STM32L083RB, STM32L083VZ, STM32L083RZ, STM32L083CB, STM32L083CZ Devices */ | |||
| #endif | |||
| /* Tip: To avoid modifying this file each time you need to switch between these | |||
| devices, you can define the device in your toolchain compiler preprocessor. | |||
| */ | |||
| #if !defined (USE_HAL_DRIVER) | |||
| /** | |||
| * @brief Comment the line below if you will not use the peripherals drivers. | |||
| In this case, these drivers will not be included and the application code will | |||
| be based on direct access to peripherals registers | |||
| */ | |||
| /*#define USE_HAL_DRIVER */ | |||
| #endif /* USE_HAL_DRIVER */ | |||
| /** | |||
| * @brief CMSIS Device version number | |||
| */ | |||
| #define __STM32L0xx_CMSIS_VERSION_MAIN (0x01) /*!< [31:24] main version */ | |||
| #define __STM32L0xx_CMSIS_VERSION_SUB1 (0x09) /*!< [23:16] sub1 version */ | |||
| #define __STM32L0xx_CMSIS_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */ | |||
| #define __STM32L0xx_CMSIS_VERSION_RC (0x00) /*!< [7:0] release candidate */ | |||
| #define __STM32L0xx_CMSIS_VERSION ((__STM32L0xx_CMSIS_VERSION_MAIN << 24)\ | |||
| |(__STM32L0xx_CMSIS_VERSION_SUB1 << 16)\ | |||
| |(__STM32L0xx_CMSIS_VERSION_SUB2 << 8 )\ | |||
| |(__STM32L0xx_CMSIS_VERSION_RC)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup Device_Included | |||
| * @{ | |||
| */ | |||
| #if defined(STM32L010xB) | |||
| #include "stm32l010xb.h" | |||
| #elif defined(STM32L010x8) | |||
| #include "stm32l010x8.h" | |||
| #elif defined(STM32L010x6) | |||
| #include "stm32l010x6.h" | |||
| #elif defined(STM32L010x4) | |||
| #include "stm32l010x4.h" | |||
| #elif defined(STM32L011xx) | |||
| #include "stm32l011xx.h" | |||
| #elif defined(STM32L021xx) | |||
| #include "stm32l021xx.h" | |||
| #elif defined(STM32L031xx) | |||
| #include "stm32l031xx.h" | |||
| #elif defined(STM32L041xx) | |||
| #include "stm32l041xx.h" | |||
| #elif defined(STM32L051xx) | |||
| #include "stm32l051xx.h" | |||
| #elif defined(STM32L052xx) | |||
| #include "stm32l052xx.h" | |||
| #elif defined(STM32L053xx) | |||
| #include "stm32l053xx.h" | |||
| #elif defined(STM32L062xx) | |||
| #include "stm32l062xx.h" | |||
| #elif defined(STM32L063xx) | |||
| #include "stm32l063xx.h" | |||
| #elif defined(STM32L061xx) | |||
| #include "stm32l061xx.h" | |||
| #elif defined(STM32L071xx) | |||
| #include "stm32l071xx.h" | |||
| #elif defined(STM32L072xx) | |||
| #include "stm32l072xx.h" | |||
| #elif defined(STM32L073xx) | |||
| #include "stm32l073xx.h" | |||
| #elif defined(STM32L082xx) | |||
| #include "stm32l082xx.h" | |||
| #elif defined(STM32L083xx) | |||
| #include "stm32l083xx.h" | |||
| #elif defined(STM32L081xx) | |||
| #include "stm32l081xx.h" | |||
| #else | |||
| #error "Please select first the target STM32L0xx device used in your application (in stm32l0xx.h file)" | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup Exported_types | |||
| * @{ | |||
| */ | |||
| typedef enum | |||
| { | |||
| RESET = 0, | |||
| SET = !RESET | |||
| } FlagStatus, ITStatus; | |||
| typedef enum | |||
| { | |||
| DISABLE = 0, | |||
| ENABLE = !DISABLE | |||
| } FunctionalState; | |||
| #define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE)) | |||
| typedef enum | |||
| { | |||
| SUCCESS = 0, | |||
| ERROR = !SUCCESS | |||
| } ErrorStatus; | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup Exported_macro | |||
| * @{ | |||
| */ | |||
| #define SET_BIT(REG, BIT) ((REG) |= (BIT)) | |||
| #define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT)) | |||
| #define READ_BIT(REG, BIT) ((REG) & (BIT)) | |||
| #define CLEAR_REG(REG) ((REG) = (0x0)) | |||
| #define WRITE_REG(REG, VAL) ((REG) = (VAL)) | |||
| #define READ_REG(REG) ((REG)) | |||
| #define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK))) | |||
| /** | |||
| * @} | |||
| */ | |||
| #if defined (USE_HAL_DRIVER) | |||
| #include "stm32l0xx_hal.h" | |||
| #endif /* USE_HAL_DRIVER */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif /* __cplusplus */ | |||
| #endif /* __STM32L0xx_H */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,109 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file system_stm32l0xx.h | |||
| * @author MCD Application Team | |||
| * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer System Header File. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /** @addtogroup CMSIS | |||
| * @{ | |||
| */ | |||
| /** @addtogroup stm32l0xx_system | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Define to prevent recursive inclusion | |||
| */ | |||
| #ifndef __SYSTEM_STM32L0XX_H | |||
| #define __SYSTEM_STM32L0XX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /** @addtogroup STM32L0xx_System_Includes | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Exported_types | |||
| * @{ | |||
| */ | |||
| /* This variable is updated in three ways: | |||
| 1) by calling CMSIS function SystemCoreClockUpdate() | |||
| 2) by calling HAL API function HAL_RCC_GetSysClockFreq() | |||
| 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency | |||
| Note: If you use this function to configure the system clock; then there | |||
| is no need to call the 2 first functions listed above, since SystemCoreClock | |||
| variable is updated automatically. | |||
| */ | |||
| extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ | |||
| /* | |||
| */ | |||
| extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ | |||
| extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ | |||
| extern const uint8_t PLLMulTable[9]; /*!< PLL multipiers table values */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Exported_Constants | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Exported_Macros | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Exported_Functions | |||
| * @{ | |||
| */ | |||
| extern void SystemInit(void); | |||
| extern void SystemCoreClockUpdate(void); | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /*__SYSTEM_STM32L0XX_H */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,266 @@ | |||
| ;******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x4.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l010x4 Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_IRQHandler [WEAK] | |||
| EXPORT ADC1_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_IRQHandler | |||
| ADC1_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,266 @@ | |||
| ;******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x6.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l010x6 Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,266 @@ | |||
| ;******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x8.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l010x8 Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,268 @@ | |||
| ;******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010xb.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l010xB Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,268 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l011xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l011xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,268 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l021xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l021xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =__initial_sp ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,243 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l031xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l031xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,243 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l041xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l041xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| SPI1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,253 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l051xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l051xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,256 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l052xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l052xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| RNG_LPUART1_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,258 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l053xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l053xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT LCD_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| RNG_LPUART1_IRQHandler | |||
| LCD_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,253 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l061xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l061xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; AES and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,256 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l062xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l062xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_RNG_LPUART1_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,258 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l063xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l063xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT LCD_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_RNG_LPUART1_IRQHandler | |||
| LCD_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,259 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l071xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l071xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,264 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l072xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l072xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C lbrary (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| RNG_LPUART1_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,266 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l073xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l073xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT LCD_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| RNG_LPUART1_IRQHandler | |||
| LCD_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,259 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l081xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l081xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_LPUART1_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_LPUART1_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,264 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l082xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l082xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_RNG_LPUART1_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,266 @@ | |||
| ;******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l083xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32l083xx Devices vector table for MDK-ARM toolchain. | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == Reset_Handler | |||
| ;* - Set the vector table entries with the exceptions ISR address | |||
| ;* - Branches to __main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************* | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;******************************************************************************* | |||
| ; | |||
| ; Amount of memory (in bytes) allocated for Stack | |||
| ; Tailor this value to your application needs | |||
| ; <h> Stack Configuration | |||
| ; <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Stack_Size EQU 0x00000400 | |||
| AREA STACK, NOINIT, READWRITE, ALIGN=3 | |||
| Stack_Mem SPACE Stack_Size | |||
| __initial_sp | |||
| ; <h> Heap Configuration | |||
| ; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> | |||
| ; </h> | |||
| Heap_Size EQU 0x00000200 | |||
| AREA HEAP, NOINIT, READWRITE, ALIGN=3 | |||
| __heap_base | |||
| Heap_Mem SPACE Heap_Size | |||
| __heap_limit | |||
| PRESERVE8 | |||
| THUMB | |||
| ; Vector Table Mapped to Address 0 at Reset | |||
| AREA RESET, DATA, READONLY | |||
| EXPORT __Vectors | |||
| EXPORT __Vectors_End | |||
| EXPORT __Vectors_Size | |||
| __Vectors DCD __initial_sp ; Top of Stack | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC and CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| __Vectors_End | |||
| __Vectors_Size EQU __Vectors_End - __Vectors | |||
| AREA |.text|, CODE, READONLY | |||
| ; Reset handler routine | |||
| Reset_Handler PROC | |||
| EXPORT Reset_Handler [WEAK] | |||
| IMPORT __main | |||
| IMPORT SystemInit | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__main | |||
| BX R0 | |||
| ENDP | |||
| ; Dummy Exception Handlers (infinite loops which can be modified) | |||
| NMI_Handler PROC | |||
| EXPORT NMI_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| HardFault_Handler\ | |||
| PROC | |||
| EXPORT HardFault_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SVC_Handler PROC | |||
| EXPORT SVC_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| PendSV_Handler PROC | |||
| EXPORT PendSV_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| SysTick_Handler PROC | |||
| EXPORT SysTick_Handler [WEAK] | |||
| B . | |||
| ENDP | |||
| Default_Handler PROC | |||
| EXPORT WWDG_IRQHandler [WEAK] | |||
| EXPORT PVD_IRQHandler [WEAK] | |||
| EXPORT RTC_IRQHandler [WEAK] | |||
| EXPORT FLASH_IRQHandler [WEAK] | |||
| EXPORT RCC_CRS_IRQHandler [WEAK] | |||
| EXPORT EXTI0_1_IRQHandler [WEAK] | |||
| EXPORT EXTI2_3_IRQHandler [WEAK] | |||
| EXPORT EXTI4_15_IRQHandler [WEAK] | |||
| EXPORT TSC_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel1_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel2_3_IRQHandler [WEAK] | |||
| EXPORT DMA1_Channel4_5_6_7_IRQHandler [WEAK] | |||
| EXPORT ADC1_COMP_IRQHandler [WEAK] | |||
| EXPORT LPTIM1_IRQHandler [WEAK] | |||
| EXPORT USART4_5_IRQHandler [WEAK] | |||
| EXPORT TIM2_IRQHandler [WEAK] | |||
| EXPORT TIM3_IRQHandler [WEAK] | |||
| EXPORT TIM6_DAC_IRQHandler [WEAK] | |||
| EXPORT TIM7_IRQHandler [WEAK] | |||
| EXPORT TIM21_IRQHandler [WEAK] | |||
| EXPORT TIM22_IRQHandler [WEAK] | |||
| EXPORT I2C1_IRQHandler [WEAK] | |||
| EXPORT I2C2_IRQHandler [WEAK] | |||
| EXPORT I2C3_IRQHandler [WEAK] | |||
| EXPORT SPI1_IRQHandler [WEAK] | |||
| EXPORT SPI2_IRQHandler [WEAK] | |||
| EXPORT USART1_IRQHandler [WEAK] | |||
| EXPORT USART2_IRQHandler [WEAK] | |||
| EXPORT AES_RNG_LPUART1_IRQHandler [WEAK] | |||
| EXPORT LCD_IRQHandler [WEAK] | |||
| EXPORT USB_IRQHandler [WEAK] | |||
| WWDG_IRQHandler | |||
| PVD_IRQHandler | |||
| RTC_IRQHandler | |||
| FLASH_IRQHandler | |||
| RCC_CRS_IRQHandler | |||
| EXTI0_1_IRQHandler | |||
| EXTI2_3_IRQHandler | |||
| EXTI4_15_IRQHandler | |||
| TSC_IRQHandler | |||
| DMA1_Channel1_IRQHandler | |||
| DMA1_Channel2_3_IRQHandler | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| ADC1_COMP_IRQHandler | |||
| LPTIM1_IRQHandler | |||
| USART4_5_IRQHandler | |||
| TIM2_IRQHandler | |||
| TIM3_IRQHandler | |||
| TIM6_DAC_IRQHandler | |||
| TIM7_IRQHandler | |||
| TIM21_IRQHandler | |||
| TIM22_IRQHandler | |||
| I2C1_IRQHandler | |||
| I2C2_IRQHandler | |||
| I2C3_IRQHandler | |||
| SPI1_IRQHandler | |||
| SPI2_IRQHandler | |||
| USART1_IRQHandler | |||
| USART2_IRQHandler | |||
| AES_RNG_LPUART1_IRQHandler | |||
| LCD_IRQHandler | |||
| USB_IRQHandler | |||
| B . | |||
| ENDP | |||
| ALIGN | |||
| ;******************************************************************************* | |||
| ; User Stack and Heap initialization | |||
| ;******************************************************************************* | |||
| IF :DEF:__MICROLIB | |||
| EXPORT __initial_sp | |||
| EXPORT __heap_base | |||
| EXPORT __heap_limit | |||
| ELSE | |||
| IMPORT __use_two_region_memory | |||
| EXPORT __user_initial_stackheap | |||
| __user_initial_stackheap | |||
| LDR R0, = Heap_Mem | |||
| LDR R1, =(Stack_Mem + Stack_Size) | |||
| LDR R2, = (Heap_Mem + Heap_Size) | |||
| LDR R3, = Stack_Mem | |||
| BX LR | |||
| ALIGN | |||
| ENDIF | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,287 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l010x4.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L010x4 Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word 0 /* Reserved */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_IRQHandler /* DMA1 Channel 4 and Channel 5 */ | |||
| .word ADC1_IRQHandler /* ADC1 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_IRQHandler,Default_Handler | |||
| .weak ADC1_IRQHandler | |||
| .thumb_set ADC1_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,287 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l010x6.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L010x6 Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word 0 /* Reserved */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_IRQHandler /* ADC1 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_IRQHandler | |||
| .thumb_set ADC1_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,287 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l010x8.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L010x8 Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word 0 /* Reserved */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_IRQHandler /* ADC1 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_IRQHandler | |||
| .thumb_set ADC1_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,290 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l010xb.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L010xB Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word 0 /* Reserved */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_IRQHandler /* ADC1 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_IRQHandler | |||
| .thumb_set ADC1_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,290 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l011xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L011xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_IRQHandler /* DMA1 Channel 4 and Channel 5 */ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,290 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l021xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L021xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /*Check if boot space corresponds to system memory*/ | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| /*SYSCFG clock enable*/ | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| /*Set CFGR1 register with flash memory remap at address 0*/ | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart: | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_IRQHandler /* DMA1 Channel 4 and Channel 5 */ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_LPUART1_IRQHandler /* AES and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_LPUART1_IRQHandler | |||
| .thumb_set AES_LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,273 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l031xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L031xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,273 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l041xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L041xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word 0 /* Reserved */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_LPUART1_IRQHandler /* AES and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_LPUART1_IRQHandler | |||
| .thumb_set AES_LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,284 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l051xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L051xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_IRQHandler /* TIM6 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_IRQHandler | |||
| .thumb_set TIM6_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,290 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l052xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L052xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak RNG_LPUART1_IRQHandler | |||
| .thumb_set RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,293 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l053xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L053xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */ | |||
| .word LCD_IRQHandler /* LCD */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak RNG_LPUART1_IRQHandler | |||
| .thumb_set RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak LCD_IRQHandler | |||
| .thumb_set LCD_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,284 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l061xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L061xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_IRQHandler /* TIM6 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_LPUART1_IRQHandler /* AES and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_IRQHandler | |||
| .thumb_set TIM6_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_LPUART1_IRQHandler | |||
| .thumb_set AES_LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,290 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l062xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L062xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_RNG_LPUART1_IRQHandler /* AES, RNG and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_RNG_LPUART1_IRQHandler | |||
| .thumb_set AES_RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,293 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l063xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L063xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_RNG_LPUART1_IRQHandler /* AES, RNG and LPUART1 */ | |||
| .word LCD_IRQHandler /* LCD */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_RNG_LPUART1_IRQHandler | |||
| .thumb_set AES_RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak LCD_IRQHandler | |||
| .thumb_set LCD_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,296 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l071xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L071xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_IRQHandler /* TIM6 and DAC */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word LPUART1_IRQHandler /* LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_IRQHandler | |||
| .thumb_set TIM6_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak LPUART1_IRQHandler | |||
| .thumb_set LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,302 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l072xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L072xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak RNG_LPUART1_IRQHandler | |||
| .thumb_set RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,305 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l073xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L073xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word RNG_LPUART1_IRQHandler /* RNG and LPUART1 */ | |||
| .word LCD_IRQHandler /* LCD */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak RNG_LPUART1_IRQHandler | |||
| .thumb_set RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak LCD_IRQHandler | |||
| .thumb_set LCD_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,297 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l081xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L081xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_IRQHandler /* RCC */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word 0 /* Reserved */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_IRQHandler /* TIM6 */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_LPUART1_IRQHandler /* AES and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word 0 /* Reserved */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_IRQHandler | |||
| .thumb_set RCC_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_IRQHandler | |||
| .thumb_set TIM6_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_LPUART1_IRQHandler | |||
| .thumb_set AES_LPUART1_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,302 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l082xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L082xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_RNG_LPUART1_IRQHandler /* AES, RNG and LPUART1 */ | |||
| .word 0 /* Reserved */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_RNG_LPUART1_IRQHandler | |||
| .thumb_set AES_RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,305 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file startup_stm32l083xx.s | |||
| * @author MCD Application Team | |||
| * @brief STM32L083xx Devices vector table for GCC toolchain. | |||
| * This module performs: | |||
| * - Set the initial SP | |||
| * - Set the initial PC == Reset_Handler, | |||
| * - Set the vector table entries with the exceptions ISR address | |||
| * - Branches to main in the C library (which eventually | |||
| * calls main()). | |||
| * After Reset the Cortex-M0+ processor is in Thread mode, | |||
| * priority is Privileged, and the Stack is set to Main. | |||
| ****************************************************************************** | |||
| * | |||
| * Redistribution and use in source and binary forms, with or without modification, | |||
| * are permitted provided that the following conditions are met: | |||
| * 1. Redistributions of source code must retain the above copyright notice, | |||
| * this list of conditions and the following disclaimer. | |||
| * 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| * this list of conditions and the following disclaimer in the documentation | |||
| * and/or other materials provided with the distribution. | |||
| * 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| * may be used to endorse or promote products derived from this software | |||
| * without specific prior written permission. | |||
| * | |||
| * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| .syntax unified | |||
| .cpu cortex-m0plus | |||
| .fpu softvfp | |||
| .thumb | |||
| .global g_pfnVectors | |||
| .global Default_Handler | |||
| /* start address for the initialization values of the .data section. | |||
| defined in linker script */ | |||
| .word _sidata | |||
| /* start address for the .data section. defined in linker script */ | |||
| .word _sdata | |||
| /* end address for the .data section. defined in linker script */ | |||
| .word _edata | |||
| /* start address for the .bss section. defined in linker script */ | |||
| .word _sbss | |||
| /* end address for the .bss section. defined in linker script */ | |||
| .word _ebss | |||
| .section .text.Reset_Handler | |||
| .weak Reset_Handler | |||
| .type Reset_Handler, %function | |||
| Reset_Handler: | |||
| ldr r0, =_estack | |||
| mov sp, r0 /* set stack pointer */ | |||
| /* Copy the data segment initializers from flash to SRAM */ | |||
| movs r1, #0 | |||
| b LoopCopyDataInit | |||
| CopyDataInit: | |||
| ldr r3, =_sidata | |||
| ldr r3, [r3, r1] | |||
| str r3, [r0, r1] | |||
| adds r1, r1, #4 | |||
| LoopCopyDataInit: | |||
| ldr r0, =_sdata | |||
| ldr r3, =_edata | |||
| adds r2, r0, r1 | |||
| cmp r2, r3 | |||
| bcc CopyDataInit | |||
| ldr r2, =_sbss | |||
| b LoopFillZerobss | |||
| /* Zero fill the bss segment. */ | |||
| FillZerobss: | |||
| movs r3, #0 | |||
| str r3, [r2] | |||
| adds r2, r2, #4 | |||
| LoopFillZerobss: | |||
| ldr r3, = _ebss | |||
| cmp r2, r3 | |||
| bcc FillZerobss | |||
| /* Call the clock system intitialization function.*/ | |||
| bl SystemInit | |||
| /* Call static constructors */ | |||
| bl __libc_init_array | |||
| /* Call the application's entry point.*/ | |||
| bl main | |||
| LoopForever: | |||
| b LoopForever | |||
| .size Reset_Handler, .-Reset_Handler | |||
| /** | |||
| * @brief This is the code that gets called when the processor receives an | |||
| * unexpected interrupt. This simply enters an infinite loop, preserving | |||
| * the system state for examination by a debugger. | |||
| * | |||
| * @param None | |||
| * @retval : None | |||
| */ | |||
| .section .text.Default_Handler,"ax",%progbits | |||
| Default_Handler: | |||
| Infinite_Loop: | |||
| b Infinite_Loop | |||
| .size Default_Handler, .-Default_Handler | |||
| /****************************************************************************** | |||
| * | |||
| * The minimal vector table for a Cortex M0. Note that the proper constructs | |||
| * must be placed on this to ensure that it ends up at physical address | |||
| * 0x0000.0000. | |||
| * | |||
| ******************************************************************************/ | |||
| .section .isr_vector,"a",%progbits | |||
| .type g_pfnVectors, %object | |||
| .size g_pfnVectors, .-g_pfnVectors | |||
| g_pfnVectors: | |||
| .word _estack | |||
| .word Reset_Handler | |||
| .word NMI_Handler | |||
| .word HardFault_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word 0 | |||
| .word SVC_Handler | |||
| .word 0 | |||
| .word 0 | |||
| .word PendSV_Handler | |||
| .word SysTick_Handler | |||
| .word WWDG_IRQHandler /* Window WatchDog */ | |||
| .word PVD_IRQHandler /* PVD through EXTI Line detection */ | |||
| .word RTC_IRQHandler /* RTC through the EXTI line */ | |||
| .word FLASH_IRQHandler /* FLASH */ | |||
| .word RCC_CRS_IRQHandler /* RCC and CRS */ | |||
| .word EXTI0_1_IRQHandler /* EXTI Line 0 and 1 */ | |||
| .word EXTI2_3_IRQHandler /* EXTI Line 2 and 3 */ | |||
| .word EXTI4_15_IRQHandler /* EXTI Line 4 to 15 */ | |||
| .word TSC_IRQHandler /* TSC */ | |||
| .word DMA1_Channel1_IRQHandler /* DMA1 Channel 1 */ | |||
| .word DMA1_Channel2_3_IRQHandler /* DMA1 Channel 2 and Channel 3 */ | |||
| .word DMA1_Channel4_5_6_7_IRQHandler /* DMA1 Channel 4, Channel 5, Channel 6 and Channel 7*/ | |||
| .word ADC1_COMP_IRQHandler /* ADC1, COMP1 and COMP2 */ | |||
| .word LPTIM1_IRQHandler /* LPTIM1 */ | |||
| .word USART4_5_IRQHandler /* USART4 and USART 5 */ | |||
| .word TIM2_IRQHandler /* TIM2 */ | |||
| .word TIM3_IRQHandler /* TIM3 */ | |||
| .word TIM6_DAC_IRQHandler /* TIM6 and DAC */ | |||
| .word TIM7_IRQHandler /* TIM7 */ | |||
| .word 0 /* Reserved */ | |||
| .word TIM21_IRQHandler /* TIM21 */ | |||
| .word I2C3_IRQHandler /* I2C3 */ | |||
| .word TIM22_IRQHandler /* TIM22 */ | |||
| .word I2C1_IRQHandler /* I2C1 */ | |||
| .word I2C2_IRQHandler /* I2C2 */ | |||
| .word SPI1_IRQHandler /* SPI1 */ | |||
| .word SPI2_IRQHandler /* SPI2 */ | |||
| .word USART1_IRQHandler /* USART1 */ | |||
| .word USART2_IRQHandler /* USART2 */ | |||
| .word AES_RNG_LPUART1_IRQHandler /* AES, RNG and LPUART1 */ | |||
| .word LCD_IRQHandler /* LCD */ | |||
| .word USB_IRQHandler /* USB */ | |||
| /******************************************************************************* | |||
| * | |||
| * Provide weak aliases for each Exception handler to the Default_Handler. | |||
| * As they are weak aliases, any function with the same name will override | |||
| * this definition. | |||
| * | |||
| *******************************************************************************/ | |||
| .weak NMI_Handler | |||
| .thumb_set NMI_Handler,Default_Handler | |||
| .weak HardFault_Handler | |||
| .thumb_set HardFault_Handler,Default_Handler | |||
| .weak SVC_Handler | |||
| .thumb_set SVC_Handler,Default_Handler | |||
| .weak PendSV_Handler | |||
| .thumb_set PendSV_Handler,Default_Handler | |||
| .weak SysTick_Handler | |||
| .thumb_set SysTick_Handler,Default_Handler | |||
| .weak WWDG_IRQHandler | |||
| .thumb_set WWDG_IRQHandler,Default_Handler | |||
| .weak PVD_IRQHandler | |||
| .thumb_set PVD_IRQHandler,Default_Handler | |||
| .weak RTC_IRQHandler | |||
| .thumb_set RTC_IRQHandler,Default_Handler | |||
| .weak FLASH_IRQHandler | |||
| .thumb_set FLASH_IRQHandler,Default_Handler | |||
| .weak RCC_CRS_IRQHandler | |||
| .thumb_set RCC_CRS_IRQHandler,Default_Handler | |||
| .weak EXTI0_1_IRQHandler | |||
| .thumb_set EXTI0_1_IRQHandler,Default_Handler | |||
| .weak EXTI2_3_IRQHandler | |||
| .thumb_set EXTI2_3_IRQHandler,Default_Handler | |||
| .weak EXTI4_15_IRQHandler | |||
| .thumb_set EXTI4_15_IRQHandler,Default_Handler | |||
| .weak TSC_IRQHandler | |||
| .thumb_set TSC_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel1_IRQHandler | |||
| .thumb_set DMA1_Channel1_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel2_3_IRQHandler | |||
| .thumb_set DMA1_Channel2_3_IRQHandler,Default_Handler | |||
| .weak DMA1_Channel4_5_6_7_IRQHandler | |||
| .thumb_set DMA1_Channel4_5_6_7_IRQHandler,Default_Handler | |||
| .weak ADC1_COMP_IRQHandler | |||
| .thumb_set ADC1_COMP_IRQHandler,Default_Handler | |||
| .weak LPTIM1_IRQHandler | |||
| .thumb_set LPTIM1_IRQHandler,Default_Handler | |||
| .weak USART4_5_IRQHandler | |||
| .thumb_set USART4_5_IRQHandler,Default_Handler | |||
| .weak TIM2_IRQHandler | |||
| .thumb_set TIM2_IRQHandler,Default_Handler | |||
| .weak TIM3_IRQHandler | |||
| .thumb_set TIM3_IRQHandler,Default_Handler | |||
| .weak TIM6_DAC_IRQHandler | |||
| .thumb_set TIM6_DAC_IRQHandler,Default_Handler | |||
| .weak TIM7_IRQHandler | |||
| .thumb_set TIM7_IRQHandler,Default_Handler | |||
| .weak TIM21_IRQHandler | |||
| .thumb_set TIM21_IRQHandler,Default_Handler | |||
| .weak I2C3_IRQHandler | |||
| .thumb_set I2C3_IRQHandler,Default_Handler | |||
| .weak TIM22_IRQHandler | |||
| .thumb_set TIM22_IRQHandler,Default_Handler | |||
| .weak I2C1_IRQHandler | |||
| .thumb_set I2C1_IRQHandler,Default_Handler | |||
| .weak I2C2_IRQHandler | |||
| .thumb_set I2C2_IRQHandler,Default_Handler | |||
| .weak SPI1_IRQHandler | |||
| .thumb_set SPI1_IRQHandler,Default_Handler | |||
| .weak SPI2_IRQHandler | |||
| .thumb_set SPI2_IRQHandler,Default_Handler | |||
| .weak USART1_IRQHandler | |||
| .thumb_set USART1_IRQHandler,Default_Handler | |||
| .weak USART2_IRQHandler | |||
| .thumb_set USART2_IRQHandler,Default_Handler | |||
| .weak AES_RNG_LPUART1_IRQHandler | |||
| .thumb_set AES_RNG_LPUART1_IRQHandler,Default_Handler | |||
| .weak LCD_IRQHandler | |||
| .thumb_set LCD_IRQHandler,Default_Handler | |||
| .weak USB_IRQHandler | |||
| .thumb_set USB_IRQHandler,Default_Handler | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,292 @@ | |||
| ;/******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x4.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L010x4 Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_IRQHandler | |||
| B DMA1_Channel4_5_IRQHandler | |||
| PUBWEAK ADC1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_IRQHandler | |||
| B ADC1_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,292 @@ | |||
| ;/******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x6.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L010x6 Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_IRQHandler | |||
| B ADC1_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,292 @@ | |||
| ;/******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010x8.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L010x8 Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_IRQHandler | |||
| B ADC1_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,292 @@ | |||
| ;/******************** (C) COPYRIGHT 2018 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l010xb.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L010xB Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD 0 ; Reserved | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_IRQHandler ; ADC1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_IRQHandler | |||
| B ADC1_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,298 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l011xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L011xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_IRQHandler | |||
| B DMA1_Channel4_5_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,297 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l021xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L021xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_IRQHandler ; DMA1 Channel 4 and Channel 5 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; AES and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =sfe(CSTACK) ; set stack pointer | |||
| MSR MSP, R0 | |||
| ;;Check if boot space corresponds to system memory | |||
| LDR R0,=0x00000004 | |||
| LDR R1, [R0] | |||
| LSRS R1, R1, #24 | |||
| LDR R2,=0x1F | |||
| CMP R1, R2 | |||
| BNE ApplicationStart | |||
| ;; SYSCFG clock enable | |||
| LDR R0,=0x40021034 | |||
| LDR R1,=0x00000001 | |||
| STR R1, [R0] | |||
| ;; Set CFGR1 register with flash memory remap at address 0 | |||
| LDR R0,=0x40010000 | |||
| LDR R1,=0x00000000 | |||
| STR R1, [R0] | |||
| ApplicationStart | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_IRQHandler | |||
| B DMA1_Channel4_5_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_LPUART1_IRQHandler | |||
| B AES_LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,284 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l031xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L031xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,285 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l041xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L041xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD 0 ; Reserved | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; AES and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_LPUART1_IRQHandler | |||
| B AES_LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,307 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l051xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L051xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_IRQHandler | |||
| B TIM6_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,319 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l052xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L052xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RNG_LPUART1_IRQHandler | |||
| B RNG_LPUART1_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,324 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l053xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L053xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RNG_LPUART1_IRQHandler | |||
| B RNG_LPUART1_IRQHandler | |||
| PUBWEAK LCD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LCD_IRQHandler | |||
| B LCD_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,307 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l061xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L061xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; AES and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_IRQHandler | |||
| B TIM6_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_LPUART1_IRQHandler | |||
| B AES_LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,319 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l062xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L062xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_RNG_LPUART1_IRQHandler | |||
| B AES_RNG_LPUART1_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,324 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l063xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L063xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD 0 ; Reserved | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD 0 ; Reserved | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD 0 ; Reserved | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_RNG_LPUART1_IRQHandler | |||
| B AES_RNG_LPUART1_IRQHandler | |||
| PUBWEAK LCD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LCD_IRQHandler | |||
| B LCD_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,329 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l071xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L071xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD LPUART1_IRQHandler ; LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_IRQHandler | |||
| B TIM6_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPUART1_IRQHandler | |||
| B LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,341 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l072xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L072xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RNG_LPUART1_IRQHandler | |||
| B RNG_LPUART1_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,346 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l073xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L073xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD RNG_LPUART1_IRQHandler ; RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RNG_LPUART1_IRQHandler | |||
| B RNG_LPUART1_IRQHandler | |||
| PUBWEAK LCD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LCD_IRQHandler | |||
| B LCD_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,329 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l081xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L081xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_IRQHandler ; RCC | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD 0 ; Reserved | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_IRQHandler ; TIM6 | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_LPUART1_IRQHandler ; AES and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_IRQHandler | |||
| B RCC_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_IRQHandler | |||
| B TIM6_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_LPUART1_IRQHandler | |||
| B AES_LPUART1_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,341 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l082xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L082xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD 0 ; Reserved | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_RNG_LPUART1_IRQHandler | |||
| B AES_RNG_LPUART1_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,346 @@ | |||
| ;/******************** (C) COPYRIGHT 2016 STMicroelectronics ******************** | |||
| ;* File Name : startup_stm32l083xx.s | |||
| ;* Author : MCD Application Team | |||
| ;* Description : STM32L083xx Ultra Low Power Devices vector | |||
| ;* This module performs: | |||
| ;* - Set the initial SP | |||
| ;* - Set the initial PC == _iar_program_start, | |||
| ;* - Set the vector table entries with the exceptions ISR | |||
| ;* address. | |||
| ;* - Configure the system clock | |||
| ;* - Branches to main in the C library (which eventually | |||
| ;* calls main()). | |||
| ;* After Reset the Cortex-M0+ processor is in Thread mode, | |||
| ;* priority is Privileged, and the Stack is set to Main. | |||
| ;******************************************************************************** | |||
| ;* | |||
| ;* Redistribution and use in source and binary forms, with or without modification, | |||
| ;* are permitted provided that the following conditions are met: | |||
| ;* 1. Redistributions of source code must retain the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer. | |||
| ;* 2. Redistributions in binary form must reproduce the above copyright notice, | |||
| ;* this list of conditions and the following disclaimer in the documentation | |||
| ;* and/or other materials provided with the distribution. | |||
| ;* 3. Neither the name of STMicroelectronics nor the names of its contributors | |||
| ;* may be used to endorse or promote products derived from this software | |||
| ;* without specific prior written permission. | |||
| ;* | |||
| ;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |||
| ;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |||
| ;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | |||
| ;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | |||
| ;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | |||
| ;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | |||
| ;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | |||
| ;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | |||
| ;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
| ;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
| ;* | |||
| ;*******************************************************************************/ | |||
| ; | |||
| ; | |||
| ; The modules in this file are included in the libraries, and may be replaced | |||
| ; by any user-defined modules that define the PUBLIC symbol _program_start or | |||
| ; a user defined start symbol. | |||
| ; To override the cstartup defined in the library, simply add your modified | |||
| ; version to the workbench project. | |||
| ; | |||
| ; The vector table is normally located at address 0. | |||
| ; When debugging in RAM, it can be located in RAM, aligned to at least 2^6. | |||
| ; The name "__vector_table" has special meaning for C-SPY: | |||
| ; it is where the SP start value is found, and the NVIC vector | |||
| ; table register (VTOR) is initialized to this address if != 0. | |||
| ; | |||
| ; Cortex-M version | |||
| ; | |||
| MODULE ?cstartup | |||
| ;; Forward declaration of sections. | |||
| SECTION CSTACK:DATA:NOROOT(3) | |||
| SECTION .intvec:CODE:NOROOT(2) | |||
| EXTERN __iar_program_start | |||
| EXTERN SystemInit | |||
| PUBLIC __vector_table | |||
| DATA | |||
| __vector_table | |||
| DCD sfe(CSTACK) | |||
| DCD Reset_Handler ; Reset Handler | |||
| DCD NMI_Handler ; NMI Handler | |||
| DCD HardFault_Handler ; Hard Fault Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD SVC_Handler ; SVCall Handler | |||
| DCD 0 ; Reserved | |||
| DCD 0 ; Reserved | |||
| DCD PendSV_Handler ; PendSV Handler | |||
| DCD SysTick_Handler ; SysTick Handler | |||
| ; External Interrupts | |||
| DCD WWDG_IRQHandler ; Window Watchdog | |||
| DCD PVD_IRQHandler ; PVD through EXTI Line detect | |||
| DCD RTC_IRQHandler ; RTC through EXTI Line | |||
| DCD FLASH_IRQHandler ; FLASH | |||
| DCD RCC_CRS_IRQHandler ; RCC_CRS | |||
| DCD EXTI0_1_IRQHandler ; EXTI Line 0 and 1 | |||
| DCD EXTI2_3_IRQHandler ; EXTI Line 2 and 3 | |||
| DCD EXTI4_15_IRQHandler ; EXTI Line 4 to 15 | |||
| DCD TSC_IRQHandler ; TSC | |||
| DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 | |||
| DCD DMA1_Channel2_3_IRQHandler ; DMA1 Channel 2 and Channel 3 | |||
| DCD DMA1_Channel4_5_6_7_IRQHandler ; DMA1 Channel 4, Channel 5, Channel 6 and Channel 7 | |||
| DCD ADC1_COMP_IRQHandler ; ADC1, COMP1 and COMP2 | |||
| DCD LPTIM1_IRQHandler ; LPTIM1 | |||
| DCD USART4_5_IRQHandler ; USART4 and USART5 | |||
| DCD TIM2_IRQHandler ; TIM2 | |||
| DCD TIM3_IRQHandler ; TIM3 | |||
| DCD TIM6_DAC_IRQHandler ; TIM6 and DAC | |||
| DCD TIM7_IRQHandler ; TIM7 | |||
| DCD 0 ; Reserved | |||
| DCD TIM21_IRQHandler ; TIM21 | |||
| DCD I2C3_IRQHandler ; I2C3 | |||
| DCD TIM22_IRQHandler ; TIM22 | |||
| DCD I2C1_IRQHandler ; I2C1 | |||
| DCD I2C2_IRQHandler ; I2C2 | |||
| DCD SPI1_IRQHandler ; SPI1 | |||
| DCD SPI2_IRQHandler ; SPI2 | |||
| DCD USART1_IRQHandler ; USART1 | |||
| DCD USART2_IRQHandler ; USART2 | |||
| DCD AES_RNG_LPUART1_IRQHandler ; AES, RNG and LPUART1 | |||
| DCD LCD_IRQHandler ; LCD | |||
| DCD USB_IRQHandler ; USB | |||
| ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
| ;; | |||
| ;; Default interrupt handlers. | |||
| ;; | |||
| THUMB | |||
| PUBWEAK Reset_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(2) | |||
| Reset_Handler | |||
| LDR R0, =SystemInit | |||
| BLX R0 | |||
| LDR R0, =__iar_program_start | |||
| BX R0 | |||
| PUBWEAK NMI_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| NMI_Handler | |||
| B NMI_Handler | |||
| PUBWEAK HardFault_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| HardFault_Handler | |||
| B HardFault_Handler | |||
| PUBWEAK SVC_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SVC_Handler | |||
| B SVC_Handler | |||
| PUBWEAK PendSV_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PendSV_Handler | |||
| B PendSV_Handler | |||
| PUBWEAK SysTick_Handler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SysTick_Handler | |||
| B SysTick_Handler | |||
| PUBWEAK WWDG_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| WWDG_IRQHandler | |||
| B WWDG_IRQHandler | |||
| PUBWEAK PVD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| PVD_IRQHandler | |||
| B PVD_IRQHandler | |||
| PUBWEAK RTC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RTC_IRQHandler | |||
| B RTC_IRQHandler | |||
| PUBWEAK FLASH_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| FLASH_IRQHandler | |||
| B FLASH_IRQHandler | |||
| PUBWEAK RCC_CRS_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| RCC_CRS_IRQHandler | |||
| B RCC_CRS_IRQHandler | |||
| PUBWEAK EXTI0_1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI0_1_IRQHandler | |||
| B EXTI0_1_IRQHandler | |||
| PUBWEAK EXTI2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI2_3_IRQHandler | |||
| B EXTI2_3_IRQHandler | |||
| PUBWEAK EXTI4_15_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| EXTI4_15_IRQHandler | |||
| B EXTI4_15_IRQHandler | |||
| PUBWEAK TSC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TSC_IRQHandler | |||
| B TSC_IRQHandler | |||
| PUBWEAK DMA1_Channel1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel1_IRQHandler | |||
| B DMA1_Channel1_IRQHandler | |||
| PUBWEAK DMA1_Channel2_3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel2_3_IRQHandler | |||
| B DMA1_Channel2_3_IRQHandler | |||
| PUBWEAK DMA1_Channel4_5_6_7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| DMA1_Channel4_5_6_7_IRQHandler | |||
| B DMA1_Channel4_5_6_7_IRQHandler | |||
| PUBWEAK ADC1_COMP_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| ADC1_COMP_IRQHandler | |||
| B ADC1_COMP_IRQHandler | |||
| PUBWEAK LPTIM1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LPTIM1_IRQHandler | |||
| B LPTIM1_IRQHandler | |||
| PUBWEAK USART4_5_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART4_5_IRQHandler | |||
| B USART4_5_IRQHandler | |||
| PUBWEAK TIM2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM2_IRQHandler | |||
| B TIM2_IRQHandler | |||
| PUBWEAK TIM3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM3_IRQHandler | |||
| B TIM3_IRQHandler | |||
| PUBWEAK TIM6_DAC_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM6_DAC_IRQHandler | |||
| B TIM6_DAC_IRQHandler | |||
| PUBWEAK TIM7_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM7_IRQHandler | |||
| B TIM7_IRQHandler | |||
| PUBWEAK TIM21_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM21_IRQHandler | |||
| B TIM21_IRQHandler | |||
| PUBWEAK I2C3_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C3_IRQHandler | |||
| B I2C3_IRQHandler | |||
| PUBWEAK TIM22_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| TIM22_IRQHandler | |||
| B TIM22_IRQHandler | |||
| PUBWEAK I2C1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C1_IRQHandler | |||
| B I2C1_IRQHandler | |||
| PUBWEAK I2C2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| I2C2_IRQHandler | |||
| B I2C2_IRQHandler | |||
| PUBWEAK SPI1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI1_IRQHandler | |||
| B SPI1_IRQHandler | |||
| PUBWEAK SPI2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| SPI2_IRQHandler | |||
| B SPI2_IRQHandler | |||
| PUBWEAK USART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART1_IRQHandler | |||
| B USART1_IRQHandler | |||
| PUBWEAK USART2_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USART2_IRQHandler | |||
| B USART2_IRQHandler | |||
| PUBWEAK AES_RNG_LPUART1_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| AES_RNG_LPUART1_IRQHandler | |||
| B AES_RNG_LPUART1_IRQHandler | |||
| PUBWEAK LCD_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| LCD_IRQHandler | |||
| B LCD_IRQHandler | |||
| PUBWEAK USB_IRQHandler | |||
| SECTION .text:CODE:NOROOT:REORDER(1) | |||
| USB_IRQHandler | |||
| B USB_IRQHandler | |||
| END | |||
| ;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** | |||
| @@ -0,0 +1,279 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file system_stm32l0xx.c | |||
| * @author MCD Application Team | |||
| * @brief CMSIS Cortex-M0+ Device Peripheral Access Layer System Source File. | |||
| * | |||
| * This file provides two functions and one global variable to be called from | |||
| * user application: | |||
| * - SystemInit(): This function is called at startup just after reset and | |||
| * before branch to main program. This call is made inside | |||
| * the "startup_stm32l0xx.s" file. | |||
| * | |||
| * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used | |||
| * by the user application to setup the SysTick | |||
| * timer or configure other parameters. | |||
| * | |||
| * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must | |||
| * be called whenever the core clock is changed | |||
| * during program execution. | |||
| * | |||
| * | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /** @addtogroup CMSIS | |||
| * @{ | |||
| */ | |||
| /** @addtogroup stm32l0xx_system | |||
| * @{ | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_Includes | |||
| * @{ | |||
| */ | |||
| #include "stm32l0xx.h" | |||
| #if !defined (HSE_VALUE) | |||
| #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ | |||
| #endif /* HSE_VALUE */ | |||
| #if !defined (MSI_VALUE) | |||
| #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ | |||
| #endif /* MSI_VALUE */ | |||
| #if !defined (HSI_VALUE) | |||
| #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ | |||
| #endif /* HSI_VALUE */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_TypesDefinitions | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_Defines | |||
| * @{ | |||
| */ | |||
| /************************* Miscellaneous Configuration ************************/ | |||
| /*!< Uncomment the following line if you need to relocate your vector Table in | |||
| Internal SRAM. */ | |||
| /* #define VECT_TAB_SRAM */ | |||
| #define VECT_TAB_OFFSET 0x00U /*!< Vector Table base offset field. | |||
| This value must be a multiple of 0x100. */ | |||
| /******************************************************************************/ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_Macros | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_Variables | |||
| * @{ | |||
| */ | |||
| /* This variable is updated in three ways: | |||
| 1) by calling CMSIS function SystemCoreClockUpdate() | |||
| 2) by calling HAL API function HAL_RCC_GetHCLKFreq() | |||
| 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency | |||
| Note: If you use this function to configure the system clock; then there | |||
| is no need to call the 2 first functions listed above, since SystemCoreClock | |||
| variable is updated automatically. | |||
| */ | |||
| uint32_t SystemCoreClock = 2097152U; /* 32.768 kHz * 2^6 */ | |||
| const uint8_t AHBPrescTable[16] = {0U, 0U, 0U, 0U, 0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U, 6U, 7U, 8U, 9U}; | |||
| const uint8_t APBPrescTable[8] = {0U, 0U, 0U, 0U, 1U, 2U, 3U, 4U}; | |||
| const uint8_t PLLMulTable[9] = {3U, 4U, 6U, 8U, 12U, 16U, 24U, 32U, 48U}; | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_FunctionPrototypes | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup STM32L0xx_System_Private_Functions | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Setup the microcontroller system. | |||
| * @param None | |||
| * @retval None | |||
| */ | |||
| void SystemInit (void) | |||
| { | |||
| /*!< Set MSION bit */ | |||
| RCC->CR |= (uint32_t)0x00000100U; | |||
| /*!< Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], MCOSEL[2:0] and MCOPRE[2:0] bits */ | |||
| RCC->CFGR &= (uint32_t) 0x88FF400CU; | |||
| /*!< Reset HSION, HSIDIVEN, HSEON, CSSON and PLLON bits */ | |||
| RCC->CR &= (uint32_t)0xFEF6FFF6U; | |||
| /*!< Reset HSI48ON bit */ | |||
| RCC->CRRCR &= (uint32_t)0xFFFFFFFEU; | |||
| /*!< Reset HSEBYP bit */ | |||
| RCC->CR &= (uint32_t)0xFFFBFFFFU; | |||
| /*!< Reset PLLSRC, PLLMUL[3:0] and PLLDIV[1:0] bits */ | |||
| RCC->CFGR &= (uint32_t)0xFF02FFFFU; | |||
| /*!< Disable all interrupts */ | |||
| RCC->CIER = 0x00000000U; | |||
| /* Configure the Vector Table location add offset address ------------------*/ | |||
| #ifdef VECT_TAB_SRAM | |||
| SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */ | |||
| #else | |||
| SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH */ | |||
| #endif | |||
| } | |||
| /** | |||
| * @brief Update SystemCoreClock according to Clock Register Values | |||
| * The SystemCoreClock variable contains the core clock (HCLK), it can | |||
| * be used by the user application to setup the SysTick timer or configure | |||
| * other parameters. | |||
| * | |||
| * @note Each time the core clock (HCLK) changes, this function must be called | |||
| * to update SystemCoreClock variable value. Otherwise, any configuration | |||
| * based on this variable will be incorrect. | |||
| * | |||
| * @note - The system frequency computed by this function is not the real | |||
| * frequency in the chip. It is calculated based on the predefined | |||
| * constant and the selected clock source: | |||
| * | |||
| * - If SYSCLK source is MSI, SystemCoreClock will contain the MSI | |||
| * value as defined by the MSI range. | |||
| * | |||
| * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*) | |||
| * | |||
| * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**) | |||
| * | |||
| * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**) | |||
| * or HSI_VALUE(*) multiplied/divided by the PLL factors. | |||
| * | |||
| * (*) HSI_VALUE is a constant defined in stm32l0xx_hal.h file (default value | |||
| * 16 MHz) but the real value may vary depending on the variations | |||
| * in voltage and temperature. | |||
| * | |||
| * (**) HSE_VALUE is a constant defined in stm32l0xx_hal.h file (default value | |||
| * 8 MHz), user has to ensure that HSE_VALUE is same as the real | |||
| * frequency of the crystal used. Otherwise, this function may | |||
| * have wrong result. | |||
| * | |||
| * - The result of this function could be not correct when using fractional | |||
| * value for HSE crystal. | |||
| * @param None | |||
| * @retval None | |||
| */ | |||
| void SystemCoreClockUpdate (void) | |||
| { | |||
| uint32_t tmp = 0U, pllmul = 0U, plldiv = 0U, pllsource = 0U, msirange = 0U; | |||
| /* Get SYSCLK source -------------------------------------------------------*/ | |||
| tmp = RCC->CFGR & RCC_CFGR_SWS; | |||
| switch (tmp) | |||
| { | |||
| case 0x00U: /* MSI used as system clock */ | |||
| msirange = (RCC->ICSCR & RCC_ICSCR_MSIRANGE) >> RCC_ICSCR_MSIRANGE_Pos; | |||
| SystemCoreClock = (32768U * (1U << (msirange + 1U))); | |||
| break; | |||
| case 0x04U: /* HSI used as system clock */ | |||
| if ((RCC->CR & RCC_CR_HSIDIVF) != 0U) | |||
| { | |||
| SystemCoreClock = HSI_VALUE / 4U; | |||
| } | |||
| else | |||
| { | |||
| SystemCoreClock = HSI_VALUE; | |||
| } | |||
| break; | |||
| case 0x08U: /* HSE used as system clock */ | |||
| SystemCoreClock = HSE_VALUE; | |||
| break; | |||
| default: /* PLL used as system clock */ | |||
| /* Get PLL clock source and multiplication factor ----------------------*/ | |||
| pllmul = RCC->CFGR & RCC_CFGR_PLLMUL; | |||
| plldiv = RCC->CFGR & RCC_CFGR_PLLDIV; | |||
| pllmul = PLLMulTable[(pllmul >> RCC_CFGR_PLLMUL_Pos)]; | |||
| plldiv = (plldiv >> RCC_CFGR_PLLDIV_Pos) + 1U; | |||
| pllsource = RCC->CFGR & RCC_CFGR_PLLSRC; | |||
| if (pllsource == 0x00U) | |||
| { | |||
| /* HSI oscillator clock selected as PLL clock entry */ | |||
| if ((RCC->CR & RCC_CR_HSIDIVF) != 0U) | |||
| { | |||
| SystemCoreClock = (((HSI_VALUE / 4U) * pllmul) / plldiv); | |||
| } | |||
| else | |||
| { | |||
| SystemCoreClock = (((HSI_VALUE) * pllmul) / plldiv); | |||
| } | |||
| } | |||
| else | |||
| { | |||
| /* HSE selected as PLL clock entry */ | |||
| SystemCoreClock = (((HSE_VALUE) * pllmul) / plldiv); | |||
| } | |||
| break; | |||
| } | |||
| /* Compute HCLK clock frequency --------------------------------------------*/ | |||
| /* Get HCLK prescaler */ | |||
| tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> RCC_CFGR_HPRE_Pos)]; | |||
| /* HCLK clock frequency */ | |||
| SystemCoreClock >>= tmp; | |||
| } | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,57 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32_assert.h | |||
| * @author MCD Application Team | |||
| * @brief STM32 assert template file. | |||
| * This file should be copied to the application folder and renamed | |||
| * to stm32_assert.h. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32_ASSERT_H | |||
| #define __STM32_ASSERT_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| #ifdef USE_FULL_ASSERT | |||
| /** | |||
| * @brief The assert_param macro is used for function's parameters check. | |||
| * @param expr If expr is false, it calls assert_failed function | |||
| * which reports the name of the source file and the source | |||
| * line number of the call that failed. | |||
| * If expr is true, it returns no value. | |||
| * @retval None | |||
| */ | |||
| #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) | |||
| /* Exported functions ------------------------------------------------------- */ | |||
| void assert_failed(uint8_t* file, uint32_t line); | |||
| #else | |||
| #define assert_param(expr) ((void)0U) | |||
| #endif /* USE_FULL_ASSERT */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32_ASSERT_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,456 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal.h | |||
| * @author MCD Application Team | |||
| * @brief This file contains all the functions prototypes for the HAL | |||
| * module driver. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_H | |||
| #define __STM32L0xx_HAL_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_conf.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup HAL HAL | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup HAL_Exported_Constants HAL Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup SYSCFG_BootMode Boot Mode | |||
| * @{ | |||
| */ | |||
| #define SYSCFG_BOOT_MAINFLASH ((uint32_t)0x00000000U) | |||
| #define SYSCFG_BOOT_SYSTEMFLASH ((uint32_t)SYSCFG_CFGR1_BOOT_MODE_0) | |||
| #define SYSCFG_BOOT_SRAM ((uint32_t)SYSCFG_CFGR1_BOOT_MODE) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DBGMCU_Low_Power_Config DBGMCU Low Power Configuration | |||
| * @{ | |||
| */ | |||
| #define DBGMCU_SLEEP DBGMCU_CR_DBG_SLEEP | |||
| #define DBGMCU_STOP DBGMCU_CR_DBG_STOP | |||
| #define DBGMCU_STANDBY DBGMCU_CR_DBG_STANDBY | |||
| #define IS_DBGMCU_PERIPH(__PERIPH__) ((((__PERIPH__) & (~(DBGMCU_CR_DBG))) == 0x00U) && ((__PERIPH__) != 0x00U)) | |||
| /** | |||
| * @} | |||
| */ | |||
| #if defined (LCD_BASE) /* STM32L0x3xx only */ | |||
| /** @defgroup SYSCFG_LCD_EXT_CAPA SYSCFG LCD External Capacitors | |||
| * @{ | |||
| */ | |||
| #define SYSCFG_LCD_EXT_CAPA SYSCFG_CFGR2_CAPA /*!< Connection of internal Vlcd rail to external capacitors */ | |||
| #define SYSCFG_VLCD_PB2_EXT_CAPA_ON SYSCFG_CFGR2_CAPA_0 /*!< Connection on PB2 */ | |||
| #define SYSCFG_VLCD_PB12_EXT_CAPA_ON SYSCFG_CFGR2_CAPA_1 /*!< Connection on PB12 */ | |||
| #define SYSCFG_VLCD_PB0_EXT_CAPA_ON SYSCFG_CFGR2_CAPA_2 /*!< Connection on PB0 */ | |||
| #if defined (SYSCFG_CFGR2_CAPA_3) | |||
| #define SYSCFG_VLCD_PE11_EXT_CAPA_ON SYSCFG_CFGR2_CAPA_3 /*!< Connection on PE11 */ | |||
| #endif | |||
| #if defined (SYSCFG_CFGR2_CAPA_4) | |||
| #define SYSCFG_VLCD_PE12_EXT_CAPA_ON SYSCFG_CFGR2_CAPA_4 /*!< Connection on PE12 */ | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif | |||
| /** @defgroup SYSCFG_VREFINT_OUT_SELECT SYSCFG VREFINT Out Selection | |||
| * @{ | |||
| */ | |||
| #define SYSCFG_VREFINT_OUT_NONE ((uint32_t)0x00000000U) /* no pad connected */ | |||
| #define SYSCFG_VREFINT_OUT_PB0 SYSCFG_CFGR3_VREF_OUT_0 /* Selects PBO as output for the Vrefint */ | |||
| #define SYSCFG_VREFINT_OUT_PB1 SYSCFG_CFGR3_VREF_OUT_1 /* Selects PB1 as output for the Vrefint */ | |||
| #define SYSCFG_VREFINT_OUT_PB0_PB1 SYSCFG_CFGR3_VREF_OUT /* Selects PBO and PB1 as output for the Vrefint */ | |||
| #define IS_SYSCFG_VREFINT_OUT_SELECT(OUTPUT) (((OUTPUT) == SYSCFG_VREFINT_OUT_NONE) || \ | |||
| ((OUTPUT) == SYSCFG_VREFINT_OUT_PB0) || \ | |||
| ((OUTPUT) == SYSCFG_VREFINT_OUT_PB1) || \ | |||
| ((OUTPUT) == SYSCFG_VREFINT_OUT_PB0_PB1)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup SYSCFG_flags_definition SYSCFG Flags Definition | |||
| * @{ | |||
| */ | |||
| #define SYSCFG_FLAG_VREFINT_READY SYSCFG_CFGR3_VREFINT_RDYF | |||
| #define IS_SYSCFG_FLAG(FLAG) ((FLAG) == SYSCFG_FLAG_VREFINT_READY)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup SYSCFG_FastModePlus_GPIO Fast Mode Plus on GPIO | |||
| * @{ | |||
| */ | |||
| /** @brief Fast mode Plus driving capability on a specific GPIO | |||
| */ | |||
| #if defined (SYSCFG_CFGR2_I2C_PB6_FMP) | |||
| #define SYSCFG_FASTMODEPLUS_PB6 SYSCFG_CFGR2_I2C_PB6_FMP /* Enable Fast Mode Plus on PB6 */ | |||
| #endif | |||
| #if defined (SYSCFG_CFGR2_I2C_PB7_FMP) | |||
| #define SYSCFG_FASTMODEPLUS_PB7 SYSCFG_CFGR2_I2C_PB7_FMP /* Enable Fast Mode Plus on PB7 */ | |||
| #endif | |||
| #if defined (SYSCFG_CFGR2_I2C_PB8_FMP) | |||
| #define SYSCFG_FASTMODEPLUS_PB8 SYSCFG_CFGR2_I2C_PB8_FMP /* Enable Fast Mode Plus on PB8 */ | |||
| #endif | |||
| #if defined (SYSCFG_CFGR2_I2C_PB9_FMP) | |||
| #define SYSCFG_FASTMODEPLUS_PB9 SYSCFG_CFGR2_I2C_PB9_FMP /* Enable Fast Mode Plus on PB9 */ | |||
| #endif | |||
| #define IS_SYSCFG_FASTMODEPLUS(PIN) ((((PIN) & (SYSCFG_FASTMODEPLUS_PB6)) == SYSCFG_FASTMODEPLUS_PB6) || \ | |||
| (((PIN) & (SYSCFG_FASTMODEPLUS_PB7)) == SYSCFG_FASTMODEPLUS_PB7) || \ | |||
| (((PIN) & (SYSCFG_FASTMODEPLUS_PB8)) == SYSCFG_FASTMODEPLUS_PB8) || \ | |||
| (((PIN) & (SYSCFG_FASTMODEPLUS_PB9)) == SYSCFG_FASTMODEPLUS_PB9) ) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macros -----------------------------------------------------------*/ | |||
| /** @defgroup HAL_Exported_Macros HAL Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Freeze/Unfreeze Peripherals in Debug mode | |||
| */ | |||
| #if defined (DBGMCU_APB1_FZ_DBG_TIM2_STOP) | |||
| /** | |||
| * @brief TIM2 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM2() SET_BIT(DBGMCU->APB1FZ,DBGMCU_APB1_FZ_DBG_TIM2_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM2() CLEAR_BIT(DBGMCU->APB1FZ,DBGMCU_APB1_FZ_DBG_TIM2_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_TIM3_STOP) | |||
| /** | |||
| * @brief TIM3 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM3() SET_BIT(DBGMCU->APB1FZ,DBGMCU_APB1_FZ_DBG_TIM3_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM3() CLEAR_BIT(DBGMCU->APB1FZ,DBGMCU_APB1_FZ_DBG_TIM3_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_TIM6_STOP) | |||
| /** | |||
| * @brief TIM6 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM6() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM6() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM6_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_TIM7_STOP) | |||
| /** | |||
| * @brief TIM7 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM7() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM7() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_TIM7_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_RTC_STOP) | |||
| /** | |||
| * @brief RTC Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_RTC() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_RTC() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_RTC_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_WWDG_STOP) | |||
| /** | |||
| * @brief WWDG Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_WWDG_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_IWDG_STOP) | |||
| /** | |||
| * @brief IWDG Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_IWDG_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_I2C1_STOP) | |||
| /** | |||
| * @brief I2C1 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_I2C1_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_I2C1_TIMEOUT_DBGMCU() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C1_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_I2C2_STOP) | |||
| /** | |||
| * @brief I2C2 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_I2C2_TIMEOUT_DBGMCU() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_I2C2_TIMEOUT_DBGMCU() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C2_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_I2C3_STOP) | |||
| /** | |||
| * @brief I2C3 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_I2C3_TIMEOUT() SET_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C3_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_I2C3_TIMEOUT() CLEAR_BIT(DBGMCU->APB1FZ, DBGMCU_APB1_FZ_DBG_I2C3_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB1_FZ_DBG_LPTIMER_STOP) | |||
| /** | |||
| * @brief LPTIMER Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_LPTIMER() SET_BIT(DBGMCU->APB1FZ ,DBGMCU_APB1_FZ_DBG_LPTIMER_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_LPTIMER() CLEAR_BIT(DBGMCU->APB1FZ ,DBGMCU_APB1_FZ_DBG_LPTIMER_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB2_FZ_DBG_TIM22_STOP) | |||
| /** | |||
| * @brief TIM22 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM22() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM22_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM22() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM22_STOP) | |||
| #endif | |||
| #if defined (DBGMCU_APB2_FZ_DBG_TIM21_STOP) | |||
| /** | |||
| * @brief TIM21 Peripherals Debug mode | |||
| */ | |||
| #define __HAL_DBGMCU_FREEZE_TIM21() SET_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM21_STOP) | |||
| #define __HAL_DBGMCU_UNFREEZE_TIM21() CLEAR_BIT(DBGMCU->APB2FZ, DBGMCU_APB2_FZ_DBG_TIM21_STOP) | |||
| #endif | |||
| /** @brief Main Flash memory mapped at 0x00000000 | |||
| */ | |||
| #define __HAL_SYSCFG_REMAPMEMORY_FLASH() CLEAR_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE) | |||
| /** @brief System Flash memory mapped at 0x00000000 | |||
| */ | |||
| #define __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH() MODIFY_REG(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE, SYSCFG_CFGR1_MEM_MODE_0) | |||
| /** @brief Embedded SRAM mapped at 0x00000000 | |||
| */ | |||
| #define __HAL_SYSCFG_REMAPMEMORY_SRAM() MODIFY_REG(SYSCFG->CFGR1, SYSCFG_CFGR1_MEM_MODE, SYSCFG_CFGR1_MEM_MODE_0 | SYSCFG_CFGR1_MEM_MODE_1) | |||
| /** @brief Configuration of the DBG Low Power mode. | |||
| * @param __DBGLPMODE__ bit field to indicate in wich Low Power mode DBG is still active. | |||
| * This parameter can be a value of | |||
| * - DBGMCU_SLEEP | |||
| * - DBGMCU_STOP | |||
| * - DBGMCU_STANDBY | |||
| */ | |||
| #define __HAL_SYSCFG_DBG_LP_CONFIG(__DBGLPMODE__) do {assert_param(IS_DBGMCU_PERIPH(__DBGLPMODE__)); \ | |||
| MODIFY_REG(DBGMCU->CR, DBGMCU_CR_DBG, (__DBGLPMODE__)); \ | |||
| } while (0) | |||
| #if defined (LCD_BASE) /* STM32L0x3xx only */ | |||
| /** @brief Macro to configure the VLCD Decoupling capacitance connection. | |||
| * | |||
| * @param __SYSCFG_VLCD_CAPA__ specifies the decoupling of LCD capacitance for rails connection on GPIO. | |||
| * This parameter can be a combination of following values (when available): | |||
| * @arg SYSCFG_VLCD_PB2_EXT_CAPA_ON: Connection on PB2 | |||
| * @arg SYSCFG_VLCD_PB12_EXT_CAPA_ON: Connection on PB12 | |||
| * @arg SYSCFG_VLCD_PB0_EXT_CAPA_ON: Connection on PB0 | |||
| * @arg SYSCFG_VLCD_PE11_EXT_CAPA_ON: Connection on PE11 | |||
| * @arg SYSCFG_VLCD_PE12_EXT_CAPA_ON: Connection on PE12 | |||
| * @retval None | |||
| */ | |||
| #define __HAL_SYSCFG_VLCD_CAPA_CONFIG(__SYSCFG_VLCD_CAPA__) \ | |||
| MODIFY_REG(SYSCFG->CFGR2, SYSCFG_LCD_EXT_CAPA, (uint32_t)(__SYSCFG_VLCD_CAPA__)) | |||
| /** | |||
| * @brief Returns the decoupling of LCD capacitance configured by user. | |||
| * @retval The LCD capacitance connection as configured by user. The returned can be a combination of : | |||
| * SYSCFG_VLCD_PB2_EXT_CAPA_ON: Connection on PB2 | |||
| * SYSCFG_VLCD_PB12_EXT_CAPA_ON: Connection on PB12 | |||
| * SYSCFG_VLCD_PB0_EXT_CAPA_ON: Connection on PB0 | |||
| * SYSCFG_VLCD_PE11_EXT_CAPA_ON: Connection on PE11 | |||
| * SYSCFG_VLCD_PE12_EXT_CAPA_ON: Connection on PE12 | |||
| */ | |||
| #define __HAL_SYSCFG_GET_VLCD_CAPA_CONFIG() READ_BIT(SYSCFG->CFGR2, SYSCFG_LCD_EXT_CAPA) | |||
| #endif | |||
| /** | |||
| * @brief Returns the boot mode as configured by user. | |||
| * @retval The boot mode as configured by user. The returned can be a value of : | |||
| * - SYSCFG_BOOT_MAINFLASH | |||
| * - SYSCFG_BOOT_SYSTEMFLASH | |||
| * - SYSCFG_BOOT_SRAM | |||
| */ | |||
| #define __HAL_SYSCFG_GET_BOOT_MODE() READ_BIT(SYSCFG->CFGR1, SYSCFG_CFGR1_BOOT_MODE) | |||
| /** @brief Check whether the specified SYSCFG flag is set or not. | |||
| * @param __FLAG__ specifies the flag to check. | |||
| * The only parameter supported is SYSCFG_FLAG_VREFINT_READY | |||
| * @retval The new state of __FLAG__ (TRUE or FALSE). | |||
| */ | |||
| #define __HAL_SYSCFG_GET_FLAG(__FLAG__) (((SYSCFG->CFGR3) & (__FLAG__)) == (__FLAG__)) | |||
| /** @brief Fast mode Plus driving capability enable macro | |||
| * @param __FASTMODEPLUS__ This parameter can be a value of : | |||
| * @arg SYSCFG_FASTMODEPLUS_PB6 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB7 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB8 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB9 | |||
| */ | |||
| #define __HAL_SYSCFG_FASTMODEPLUS_ENABLE(__FASTMODEPLUS__) do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__))); \ | |||
| SET_BIT(SYSCFG->CFGR2, (__FASTMODEPLUS__)); \ | |||
| }while(0) | |||
| /** @brief Fast mode Plus driving capability disable macro | |||
| * @param __FASTMODEPLUS__ This parameter can be a value of : | |||
| * @arg SYSCFG_FASTMODEPLUS_PB6 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB7 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB8 | |||
| * @arg SYSCFG_FASTMODEPLUS_PB9 | |||
| */ | |||
| #define __HAL_SYSCFG_FASTMODEPLUS_DISABLE(__FASTMODEPLUS__) do {assert_param(IS_SYSCFG_FASTMODEPLUS((__FASTMODEPLUS__))); \ | |||
| CLEAR_BIT(SYSCFG->CFGR2, (__FASTMODEPLUS__)); \ | |||
| }while(0) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported variables --------------------------------------------------------*/ | |||
| /** @defgroup HAL_Exported_Variables HAL Exported Variables | |||
| * @{ | |||
| */ | |||
| extern __IO uint32_t uwTick; | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup HAL_Exported_Functions HAL Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup HAL_Exported_Functions_Group1 Initialization and de-initialization functions | |||
| * @brief Initialization and de-initialization functions | |||
| * @{ | |||
| */ | |||
| HAL_StatusTypeDef HAL_Init(void); | |||
| HAL_StatusTypeDef HAL_DeInit(void); | |||
| void HAL_MspInit(void); | |||
| void HAL_MspDeInit(void); | |||
| HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup HAL_Exported_Functions_Group2 Peripheral Control functions | |||
| * @brief Peripheral Control functions | |||
| * @{ | |||
| */ | |||
| void HAL_IncTick(void); | |||
| void HAL_Delay(uint32_t Delay); | |||
| uint32_t HAL_GetTick(void); | |||
| void HAL_SuspendTick(void); | |||
| void HAL_ResumeTick(void); | |||
| uint32_t HAL_GetHalVersion(void); | |||
| uint32_t HAL_GetREVID(void); | |||
| uint32_t HAL_GetDEVID(void); | |||
| uint32_t HAL_GetUIDw0(void); | |||
| uint32_t HAL_GetUIDw1(void); | |||
| uint32_t HAL_GetUIDw2(void); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup HAL_Exported_Functions_Group3 DBGMCU Peripheral Control functions | |||
| * @brief DBGMCU Peripheral Control functions | |||
| * @{ | |||
| */ | |||
| void HAL_DBGMCU_EnableDBGSleepMode(void); | |||
| void HAL_DBGMCU_DisableDBGSleepMode(void); | |||
| void HAL_DBGMCU_EnableDBGStopMode(void); | |||
| void HAL_DBGMCU_DisableDBGStopMode(void); | |||
| void HAL_DBGMCU_EnableDBGStandbyMode(void); | |||
| void HAL_DBGMCU_DisableDBGStandbyMode(void); | |||
| void HAL_DBGMCU_DBG_EnableLowPowerConfig(uint32_t Periph); | |||
| void HAL_DBGMCU_DBG_DisableLowPowerConfig(uint32_t Periph); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup HAL_Exported_Functions_Group4 SYSCFG Peripheral Control functions | |||
| * @brief SYSCFG Peripheral Control functions | |||
| * @{ | |||
| */ | |||
| uint32_t HAL_SYSCFG_GetBootMode(void); | |||
| void HAL_SYSCFG_Enable_Lock_VREFINT(void); | |||
| void HAL_SYSCFG_Disable_Lock_VREFINT(void); | |||
| void HAL_SYSCFG_VREFINT_OutputSelect(uint32_t SYSCFG_Vrefint_OUTPUT); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Define the private group ***********************************/ | |||
| /**************************************************************/ | |||
| /** @defgroup HAL_Private HAL Private | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /**************************************************************/ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,216 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_adc_ex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of ADC HAL extended module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_ADC_EX_H | |||
| #define __STM32L0xx_HAL_ADC_EX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @addtogroup ADCEx | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup ADCEx_Exported_Constants ADC Extended Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup ADCEx_Channel_Mode ADC Single Ended | |||
| * @{ | |||
| */ | |||
| #define ADC_SINGLE_ENDED (uint32_t)0x00000000U /* dummy value */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup ADC_regular_external_trigger_source ADC External Trigger Source | |||
| * @{ | |||
| */ | |||
| #define ADC_EXTERNALTRIGCONV_T6_TRGO ((uint32_t)0x00000000U) | |||
| #define ADC_EXTERNALTRIGCONV_T21_CC2 (ADC_CFGR1_EXTSEL_0) | |||
| #define ADC_EXTERNALTRIGCONV_T2_TRGO (ADC_CFGR1_EXTSEL_1) | |||
| #define ADC_EXTERNALTRIGCONV_T2_CC4 (ADC_CFGR1_EXTSEL_1 | ADC_CFGR1_EXTSEL_0) | |||
| #define ADC_EXTERNALTRIGCONV_T22_TRGO (ADC_CFGR1_EXTSEL_2) | |||
| #define ADC_EXTERNALTRIGCONV_T3_TRGO (ADC_CFGR1_EXTSEL_2 | ADC_CFGR1_EXTSEL_1) | |||
| #define ADC_EXTERNALTRIGCONV_EXT_IT11 (ADC_CFGR1_EXTSEL_2 | ADC_CFGR1_EXTSEL_1 | ADC_CFGR1_EXTSEL_0) | |||
| #define ADC_SOFTWARE_START (ADC_CFGR1_EXTSEL + (uint32_t)1) | |||
| /* ADC group regular external trigger TIM21_TRGO available only on */ | |||
| /* STM32L0 devices categories: Cat.2, Cat.3, Cat.5 */ | |||
| #if defined (STM32L031xx) || defined (STM32L041xx) || \ | |||
| defined (STM32L051xx) || defined (STM32L052xx) || defined (STM32L053xx) || \ | |||
| defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) || \ | |||
| defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || \ | |||
| defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) || \ | |||
| defined (STM32L010x6) || defined (STM32L010x8) || defined (STM32L010xB) | |||
| #define ADC_EXTERNALTRIGCONV_T21_TRGO (ADC_EXTERNALTRIGCONV_T22_TRGO) | |||
| #endif | |||
| /* ADC group regular external trigger TIM2_CC3 available only on */ | |||
| /* STM32L0 devices categories: Cat.1, Cat.2, Cat.5 */ | |||
| #if defined (STM32L011xx) || defined (STM32L021xx) || \ | |||
| defined (STM32L031xx) || defined (STM32L041xx) || \ | |||
| defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || \ | |||
| defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) || \ | |||
| defined (STM32L010x4) || defined (STM32L010x6) || defined (STM32L010x8) || defined (STM32L010xB) | |||
| #define ADC_EXTERNALTRIGCONV_T2_CC3 (ADC_CFGR1_EXTSEL_2 | ADC_CFGR1_EXTSEL_0) | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup ADC_SYSCFG_internal_paths_flags_definition ADC SYSCFG internal paths Flags Definition | |||
| * @{ | |||
| */ | |||
| #define ADC_FLAG_SENSOR SYSCFG_CFGR3_VREFINT_RDYF | |||
| #define ADC_FLAG_VREFINT SYSCFG_VREFINT_ADC_RDYF | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private macros ------------------------------------------------------------*/ | |||
| /** @defgroup ADCEx_Private_Macros ADCEx Private Macros | |||
| * @{ | |||
| */ | |||
| #define IS_ADC_SINGLE_DIFFERENTIAL(SING_DIFF) ((SING_DIFF) == ADC_SINGLE_ENDED) | |||
| /** @defgroup ADCEx_calibration_factor_length_verification ADC Calibration Factor Length Verification | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Calibration factor length verification (7 bits maximum) | |||
| * @param _Calibration_Factor_: Calibration factor value | |||
| * @retval None | |||
| */ | |||
| #define IS_ADC_CALFACT(_Calibration_Factor_) ((_Calibration_Factor_) <= ((uint32_t)0x7FU)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup ADC_External_trigger_Source ADC External Trigger Source | |||
| * @{ | |||
| */ | |||
| #if defined (STM32L031xx) || defined (STM32L041xx) || \ | |||
| defined (STM32L071xx) || defined (STM32L072xx) || defined (STM32L073xx) || \ | |||
| defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) || \ | |||
| defined (STM32L010x6) || defined (STM32L010x8) || defined (STM32L010xB) | |||
| #define IS_ADC_EXTTRIG(CONV) (((CONV) == ADC_EXTERNALTRIGCONV_T6_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T21_CC2 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_CC4 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T22_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T21_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_CC3 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T3_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_EXT_IT11 ) || \ | |||
| ((CONV) == ADC_SOFTWARE_START)) | |||
| #elif defined (STM32L010x4) || defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define IS_ADC_EXTTRIG(CONV) (((CONV) == ADC_EXTERNALTRIGCONV_T6_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T21_CC2 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_CC4 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T22_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_CC3 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T3_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_EXT_IT11 ) || \ | |||
| ((CONV) == ADC_SOFTWARE_START)) | |||
| #elif defined (STM32L051xx) || defined (STM32L052xx) || defined (STM32L053xx) || \ | |||
| defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) | |||
| #define IS_ADC_EXTTRIG(CONV) (((CONV) == ADC_EXTERNALTRIGCONV_T6_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T21_CC2 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T2_CC4 ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T22_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T21_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_T3_TRGO ) || \ | |||
| ((CONV) == ADC_EXTERNALTRIGCONV_EXT_IT11 ) || \ | |||
| ((CONV) == ADC_SOFTWARE_START)) | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @addtogroup ADCEx_Exported_Functions | |||
| * @{ | |||
| */ | |||
| /** @addtogroup ADCEx_Exported_Functions_Group1 | |||
| * @{ | |||
| */ | |||
| /* IO operation functions *****************************************************/ | |||
| /* ADC calibration */ | |||
| HAL_StatusTypeDef HAL_ADCEx_Calibration_Start(ADC_HandleTypeDef* hadc, uint32_t SingleDiff); | |||
| uint32_t HAL_ADCEx_Calibration_GetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff); | |||
| HAL_StatusTypeDef HAL_ADCEx_Calibration_SetValue(ADC_HandleTypeDef* hadc, uint32_t SingleDiff, uint32_t CalibrationFactor); | |||
| /* ADC VrefInt and Temperature sensor functions specific to this STM32 serie */ | |||
| HAL_StatusTypeDef HAL_ADCEx_EnableVREFINT(void); | |||
| void HAL_ADCEx_DisableVREFINT(void); | |||
| HAL_StatusTypeDef HAL_ADCEx_EnableVREFINTTempSensor(void); | |||
| void HAL_ADCEx_DisableVREFINTTempSensor(void); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /*__STM32L0xx_HAL_ADC_EX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,727 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_comp.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of COMP HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_COMP_H | |||
| #define __STM32L0xx_HAL_COMP_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if !defined (STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @addtogroup COMP | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup COMP_Exported_Types COMP Exported Types | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief COMP Init structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint32_t WindowMode; /*!< Set window mode of a pair of comparators instances | |||
| (2 consecutive instances odd and even COMP<x> and COMP<x+1>). | |||
| Note: HAL COMP driver allows to set window mode from any COMP instance of the pair of COMP instances composing window mode. | |||
| This parameter can be a value of @ref COMP_WindowMode */ | |||
| uint32_t Mode; /*!< Set comparator operating mode to adjust power and speed. | |||
| Note: For the characteritics of comparator power modes | |||
| (propagation delay and power consumption), refer to device datasheet. | |||
| This parameter can be a value of @ref COMP_PowerMode */ | |||
| uint32_t NonInvertingInput; /*!< Set comparator input plus (non-inverting input). | |||
| This parameter can be a value of @ref COMP_InputPlus */ | |||
| uint32_t InvertingInput; /*!< Set comparator input minus (inverting input). | |||
| This parameter can be a value of @ref COMP_InputMinus */ | |||
| uint32_t OutputPol; /*!< Set comparator output polarity. | |||
| This parameter can be a value of @ref COMP_OutputPolarity */ | |||
| uint32_t LPTIMConnection; /*!< Set comparator output connection to LPTIM peripheral. | |||
| This parameter can be a value of @ref COMP_LPTIMConnection */ | |||
| uint32_t TriggerMode; /*!< Set the comparator output triggering External Interrupt Line (EXTI). | |||
| This parameter can be a value of @ref COMP_EXTI_TriggerMode */ | |||
| }COMP_InitTypeDef; | |||
| /** | |||
| * @brief HAL COMP state machine: HAL COMP states definition | |||
| */ | |||
| #define COMP_STATE_BITFIELD_LOCK ((uint32_t)0x10) | |||
| typedef enum | |||
| { | |||
| HAL_COMP_STATE_RESET = 0x00U, /*!< COMP not yet initialized */ | |||
| HAL_COMP_STATE_RESET_LOCKED = (HAL_COMP_STATE_RESET | COMP_STATE_BITFIELD_LOCK), /*!< COMP not yet initialized and configuration is locked */ | |||
| HAL_COMP_STATE_READY = 0x01U, /*!< COMP initialized and ready for use */ | |||
| HAL_COMP_STATE_READY_LOCKED = (HAL_COMP_STATE_READY | COMP_STATE_BITFIELD_LOCK), /*!< COMP initialized but configuration is locked */ | |||
| HAL_COMP_STATE_BUSY = 0x02U, /*!< COMP is running */ | |||
| HAL_COMP_STATE_BUSY_LOCKED = (HAL_COMP_STATE_BUSY | COMP_STATE_BITFIELD_LOCK) /*!< COMP is running and configuration is locked */ | |||
| }HAL_COMP_StateTypeDef; | |||
| /** | |||
| * @brief COMP Handle Structure definition | |||
| */ | |||
| typedef struct __COMP_HandleTypeDef | |||
| { | |||
| COMP_TypeDef *Instance; /*!< Register base address */ | |||
| COMP_InitTypeDef Init; /*!< COMP required parameters */ | |||
| HAL_LockTypeDef Lock; /*!< Locking object */ | |||
| __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */ | |||
| __IO uint32_t ErrorCode; /*!< COMP Error code */ | |||
| #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) | |||
| void (* TriggerCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP trigger callback */ | |||
| void (* MspInitCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP Msp Init callback */ | |||
| void (* MspDeInitCallback)(struct __COMP_HandleTypeDef *hcomp); /*!< COMP Msp DeInit callback */ | |||
| #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ | |||
| } COMP_HandleTypeDef; | |||
| #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) | |||
| /** | |||
| * @brief HAL COMP Callback ID enumeration definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_COMP_TRIGGER_CB_ID = 0x00U, /*!< COMP trigger callback ID */ | |||
| HAL_COMP_MSPINIT_CB_ID = 0x01U, /*!< COMP Msp Init callback ID */ | |||
| HAL_COMP_MSPDEINIT_CB_ID = 0x02U /*!< COMP Msp DeInit callback ID */ | |||
| } HAL_COMP_CallbackIDTypeDef; | |||
| /** | |||
| * @brief HAL COMP Callback pointer definition | |||
| */ | |||
| typedef void (*pCOMP_CallbackTypeDef)(COMP_HandleTypeDef *hcomp); /*!< pointer to a COMP callback function */ | |||
| #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup COMP_Exported_Constants COMP Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMP_Error_Code COMP Error Code | |||
| * @{ | |||
| */ | |||
| #define HAL_COMP_ERROR_NONE (0x00U) /*!< No error */ | |||
| #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) | |||
| #define HAL_COMP_ERROR_INVALID_CALLBACK (0x01U) /*!< Invalid Callback error */ | |||
| #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_WindowMode COMP Window Mode | |||
| * @{ | |||
| */ | |||
| #define COMP_WINDOWMODE_DISABLE ((uint32_t)0x00000000U) /*!< Window mode disable: Comparators instances pair COMP1 and COMP2 are independent */ | |||
| #define COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON (COMP_CSR_COMP1WM) /*!< Window mode enable: Comparators instances pair COMP1 and COMP2 have their input plus connected together. The common input is COMP1 input plus (COMP2 input plus is no more accessible). */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_PowerMode COMP power mode | |||
| * @{ | |||
| */ | |||
| /* Note: For the characteritics of comparator power modes */ | |||
| /* (propagation delay and power consumption), */ | |||
| /* refer to device datasheet. */ | |||
| #define COMP_POWERMODE_MEDIUMSPEED (COMP_CSR_COMP2SPEED) /*!< COMP power mode to low power (indicated as "high speed" in reference manual) (only for COMP instance: COMP2) */ | |||
| #define COMP_POWERMODE_ULTRALOWPOWER ((uint32_t)0x00000000U) /*!< COMP power mode to ultra low power (indicated as "low speed" in reference manual) (only for COMP instance: COMP2) */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_InputPlus COMP input plus (non-inverting input) | |||
| * @{ | |||
| */ | |||
| #define COMP_INPUT_PLUS_IO1 ((uint32_t)0x00000000U) /*!< Comparator input plus connected to IO1 (pin PA1 for COMP1, pin PA3 for COMP2) */ | |||
| #define COMP_INPUT_PLUS_IO2 (COMP_CSR_COMP2INPSEL_0) /*!< Comparator input plus connected to IO2 (pin PB4 for COMP2) (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_PLUS_IO3 (COMP_CSR_COMP2INPSEL_1) /*!< Comparator input plus connected to IO3 (pin PA5 for COMP2) (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_PLUS_IO4 (COMP_CSR_COMP2INPSEL_0 | COMP_CSR_COMP2INPSEL_1) /*!< Comparator input plus connected to IO4 (pin PB6 for COMP2) (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_PLUS_IO5 (COMP_CSR_COMP2INPSEL_2) /*!< Comparator input plus connected to IO5 (pin PB7 for COMP2) (only for COMP instance: COMP2) */ | |||
| #if defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define COMP_INPUT_PLUS_IO6 (COMP_CSR_COMP2INPSEL_2 | COMP_CSR_COMP2INPSEL_0) /*!< Comparator input plus connected to IO6 (pin PA7 for COMP2) (only for COMP instance: COMP2) (Available only on devices STM32L0 category 1) */ | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_InputMinus COMP input minus (inverting input) | |||
| * @{ | |||
| */ | |||
| #define COMP_INPUT_MINUS_1_4VREFINT (COMP_CSR_COMP2INNSEL_2 ) /*!< Comparator input minus connected to 1/4 VREFINT (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_MINUS_1_2VREFINT (COMP_CSR_COMP2INNSEL_2 | COMP_CSR_COMP2INNSEL_0) /*!< Comparator input minus connected to 1/2 VREFINT (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_MINUS_3_4VREFINT (COMP_CSR_COMP2INNSEL_2 | COMP_CSR_COMP2INNSEL_1 ) /*!< Comparator input minus connected to 3/4 VREFINT (only for COMP instance: COMP2) */ | |||
| #define COMP_INPUT_MINUS_VREFINT ((uint32_t)0x00000000U) /*!< Comparator input minus connected to VrefInt */ | |||
| #define COMP_INPUT_MINUS_DAC1_CH1 ( COMP_CSR_COMP2INNSEL_1 ) /*!< Comparator input minus connected to DAC1 channel 1 (DAC_OUT1) */ | |||
| #define COMP_INPUT_MINUS_DAC1_CH2 ( COMP_CSR_COMP2INNSEL_1 | COMP_CSR_COMP2INNSEL_0) /*!< Comparator input minus connected to DAC1 channel 2 (DAC_OUT2) */ | |||
| #define COMP_INPUT_MINUS_IO1 ( COMP_CSR_COMP2INNSEL_0) /*!< Comparator input minus connected to IO1 (pin PA0 for COMP1, pin PA2 for COMP2) */ | |||
| #define COMP_INPUT_MINUS_IO2 (COMP_CSR_COMP2INNSEL_2 | COMP_CSR_COMP2INNSEL_1 | COMP_CSR_COMP2INNSEL_0) /*!< Comparator input minus connected to IO2 (pin PB3 for COMP2) (only for COMP instance: COMP2) */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_LPTIMConnection COMP Low power timer connection definition | |||
| * @{ | |||
| */ | |||
| #define COMP_LPTIMCONNECTION_DISABLED ((uint32_t)0x00000000U) /*!< COMPx signal is gated */ | |||
| #define COMP_LPTIMCONNECTION_IN1_ENABLED ((uint32_t)0x00000001U) /*!< COMPx signal is connected to LPTIM input 1 */ | |||
| #define COMP_LPTIMCONNECTION_IN2_ENABLED ((uint32_t)0x00000002U) /*!< COMPx signal is connected to LPTIM input 2 */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_OutputPolarity COMP output Polarity | |||
| * @{ | |||
| */ | |||
| #define COMP_OUTPUTPOL_NONINVERTED ((uint32_t)0x00000000U) /*!< COMP output on GPIO isn't inverted */ | |||
| #define COMP_OUTPUTPOL_INVERTED COMP_CSR_COMPxPOLARITY /*!< COMP output on GPIO is inverted */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_OutputLevel COMP Output Level | |||
| * @{ | |||
| */ | |||
| /* Note: Comparator output level values are fixed to "0" and "1", */ | |||
| /* corresponding COMP register bit is managed by HAL function to match */ | |||
| /* with these values (independently of bit position in register). */ | |||
| /* When output polarity is not inverted, comparator output is low when | |||
| the input plus is at a lower voltage than the input minus */ | |||
| #define COMP_OUTPUT_LEVEL_LOW ((uint32_t)0x00000000U) | |||
| /* When output polarity is not inverted, comparator output is high when | |||
| the input plus is at a higher voltage than the input minus */ | |||
| #define COMP_OUTPUT_LEVEL_HIGH ((uint32_t)0x00000001U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_EXTI_TriggerMode COMP output to EXTI | |||
| * @{ | |||
| */ | |||
| #define COMP_TRIGGERMODE_NONE ((uint32_t)0x00000000U) /*!< Comparator output triggering no External Interrupt Line */ | |||
| #define COMP_TRIGGERMODE_IT_RISING (COMP_EXTI_IT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event with interruption, on rising edge */ | |||
| #define COMP_TRIGGERMODE_IT_FALLING (COMP_EXTI_IT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event with interruption, on falling edge */ | |||
| #define COMP_TRIGGERMODE_IT_RISING_FALLING (COMP_EXTI_IT | COMP_EXTI_RISING | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event with interruption, on both rising and falling edges */ | |||
| #define COMP_TRIGGERMODE_EVENT_RISING (COMP_EXTI_EVENT | COMP_EXTI_RISING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on rising edge */ | |||
| #define COMP_TRIGGERMODE_EVENT_FALLING (COMP_EXTI_EVENT | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on falling edge */ | |||
| #define COMP_TRIGGERMODE_EVENT_RISING_FALLING (COMP_EXTI_EVENT | COMP_EXTI_RISING | COMP_EXTI_FALLING) /*!< Comparator output triggering External Interrupt Line event only (without interruption), on both rising and falling edges */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| /** @defgroup COMP_Exported_Macros COMP Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMP_Handle_Management COMP Handle Management | |||
| * @{ | |||
| */ | |||
| /** @brief Reset COMP handle state. | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval None | |||
| */ | |||
| #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) | |||
| #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) do{ \ | |||
| (__HANDLE__)->State = HAL_COMP_STATE_RESET; \ | |||
| (__HANDLE__)->MspInitCallback = NULL; \ | |||
| (__HANDLE__)->MspDeInitCallback = NULL; \ | |||
| } while(0) | |||
| #else | |||
| #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET) | |||
| #endif | |||
| /** | |||
| * @brief Clear COMP error code (set it to no error code "HAL_COMP_ERROR_NONE"). | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval None | |||
| */ | |||
| #define COMP_CLEAR_ERRORCODE(__HANDLE__) ((__HANDLE__)->ErrorCode = HAL_COMP_ERROR_NONE) | |||
| /** | |||
| * @brief Enable the specified comparator. | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN) | |||
| /** | |||
| * @brief Disable the specified comparator. | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxEN) | |||
| /** | |||
| * @brief Lock the specified comparator configuration. | |||
| * @note Using this macro induce HAL COMP handle state machine being no | |||
| * more in line with COMP instance state. | |||
| * To keep HAL COMP handle state machine updated, it is recommended | |||
| * to use function "HAL_COMP_Lock')". | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_LOCK(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxLOCK) | |||
| /** | |||
| * @brief Check whether the specified comparator is locked. | |||
| * @param __HANDLE__ COMP handle | |||
| * @retval Value 0 if COMP instance is not locked, value 1 if COMP instance is locked | |||
| */ | |||
| #define __HAL_COMP_IS_LOCKED(__HANDLE__) (READ_BIT((__HANDLE__)->Instance->CSR, COMP_CSR_COMPxLOCK) == COMP_CSR_COMPxLOCK) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_Exti_Management COMP external interrupt line management | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Enable the COMP1 EXTI line rising edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Disable the COMP1 EXTI line rising edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Enable the COMP1 EXTI line falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Disable the COMP1 EXTI line falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Enable the COMP1 EXTI line rising & falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ | |||
| __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \ | |||
| __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \ | |||
| } while(0) | |||
| /** | |||
| * @brief Disable the COMP1 EXTI line rising & falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ | |||
| __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \ | |||
| __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \ | |||
| } while(0) | |||
| /** | |||
| * @brief Enable the COMP1 EXTI line in interrupt mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Disable the COMP1 EXTI line in interrupt mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Generate a software interrupt on the COMP1 EXTI line. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Enable the COMP1 EXTI line in event mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Disable the COMP1 EXTI line in event mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Check whether the COMP1 EXTI line flag is set. | |||
| * @retval RESET or SET | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Clear the COMP1 EXTI flag. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP1) | |||
| /** | |||
| * @brief Enable the COMP2 EXTI line rising edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Disable the COMP2 EXTI line rising edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Enable the COMP2 EXTI line falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Disable the COMP2 EXTI line falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Enable the COMP2 EXTI line rising & falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \ | |||
| __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \ | |||
| __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \ | |||
| } while(0) | |||
| /** | |||
| * @brief Disable the COMP2 EXTI line rising & falling edge trigger. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \ | |||
| __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \ | |||
| __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \ | |||
| } while(0) | |||
| /** | |||
| * @brief Enable the COMP2 EXTI line in interrupt mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Disable the COMP2 EXTI line in interrupt mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Generate a software interrupt on the COMP2 EXTI line. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Enable the COMP2 EXTI line in event mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Disable the COMP2 EXTI line in event mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Check whether the COMP2 EXTI line flag is set. | |||
| * @retval RESET or SET | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @brief Clear the COMP2 EXTI flag. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private types -------------------------------------------------------------*/ | |||
| /* Private constants ---------------------------------------------------------*/ | |||
| /** @defgroup COMP_Private_Constants COMP Private Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMP_ExtiLine COMP EXTI Lines | |||
| * @{ | |||
| */ | |||
| #define COMP_EXTI_LINE_COMP1 (EXTI_IMR_IM21) /*!< EXTI line 21 connected to COMP1 output */ | |||
| #define COMP_EXTI_LINE_COMP2 (EXTI_IMR_IM22) /*!< EXTI line 22 connected to COMP2 output */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_ExtiLine COMP EXTI Lines | |||
| * @{ | |||
| */ | |||
| #define COMP_EXTI_IT ((uint32_t) 0x01U) /*!< EXTI line event with interruption */ | |||
| #define COMP_EXTI_EVENT ((uint32_t) 0x02U) /*!< EXTI line event only (without interruption) */ | |||
| #define COMP_EXTI_RISING ((uint32_t) 0x10U) /*!< EXTI line event on rising edge */ | |||
| #define COMP_EXTI_FALLING ((uint32_t) 0x20U) /*!< EXTI line event on falling edge */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private macros ------------------------------------------------------------*/ | |||
| /** @defgroup COMP_Private_Macros COMP Private Macros | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMP_GET_EXTI_LINE COMP private macros to get EXTI line associated with comparators | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Get the specified EXTI line for a comparator instance. | |||
| * @param __INSTANCE__ specifies the COMP instance. | |||
| * @retval value of @ref COMP_ExtiLine | |||
| */ | |||
| #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? \ | |||
| COMP_EXTI_LINE_COMP1 : COMP_EXTI_LINE_COMP2) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup COMP_IS_COMP_Definitions COMP private macros to check input parameters | |||
| * @{ | |||
| */ | |||
| #define IS_COMP_WINDOWMODE(__WINDOWMODE__) (((__WINDOWMODE__) == COMP_WINDOWMODE_DISABLE) || \ | |||
| ((__WINDOWMODE__) == COMP_WINDOWMODE_COMP1_INPUT_PLUS_COMMON) ) | |||
| #define IS_COMP_POWERMODE(__POWERMODE__) (((__POWERMODE__) == COMP_POWERMODE_MEDIUMSPEED) || \ | |||
| ((__POWERMODE__) == COMP_POWERMODE_ULTRALOWPOWER) ) | |||
| #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) ((INSTANCE) == COMP1) | |||
| #if defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) \ | |||
| (((__COMP_INSTANCE__) == COMP1) \ | |||
| ? ( \ | |||
| (__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1 \ | |||
| ) \ | |||
| : \ | |||
| ( \ | |||
| ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO3) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO4) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO5) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO6) \ | |||
| ) \ | |||
| ) | |||
| #else | |||
| #define IS_COMP_INPUT_PLUS(__COMP_INSTANCE__, __INPUT_PLUS__) \ | |||
| (((__COMP_INSTANCE__) == COMP1) \ | |||
| ? ( \ | |||
| (__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1 \ | |||
| ) \ | |||
| : \ | |||
| ( \ | |||
| ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO1) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO2) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO3) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO4) \ | |||
| || ((__INPUT_PLUS__) == COMP_INPUT_PLUS_IO5) \ | |||
| ) \ | |||
| ) | |||
| #endif | |||
| #define IS_COMP_INPUT_MINUS(__COMP_INSTANCE__, __INPUT_MINUS__) \ | |||
| (((__COMP_INSTANCE__) == COMP1) \ | |||
| ? ( \ | |||
| ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) \ | |||
| ) \ | |||
| : \ | |||
| ( \ | |||
| ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_4VREFINT) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_1_2VREFINT) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_3_4VREFINT) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_VREFINT) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH1) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_DAC1_CH2) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO1) \ | |||
| || ((__INPUT_MINUS__) == COMP_INPUT_MINUS_IO2) \ | |||
| ) \ | |||
| ) | |||
| #define IS_COMP1_LPTIMCONNECTION(LPTIMCONNECTION) (((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_DISABLED) || \ | |||
| ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_IN1_ENABLED)) | |||
| #define IS_COMP2_LPTIMCONNECTION(LPTIMCONNECTION) (((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_DISABLED) || \ | |||
| ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_IN1_ENABLED) || \ | |||
| ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_IN2_ENABLED)) | |||
| #define IS_COMP2_LPTIMCONNECTION_RESTRICTED(LPTIMCONNECTION) (((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_DISABLED) || \ | |||
| ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_IN1_ENABLED)) | |||
| #define IS_COMP_OUTPUTPOL(POL) (((POL) == COMP_OUTPUTPOL_NONINVERTED) || \ | |||
| ((POL) == COMP_OUTPUTPOL_INVERTED)) | |||
| #define IS_COMP_TRIGGERMODE(__TRIGGERMODE__) (((__TRIGGERMODE__) == COMP_TRIGGERMODE_NONE) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_IT_RISING) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_IT_FALLING) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_IT_RISING_FALLING) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_EVENT_RISING) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_EVENT_FALLING) || \ | |||
| ((__TRIGGERMODE__) == COMP_TRIGGERMODE_EVENT_RISING_FALLING) ) | |||
| #define IS_COMP_OUTPUT_LEVEL(__OUTPUT_LEVEL__) (((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_LOW) || \ | |||
| ((__OUTPUT_LEVEL__) == COMP_OUTPUT_LEVEL_HIGH)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Include COMP HAL Extended module */ | |||
| #include "stm32l0xx_hal_comp_ex.h" | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @addtogroup COMP_Exported_Functions | |||
| * @{ | |||
| */ | |||
| /** @addtogroup COMP_Exported_Functions_Group1 | |||
| * @{ | |||
| */ | |||
| /* Initialization and de-initialization functions **********************************/ | |||
| HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp); | |||
| HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp); | |||
| void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp); | |||
| void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp); | |||
| #if (USE_HAL_COMP_REGISTER_CALLBACKS == 1) | |||
| /* Callbacks Register/UnRegister functions ***********************************/ | |||
| HAL_StatusTypeDef HAL_COMP_RegisterCallback(COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID, pCOMP_CallbackTypeDef pCallback); | |||
| HAL_StatusTypeDef HAL_COMP_UnRegisterCallback(COMP_HandleTypeDef *hcomp, HAL_COMP_CallbackIDTypeDef CallbackID); | |||
| #endif /* USE_HAL_COMP_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* IO operation functions *****************************************************/ | |||
| /** @addtogroup COMP_Exported_Functions_Group2 | |||
| * @{ | |||
| */ | |||
| HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp); | |||
| HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp); | |||
| void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Peripheral Control functions ************************************************/ | |||
| /** @addtogroup COMP_Exported_Functions_Group3 | |||
| * @{ | |||
| */ | |||
| HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp); | |||
| uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp); | |||
| /* Callback in interrupt mode */ | |||
| void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Peripheral State functions **************************************************/ | |||
| /** @addtogroup COMP_Exported_Functions_Group4 | |||
| * @{ | |||
| */ | |||
| HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp); | |||
| uint32_t HAL_COMP_GetError(COMP_HandleTypeDef *hcomp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* !defined (STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_COMP_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,76 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_comp_ex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of COMP HAL Extended module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_COMP_EX_H | |||
| #define __STM32L0xx_HAL_COMP_EX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if !defined(STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMPEx COMPEx | |||
| * @{ | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup COMPEx_Exported_Functions COMPEx Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup COMPEx_Exported_Functions_Group1 Extended COMP VREFINT setup functions | |||
| * @{ | |||
| */ | |||
| /* COMP specific functions to manage VREFINT *************************************/ | |||
| void HAL_COMPEx_EnableVREFINT(void); | |||
| void HAL_COMPEx_DisableVREFINT(void); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* #if !defined(STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_COMP_EX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,338 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_conf.h | |||
| * @author MCD Application Team | |||
| * @brief HAL configuration template file. | |||
| * This file should be copied to the application folder and renamed | |||
| * to stm32l0xx_hal_conf.h. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_CONF_H | |||
| #define __STM32L0xx_HAL_CONF_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /* ########################## Module Selection ############################## */ | |||
| /** | |||
| * @brief This is the list of modules to be used in the HAL driver | |||
| */ | |||
| #define HAL_MODULE_ENABLED | |||
| #define HAL_ADC_MODULE_ENABLED | |||
| #define HAL_COMP_MODULE_ENABLED | |||
| #define HAL_CRC_MODULE_ENABLED | |||
| #define HAL_CRYP_MODULE_ENABLED | |||
| #define HAL_DAC_MODULE_ENABLED | |||
| #define HAL_DMA_MODULE_ENABLED | |||
| #define HAL_FIREWALL_MODULE_ENABLED | |||
| #define HAL_FLASH_MODULE_ENABLED | |||
| #define HAL_GPIO_MODULE_ENABLED | |||
| #define HAL_I2C_MODULE_ENABLED | |||
| #define HAL_I2S_MODULE_ENABLED | |||
| #define HAL_IWDG_MODULE_ENABLED | |||
| #define HAL_LCD_MODULE_ENABLED | |||
| #define HAL_LPTIM_MODULE_ENABLED | |||
| #define HAL_PWR_MODULE_ENABLED | |||
| #define HAL_RCC_MODULE_ENABLED | |||
| #define HAL_RNG_MODULE_ENABLED | |||
| #define HAL_RTC_MODULE_ENABLED | |||
| #define HAL_SPI_MODULE_ENABLED | |||
| #define HAL_TIM_MODULE_ENABLED | |||
| #define HAL_TSC_MODULE_ENABLED | |||
| #define HAL_UART_MODULE_ENABLED | |||
| #define HAL_USART_MODULE_ENABLED | |||
| #define HAL_IRDA_MODULE_ENABLED | |||
| #define HAL_SMARTCARD_MODULE_ENABLED | |||
| #define HAL_SMBUS_MODULE_ENABLED | |||
| #define HAL_WWDG_MODULE_ENABLED | |||
| #define HAL_CORTEX_MODULE_ENABLED | |||
| #define HAL_PCD_MODULE_ENABLED | |||
| /* ########################## Oscillator Values adaptation ####################*/ | |||
| /** | |||
| * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. | |||
| * This value is used by the RCC HAL module to compute the system frequency | |||
| * (when HSE is used as system clock source, directly or through the PLL). | |||
| */ | |||
| #if !defined (HSE_VALUE) | |||
| #define HSE_VALUE ((uint32_t)8000000U) /*!< Value of the External oscillator in Hz */ | |||
| #endif /* HSE_VALUE */ | |||
| #if !defined (HSE_STARTUP_TIMEOUT) | |||
| #define HSE_STARTUP_TIMEOUT ((uint32_t)100U) /*!< Time out for HSE start up, in ms */ | |||
| #endif /* HSE_STARTUP_TIMEOUT */ | |||
| /** | |||
| * @brief Internal Multiple Speed oscillator (MSI) default value. | |||
| * This value is the default MSI range value after Reset. | |||
| */ | |||
| #if !defined (MSI_VALUE) | |||
| #define MSI_VALUE ((uint32_t)2097152U) /*!< Value of the Internal oscillator in Hz*/ | |||
| #endif /* MSI_VALUE */ | |||
| /** | |||
| * @brief Internal High Speed oscillator (HSI) value. | |||
| * This value is used by the RCC HAL module to compute the system frequency | |||
| * (when HSI is used as system clock source, directly or through the PLL). | |||
| */ | |||
| #if !defined (HSI_VALUE) | |||
| #define HSI_VALUE ((uint32_t)16000000U) /*!< Value of the Internal oscillator in Hz*/ | |||
| #endif /* HSI_VALUE */ | |||
| /** | |||
| * @brief Internal High Speed oscillator for USB (HSI48) value. | |||
| */ | |||
| #if !defined (HSI48_VALUE) | |||
| #define HSI48_VALUE ((uint32_t)48000000U) /*!< Value of the Internal High Speed oscillator for USB in Hz. | |||
| The real value may vary depending on the variations | |||
| in voltage and temperature. */ | |||
| #endif /* HSI48_VALUE */ | |||
| /** | |||
| * @brief Internal Low Speed oscillator (LSI) value. | |||
| */ | |||
| #if !defined (LSI_VALUE) | |||
| #define LSI_VALUE ((uint32_t)37000U) /*!< LSI Typical Value in Hz*/ | |||
| #endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz | |||
| The real value may vary depending on the variations | |||
| in voltage and temperature.*/ | |||
| /** | |||
| * @brief External Low Speed oscillator (LSE) value. | |||
| * This value is used by the UART, RTC HAL module to compute the system frequency | |||
| */ | |||
| #if !defined (LSE_VALUE) | |||
| #define LSE_VALUE ((uint32_t)32768U) /*!< Value of the External oscillator in Hz*/ | |||
| #endif /* LSE_VALUE */ | |||
| /** | |||
| * @brief Time out for LSE start up value in ms. | |||
| */ | |||
| #if !defined (LSE_STARTUP_TIMEOUT) | |||
| #define LSE_STARTUP_TIMEOUT ((uint32_t)5000U) /*!< Time out for LSE start up, in ms */ | |||
| #endif /* LSE_STARTUP_TIMEOUT */ | |||
| /* Tip: To avoid modifying this file each time you need to use different HSE, | |||
| === you can define the HSE value in your toolchain compiler preprocessor. */ | |||
| /* ########################### System Configuration ######################### */ | |||
| /** | |||
| * @brief This is the HAL system configuration section | |||
| */ | |||
| #define VDD_VALUE ((uint32_t)3300U) /*!< Value of VDD in mv */ | |||
| #define TICK_INT_PRIORITY (((uint32_t)1U<<__NVIC_PRIO_BITS) - 1U) /*!< tick interrupt priority */ | |||
| #define USE_RTOS 0U | |||
| #define PREFETCH_ENABLE 1U | |||
| #define PREREAD_ENABLE 0U | |||
| #define BUFFER_CACHE_DISABLE 0U | |||
| /* ########################## Assert Selection ############################## */ | |||
| /** | |||
| * @brief Uncomment the line below to expanse the "assert_param" macro in the | |||
| * HAL drivers code | |||
| */ | |||
| /* #define USE_FULL_ASSERT 1U */ | |||
| /* ################## Register callback feature configuration ############### */ | |||
| /** | |||
| * @brief Set below the peripheral configuration to "1U" to add the support | |||
| * of HAL callback registration/deregistration feature for the HAL | |||
| * driver(s). This allows user application to provide specific callback | |||
| * functions thanks to HAL_PPP_RegisterCallback() rather than overwriting | |||
| * the default weak callback functions (see each stm32l0xx_hal_ppp.h file | |||
| * for possible callback identifiers defined in HAL_PPP_CallbackIDTypeDef | |||
| * for each PPP peripheral). | |||
| */ | |||
| #define USE_HAL_ADC_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_COMP_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_DAC_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_I2C_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_I2S_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_IRDA_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_PCD_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_RNG_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_RTC_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_SPI_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_TIM_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_TSC_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_UART_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_USART_REGISTER_CALLBACKS 0U | |||
| #define USE_HAL_WWDG_REGISTER_CALLBACKS 0U | |||
| /* ################## SPI peripheral configuration ########################## */ | |||
| /* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver | |||
| * Activated: CRC code is present inside driver | |||
| * Deactivated: CRC code cleaned from driver | |||
| */ | |||
| #define USE_SPI_CRC 1U | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| /** | |||
| * @brief Include module's header file | |||
| */ | |||
| #ifdef HAL_RCC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_rcc.h" | |||
| #endif /* HAL_RCC_MODULE_ENABLED */ | |||
| #ifdef HAL_GPIO_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_gpio.h" | |||
| #endif /* HAL_GPIO_MODULE_ENABLED */ | |||
| #ifdef HAL_DMA_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_dma.h" | |||
| #endif /* HAL_DMA_MODULE_ENABLED */ | |||
| #ifdef HAL_CORTEX_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_cortex.h" | |||
| #endif /* HAL_CORTEX_MODULE_ENABLED */ | |||
| #ifdef HAL_ADC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_adc.h" | |||
| #endif /* HAL_ADC_MODULE_ENABLED */ | |||
| #ifdef HAL_COMP_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_comp.h" | |||
| #endif /* HAL_COMP_MODULE_ENABLED */ | |||
| #ifdef HAL_CRC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_crc.h" | |||
| #endif /* HAL_CRC_MODULE_ENABLED */ | |||
| #ifdef HAL_CRYP_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_cryp.h" | |||
| #endif /* HAL_CRYP_MODULE_ENABLED */ | |||
| #ifdef HAL_DAC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_dac.h" | |||
| #endif /* HAL_DAC_MODULE_ENABLED */ | |||
| #ifdef HAL_FIREWALL_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_firewall.h" | |||
| #endif /* HAL_FIREWALL_MODULE_ENABLED */ | |||
| #ifdef HAL_FLASH_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_flash.h" | |||
| #endif /* HAL_FLASH_MODULE_ENABLED */ | |||
| #ifdef HAL_I2C_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_i2c.h" | |||
| #endif /* HAL_I2C_MODULE_ENABLED */ | |||
| #ifdef HAL_I2S_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_i2s.h" | |||
| #endif /* HAL_I2S_MODULE_ENABLED */ | |||
| #ifdef HAL_IWDG_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_iwdg.h" | |||
| #endif /* HAL_IWDG_MODULE_ENABLED */ | |||
| #ifdef HAL_LCD_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_lcd.h" | |||
| #endif /* HAL_LCD_MODULE_ENABLED */ | |||
| #ifdef HAL_LPTIM_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_lptim.h" | |||
| #endif /* HAL_LPTIM_MODULE_ENABLED */ | |||
| #ifdef HAL_PWR_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_pwr.h" | |||
| #endif /* HAL_PWR_MODULE_ENABLED */ | |||
| #ifdef HAL_RNG_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_rng.h" | |||
| #endif /* HAL_RNG_MODULE_ENABLED */ | |||
| #ifdef HAL_RTC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_rtc.h" | |||
| #endif /* HAL_RTC_MODULE_ENABLED */ | |||
| #ifdef HAL_SPI_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_spi.h" | |||
| #endif /* HAL_SPI_MODULE_ENABLED */ | |||
| #ifdef HAL_TIM_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_tim.h" | |||
| #endif /* HAL_TIM_MODULE_ENABLED */ | |||
| #ifdef HAL_TSC_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_tsc.h" | |||
| #endif /* HAL_TSC_MODULE_ENABLED */ | |||
| #ifdef HAL_UART_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_uart.h" | |||
| #endif /* HAL_UART_MODULE_ENABLED */ | |||
| #ifdef HAL_USART_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_usart.h" | |||
| #endif /* HAL_USART_MODULE_ENABLED */ | |||
| #ifdef HAL_IRDA_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_irda.h" | |||
| #endif /* HAL_IRDA_MODULE_ENABLED */ | |||
| #ifdef HAL_SMARTCARD_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_smartcard.h" | |||
| #endif /* HAL_SMARTCARD_MODULE_ENABLED */ | |||
| #ifdef HAL_SMBUS_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_smbus.h" | |||
| #endif /* HAL_SMBUS_MODULE_ENABLED */ | |||
| #ifdef HAL_WWDG_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_wwdg.h" | |||
| #endif /* HAL_WWDG_MODULE_ENABLED */ | |||
| #ifdef HAL_PCD_MODULE_ENABLED | |||
| #include "stm32l0xx_hal_pcd.h" | |||
| #endif /* HAL_PCD_MODULE_ENABLED */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| #ifdef USE_FULL_ASSERT | |||
| /** | |||
| * @brief The assert_param macro is used for function's parameters check. | |||
| * @param expr If expr is false, it calls assert_failed function | |||
| * which reports the name of the source file and the source | |||
| * line number of the call that failed. | |||
| * If expr is true, it returns no value. | |||
| * @retval None | |||
| */ | |||
| #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) | |||
| /* Exported functions ------------------------------------------------------- */ | |||
| void assert_failed(uint8_t* file, uint32_t line); | |||
| #else | |||
| #define assert_param(expr) ((void)0U) | |||
| #endif /* USE_FULL_ASSERT */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_CONF_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,365 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_cortex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of CORTEX HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_CORTEX_H | |||
| #define __STM32L0xx_HAL_CORTEX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup CORTEX CORTEX | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup CORTEX_Exported_Types CORTEX Exported Types | |||
| * @{ | |||
| */ | |||
| #if (__MPU_PRESENT == 1) | |||
| /** @defgroup CORTEX_MPU_Region_Initialization_Structure_definition MPU Region Initialization Structure Definition | |||
| * @{ | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint32_t BaseAddress; /*!< Specifies the base address of the region to protect. */ | |||
| uint8_t Enable; /*!< Specifies the status of the region. | |||
| This parameter can be a value of @ref CORTEX_MPU_Region_Enable */ | |||
| uint8_t Number; /*!< Specifies the number of the region to protect. | |||
| This parameter can be a value of @ref CORTEX_MPU_Region_Number */ | |||
| uint8_t Size; /*!< Specifies the size of the region to protect. | |||
| This parameter can be a value of @ref CORTEX_MPU_Region_Size */ | |||
| uint8_t SubRegionDisable; /*!< Specifies the number of the subregion protection to disable. | |||
| This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */ | |||
| uint8_t TypeExtField; /*!< This parameter is NOT used but is kept to keep API unified through all families*/ | |||
| uint8_t AccessPermission; /*!< Specifies the region access permission type. | |||
| This parameter can be a value of @ref CORTEX_MPU_Region_Permission_Attributes */ | |||
| uint8_t DisableExec; /*!< Specifies the instruction access status. | |||
| This parameter can be a value of @ref CORTEX_MPU_Instruction_Access */ | |||
| uint8_t IsShareable; /*!< Specifies the shareability status of the protected region. | |||
| This parameter can be a value of @ref CORTEX_MPU_Access_Shareable */ | |||
| uint8_t IsCacheable; /*!< Specifies the cacheable status of the region protected. | |||
| This parameter can be a value of @ref CORTEX_MPU_Access_Cacheable */ | |||
| uint8_t IsBufferable; /*!< Specifies the bufferable status of the protected region. | |||
| This parameter can be a value of @ref CORTEX_MPU_Access_Bufferable */ | |||
| }MPU_Region_InitTypeDef; | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* __MPU_PRESENT */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup CORTEX_Exported_Constants CORTEx Exported Constants | |||
| * @{ | |||
| */ | |||
| #define IS_NVIC_PREEMPTION_PRIORITY(__PRIORITY__) ((__PRIORITY__) < 0x4U) | |||
| #define IS_NVIC_DEVICE_IRQ(IRQ) ((IRQ) >= 0x0) | |||
| /** @defgroup CORTEX_SysTick_clock_source CORTEX SysTick Clock Source | |||
| * @{ | |||
| */ | |||
| #define SYSTICK_CLKSOURCE_HCLK_DIV8 ((uint32_t)0x00000000U) | |||
| #define SYSTICK_CLKSOURCE_HCLK ((uint32_t)0x00000004U) | |||
| #define IS_SYSTICK_CLK_SOURCE(__SOURCE__) (((__SOURCE__) == SYSTICK_CLKSOURCE_HCLK) || \ | |||
| ((__SOURCE__) == SYSTICK_CLKSOURCE_HCLK_DIV8)) | |||
| /** | |||
| * @} | |||
| */ | |||
| #if (__MPU_PRESENT == 1) | |||
| /** @defgroup CORTEX_MPU_HFNMI_PRIVDEF_Control CORTEX MPU HFNMI and PRIVILEGED Access control | |||
| * @{ | |||
| */ | |||
| #define MPU_HFNMI_PRIVDEF_NONE ((uint32_t)0x00000000U) | |||
| #define MPU_HARDFAULT_NMI ((uint32_t)0x00000002U) | |||
| #define MPU_PRIVILEGED_DEFAULT ((uint32_t)0x00000004U) | |||
| #define MPU_HFNMI_PRIVDEF ((uint32_t)0x00000006U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Region_Enable CORTEX MPU Region Enable | |||
| * @{ | |||
| */ | |||
| #define MPU_REGION_ENABLE ((uint8_t)0x01U) | |||
| #define MPU_REGION_DISABLE ((uint8_t)0x00U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Instruction_Access CORTEX MPU Instruction Access | |||
| * @{ | |||
| */ | |||
| #define MPU_INSTRUCTION_ACCESS_ENABLE ((uint8_t)0x00U) | |||
| #define MPU_INSTRUCTION_ACCESS_DISABLE ((uint8_t)0x01U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Access_Shareable CORTEX MPU Instruction Access Shareable | |||
| * @{ | |||
| */ | |||
| #define MPU_ACCESS_SHAREABLE ((uint8_t)0x01U) | |||
| #define MPU_ACCESS_NOT_SHAREABLE ((uint8_t)0x00U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Access_Cacheable CORTEX MPU Instruction Access Cacheable | |||
| * @{ | |||
| */ | |||
| #define MPU_ACCESS_CACHEABLE ((uint8_t)0x01U) | |||
| #define MPU_ACCESS_NOT_CACHEABLE ((uint8_t)0x00U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Access_Bufferable CORTEX MPU Instruction Access Bufferable | |||
| * @{ | |||
| */ | |||
| #define MPU_ACCESS_BUFFERABLE ((uint8_t)0x01U) | |||
| #define MPU_ACCESS_NOT_BUFFERABLE ((uint8_t)0x00U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Region_Size CORTEX MPU Region Size | |||
| * @{ | |||
| */ | |||
| #define MPU_REGION_SIZE_32B ((uint8_t)0x04U) | |||
| #define MPU_REGION_SIZE_64B ((uint8_t)0x05U) | |||
| #define MPU_REGION_SIZE_128B ((uint8_t)0x06U) | |||
| #define MPU_REGION_SIZE_256B ((uint8_t)0x07U) | |||
| #define MPU_REGION_SIZE_512B ((uint8_t)0x08U) | |||
| #define MPU_REGION_SIZE_1KB ((uint8_t)0x09U) | |||
| #define MPU_REGION_SIZE_2KB ((uint8_t)0x0AU) | |||
| #define MPU_REGION_SIZE_4KB ((uint8_t)0x0BU) | |||
| #define MPU_REGION_SIZE_8KB ((uint8_t)0x0CU) | |||
| #define MPU_REGION_SIZE_16KB ((uint8_t)0x0DU) | |||
| #define MPU_REGION_SIZE_32KB ((uint8_t)0x0EU) | |||
| #define MPU_REGION_SIZE_64KB ((uint8_t)0x0FU) | |||
| #define MPU_REGION_SIZE_128KB ((uint8_t)0x10U) | |||
| #define MPU_REGION_SIZE_256KB ((uint8_t)0x11U) | |||
| #define MPU_REGION_SIZE_512KB ((uint8_t)0x12U) | |||
| #define MPU_REGION_SIZE_1MB ((uint8_t)0x13U) | |||
| #define MPU_REGION_SIZE_2MB ((uint8_t)0x14U) | |||
| #define MPU_REGION_SIZE_4MB ((uint8_t)0x15U) | |||
| #define MPU_REGION_SIZE_8MB ((uint8_t)0x16U) | |||
| #define MPU_REGION_SIZE_16MB ((uint8_t)0x17U) | |||
| #define MPU_REGION_SIZE_32MB ((uint8_t)0x18U) | |||
| #define MPU_REGION_SIZE_64MB ((uint8_t)0x19U) | |||
| #define MPU_REGION_SIZE_128MB ((uint8_t)0x1AU) | |||
| #define MPU_REGION_SIZE_256MB ((uint8_t)0x1BU) | |||
| #define MPU_REGION_SIZE_512MB ((uint8_t)0x1CU) | |||
| #define MPU_REGION_SIZE_1GB ((uint8_t)0x1DU) | |||
| #define MPU_REGION_SIZE_2GB ((uint8_t)0x1EU) | |||
| #define MPU_REGION_SIZE_4GB ((uint8_t)0x1FU) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Region_Permission_Attributes CORTEX MPU Region Permission Attributes | |||
| * @{ | |||
| */ | |||
| #define MPU_REGION_NO_ACCESS ((uint8_t)0x00U) | |||
| #define MPU_REGION_PRIV_RW ((uint8_t)0x01U) | |||
| #define MPU_REGION_PRIV_RW_URO ((uint8_t)0x02U) | |||
| #define MPU_REGION_FULL_ACCESS ((uint8_t)0x03U) | |||
| #define MPU_REGION_PRIV_RO ((uint8_t)0x05U) | |||
| #define MPU_REGION_PRIV_RO_URO ((uint8_t)0x06U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_MPU_Region_Number CORTEX MPU Region Number | |||
| * @{ | |||
| */ | |||
| #define MPU_REGION_NUMBER0 ((uint8_t)0x00U) | |||
| #define MPU_REGION_NUMBER1 ((uint8_t)0x01U) | |||
| #define MPU_REGION_NUMBER2 ((uint8_t)0x02U) | |||
| #define MPU_REGION_NUMBER3 ((uint8_t)0x03U) | |||
| #define MPU_REGION_NUMBER4 ((uint8_t)0x04U) | |||
| #define MPU_REGION_NUMBER5 ((uint8_t)0x05U) | |||
| #define MPU_REGION_NUMBER6 ((uint8_t)0x06U) | |||
| #define MPU_REGION_NUMBER7 ((uint8_t)0x07U) | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* __MPU_PRESENT */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup CORTEX_Exported_Functions CORTEX Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup CORTEX_Exported_Functions_Group1 Initialization and Configuration functions | |||
| * @brief Initialization and Configuration functions | |||
| * @{ | |||
| */ | |||
| void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority); | |||
| void HAL_NVIC_EnableIRQ(IRQn_Type IRQn); | |||
| void HAL_NVIC_DisableIRQ(IRQn_Type IRQn); | |||
| void HAL_NVIC_SystemReset(void); | |||
| uint32_t HAL_SYSTICK_Config(uint32_t TicksNumb); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CORTEX_Exported_Functions_Group2 Peripheral Control functions | |||
| * @brief Cortex control functions | |||
| * @{ | |||
| */ | |||
| uint32_t HAL_NVIC_GetPriority(IRQn_Type IRQn); | |||
| uint32_t HAL_NVIC_GetPendingIRQ(IRQn_Type IRQn); | |||
| void HAL_NVIC_SetPendingIRQ(IRQn_Type IRQn); | |||
| void HAL_NVIC_ClearPendingIRQ(IRQn_Type IRQn); | |||
| void HAL_SYSTICK_CLKSourceConfig(uint32_t CLKSource); | |||
| void HAL_SYSTICK_IRQHandler(void); | |||
| void HAL_SYSTICK_Callback(void); | |||
| #if (__MPU_PRESENT == 1U) | |||
| void HAL_MPU_Enable(uint32_t MPU_Control); | |||
| void HAL_MPU_Disable(void); | |||
| void HAL_MPU_ConfigRegion(MPU_Region_InitTypeDef *MPU_Init); | |||
| #endif /* __MPU_PRESENT */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private types -------------------------------------------------------------*/ | |||
| /* Private variables ---------------------------------------------------------*/ | |||
| /* Private constants ---------------------------------------------------------*/ | |||
| /* Private macros ------------------------------------------------------------*/ | |||
| /** @defgroup CORTEX_Private_Macros CORTEX Private Macros | |||
| * @{ | |||
| */ | |||
| #if (__MPU_PRESENT == 1) | |||
| #define IS_MPU_REGION_ENABLE(STATE) (((STATE) == MPU_REGION_ENABLE) || \ | |||
| ((STATE) == MPU_REGION_DISABLE)) | |||
| #define IS_MPU_INSTRUCTION_ACCESS(STATE) (((STATE) == MPU_INSTRUCTION_ACCESS_ENABLE) || \ | |||
| ((STATE) == MPU_INSTRUCTION_ACCESS_DISABLE)) | |||
| #define IS_MPU_ACCESS_SHAREABLE(STATE) (((STATE) == MPU_ACCESS_SHAREABLE) || \ | |||
| ((STATE) == MPU_ACCESS_NOT_SHAREABLE)) | |||
| #define IS_MPU_ACCESS_CACHEABLE(STATE) (((STATE) == MPU_ACCESS_CACHEABLE) || \ | |||
| ((STATE) == MPU_ACCESS_NOT_CACHEABLE)) | |||
| #define IS_MPU_ACCESS_BUFFERABLE(STATE) (((STATE) == MPU_ACCESS_BUFFERABLE) || \ | |||
| ((STATE) == MPU_ACCESS_NOT_BUFFERABLE)) | |||
| #define IS_MPU_REGION_PERMISSION_ATTRIBUTE(TYPE) (((TYPE) == MPU_REGION_NO_ACCESS) || \ | |||
| ((TYPE) == MPU_REGION_PRIV_RW) || \ | |||
| ((TYPE) == MPU_REGION_PRIV_RW_URO) || \ | |||
| ((TYPE) == MPU_REGION_FULL_ACCESS) || \ | |||
| ((TYPE) == MPU_REGION_PRIV_RO) || \ | |||
| ((TYPE) == MPU_REGION_PRIV_RO_URO)) | |||
| #define IS_MPU_REGION_NUMBER(NUMBER) (((NUMBER) == MPU_REGION_NUMBER0) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER1) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER2) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER3) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER4) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER5) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER6) || \ | |||
| ((NUMBER) == MPU_REGION_NUMBER7)) | |||
| #define IS_MPU_REGION_SIZE(SIZE) (((SIZE) == MPU_REGION_SIZE_256B) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_512B) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_1KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_2KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_4KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_8KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_16KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_32KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_64KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_128KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_256KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_512KB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_1MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_2MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_4MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_8MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_16MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_32MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_64MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_128MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_256MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_512MB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_1GB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_2GB) || \ | |||
| ((SIZE) == MPU_REGION_SIZE_4GB)) | |||
| #define IS_MPU_SUB_REGION_DISABLE(SUBREGION) ((SUBREGION) < (uint16_t)0x00FFU) | |||
| #endif /* __MPU_PRESENT */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_CORTEX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,344 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_crc.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of CRC HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef STM32L0xx_HAL_CRC_H | |||
| #define STM32L0xx_HAL_CRC_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @addtogroup CRC | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup CRC_Exported_Types CRC Exported Types | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief CRC HAL State Structure definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_CRC_STATE_RESET = 0x00U, /*!< CRC not yet initialized or disabled */ | |||
| HAL_CRC_STATE_READY = 0x01U, /*!< CRC initialized and ready for use */ | |||
| HAL_CRC_STATE_BUSY = 0x02U, /*!< CRC internal process is ongoing */ | |||
| HAL_CRC_STATE_TIMEOUT = 0x03U, /*!< CRC timeout state */ | |||
| HAL_CRC_STATE_ERROR = 0x04U /*!< CRC error state */ | |||
| } HAL_CRC_StateTypeDef; | |||
| /** | |||
| * @brief CRC Init Structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint8_t DefaultPolynomialUse; /*!< This parameter is a value of @ref CRC_Default_Polynomial and indicates if default polynomial is used. | |||
| If set to DEFAULT_POLYNOMIAL_ENABLE, resort to default | |||
| X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + X^4 + X^2+ X +1. | |||
| In that case, there is no need to set GeneratingPolynomial field. | |||
| If otherwise set to DEFAULT_POLYNOMIAL_DISABLE, GeneratingPolynomial and CRCLength fields must be set. */ | |||
| uint8_t DefaultInitValueUse; /*!< This parameter is a value of @ref CRC_Default_InitValue_Use and indicates if default init value is used. | |||
| If set to DEFAULT_INIT_VALUE_ENABLE, resort to default | |||
| 0xFFFFFFFF value. In that case, there is no need to set InitValue field. | |||
| If otherwise set to DEFAULT_INIT_VALUE_DISABLE, InitValue field must be set. */ | |||
| uint32_t GeneratingPolynomial; /*!< Set CRC generating polynomial as a 7, 8, 16 or 32-bit long value for a polynomial degree | |||
| respectively equal to 7, 8, 16 or 32. This field is written in normal representation, | |||
| e.g., for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65. | |||
| No need to specify it if DefaultPolynomialUse is set to DEFAULT_POLYNOMIAL_ENABLE. */ | |||
| uint32_t CRCLength; /*!< This parameter is a value of @ref CRC_Polynomial_Sizes and indicates CRC length. | |||
| Value can be either one of | |||
| @arg @ref CRC_POLYLENGTH_32B (32-bit CRC), | |||
| @arg @ref CRC_POLYLENGTH_16B (16-bit CRC), | |||
| @arg @ref CRC_POLYLENGTH_8B (8-bit CRC), | |||
| @arg @ref CRC_POLYLENGTH_7B (7-bit CRC). */ | |||
| uint32_t InitValue; /*!< Init value to initiate CRC computation. No need to specify it if DefaultInitValueUse | |||
| is set to DEFAULT_INIT_VALUE_ENABLE. */ | |||
| uint32_t InputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Input_Data_Inversion and specifies input data inversion mode. | |||
| Can be either one of the following values | |||
| @arg @ref CRC_INPUTDATA_INVERSION_NONE no input data inversion | |||
| @arg @ref CRC_INPUTDATA_INVERSION_BYTE byte-wise inversion, 0x1A2B3C4D becomes 0x58D43CB2 | |||
| @arg @ref CRC_INPUTDATA_INVERSION_HALFWORD halfword-wise inversion, 0x1A2B3C4D becomes 0xD458B23C | |||
| @arg @ref CRC_INPUTDATA_INVERSION_WORD word-wise inversion, 0x1A2B3C4D becomes 0xB23CD458 */ | |||
| uint32_t OutputDataInversionMode; /*!< This parameter is a value of @ref CRCEx_Output_Data_Inversion and specifies output data (i.e. CRC) inversion mode. | |||
| Can be either | |||
| @arg @ref CRC_OUTPUTDATA_INVERSION_DISABLE no CRC inversion, | |||
| @arg @ref CRC_OUTPUTDATA_INVERSION_ENABLE CRC 0x11223344 is converted into 0x22CC4488 */ | |||
| } CRC_InitTypeDef; | |||
| /** | |||
| * @brief CRC Handle Structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| CRC_TypeDef *Instance; /*!< Register base address */ | |||
| CRC_InitTypeDef Init; /*!< CRC configuration parameters */ | |||
| HAL_LockTypeDef Lock; /*!< CRC Locking object */ | |||
| __IO HAL_CRC_StateTypeDef State; /*!< CRC communication state */ | |||
| uint32_t InputDataFormat; /*!< This parameter is a value of @ref CRC_Input_Buffer_Format and specifies input data format. | |||
| Can be either | |||
| @arg @ref CRC_INPUTDATA_FORMAT_BYTES input data is a stream of bytes (8-bit data) | |||
| @arg @ref CRC_INPUTDATA_FORMAT_HALFWORDS input data is a stream of half-words (16-bit data) | |||
| @arg @ref CRC_INPUTDATA_FORMAT_WORDS input data is a stream of words (32-bit data) | |||
| Note that constant CRC_INPUT_FORMAT_UNDEFINED is defined but an initialization error | |||
| must occur if InputBufferFormat is not one of the three values listed above */ | |||
| } CRC_HandleTypeDef; | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup CRC_Exported_Constants CRC Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRC_Default_Polynomial_Value Default CRC generating polynomial | |||
| * @{ | |||
| */ | |||
| #define DEFAULT_CRC32_POLY 0x04C11DB7U /*!< X^32 + X^26 + X^23 + X^22 + X^16 + X^12 + X^11 + X^10 +X^8 + X^7 + X^5 + X^4 + X^2+ X +1 */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Default_InitValue Default CRC computation initialization value | |||
| * @{ | |||
| */ | |||
| #define DEFAULT_CRC_INITVALUE 0xFFFFFFFFU /*!< Initial CRC default value */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Default_Polynomial Indicates whether or not default polynomial is used | |||
| * @{ | |||
| */ | |||
| #define DEFAULT_POLYNOMIAL_ENABLE ((uint8_t)0x00U) /*!< Enable default generating polynomial 0x04C11DB7 */ | |||
| #define DEFAULT_POLYNOMIAL_DISABLE ((uint8_t)0x01U) /*!< Disable default generating polynomial 0x04C11DB7 */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Default_InitValue_Use Indicates whether or not default init value is used | |||
| * @{ | |||
| */ | |||
| #define DEFAULT_INIT_VALUE_ENABLE ((uint8_t)0x00U) /*!< Enable initial CRC default value */ | |||
| #define DEFAULT_INIT_VALUE_DISABLE ((uint8_t)0x01U) /*!< Disable initial CRC default value */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Polynomial_Sizes Polynomial sizes to configure the peripheral | |||
| * @{ | |||
| */ | |||
| #define CRC_POLYLENGTH_32B 0x00000000U /*!< Resort to a 32-bit long generating polynomial */ | |||
| #define CRC_POLYLENGTH_16B CRC_CR_POLYSIZE_0 /*!< Resort to a 16-bit long generating polynomial */ | |||
| #define CRC_POLYLENGTH_8B CRC_CR_POLYSIZE_1 /*!< Resort to a 8-bit long generating polynomial */ | |||
| #define CRC_POLYLENGTH_7B CRC_CR_POLYSIZE /*!< Resort to a 7-bit long generating polynomial */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Polynomial_Size_Definitions CRC polynomial possible sizes actual definitions | |||
| * @{ | |||
| */ | |||
| #define HAL_CRC_LENGTH_32B 32U /*!< 32-bit long CRC */ | |||
| #define HAL_CRC_LENGTH_16B 16U /*!< 16-bit long CRC */ | |||
| #define HAL_CRC_LENGTH_8B 8U /*!< 8-bit long CRC */ | |||
| #define HAL_CRC_LENGTH_7B 7U /*!< 7-bit long CRC */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Input_Buffer_Format Input Buffer Format | |||
| * @{ | |||
| */ | |||
| /* WARNING: CRC_INPUT_FORMAT_UNDEFINED is created for reference purposes but | |||
| * an error is triggered in HAL_CRC_Init() if InputDataFormat field is set | |||
| * to CRC_INPUT_FORMAT_UNDEFINED: the format MUST be defined by the user for | |||
| * the CRC APIs to provide a correct result */ | |||
| #define CRC_INPUTDATA_FORMAT_UNDEFINED 0x00000000U /*!< Undefined input data format */ | |||
| #define CRC_INPUTDATA_FORMAT_BYTES 0x00000001U /*!< Input data in byte format */ | |||
| #define CRC_INPUTDATA_FORMAT_HALFWORDS 0x00000002U /*!< Input data in half-word format */ | |||
| #define CRC_INPUTDATA_FORMAT_WORDS 0x00000003U /*!< Input data in word format */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRC_Aliases CRC API aliases | |||
| * @{ | |||
| */ | |||
| #define HAL_CRC_Input_Data_Reverse HAL_CRCEx_Input_Data_Reverse /*!< Aliased to HAL_CRCEx_Input_Data_Reverse for inter STM32 series compatibility */ | |||
| #define HAL_CRC_Output_Data_Reverse HAL_CRCEx_Output_Data_Reverse /*!< Aliased to HAL_CRCEx_Output_Data_Reverse for inter STM32 series compatibility */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macros -----------------------------------------------------------*/ | |||
| /** @defgroup CRC_Exported_Macros CRC Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Reset CRC handle state. | |||
| * @param __HANDLE__ CRC handle. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRC_STATE_RESET) | |||
| /** | |||
| * @brief Reset CRC Data Register. | |||
| * @param __HANDLE__ CRC handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_DR_RESET(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_RESET) | |||
| /** | |||
| * @brief Set CRC INIT non-default value | |||
| * @param __HANDLE__ CRC handle | |||
| * @param __INIT__ 32-bit initial value | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_INITIALCRCVALUE_CONFIG(__HANDLE__, __INIT__) ((__HANDLE__)->Instance->INIT = (__INIT__)) | |||
| /** | |||
| * @brief Store data in the Independent Data (ID) register. | |||
| * @param __HANDLE__ CRC handle | |||
| * @param __VALUE__ Value to be stored in the ID register | |||
| * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_SET_IDR(__HANDLE__, __VALUE__) (WRITE_REG((__HANDLE__)->Instance->IDR, (__VALUE__))) | |||
| /** | |||
| * @brief Return the data stored in the Independent Data (ID) register. | |||
| * @param __HANDLE__ CRC handle | |||
| * @note Refer to the Reference Manual to get the authorized __VALUE__ length in bits | |||
| * @retval Value of the ID register | |||
| */ | |||
| #define __HAL_CRC_GET_IDR(__HANDLE__) (((__HANDLE__)->Instance->IDR) & CRC_IDR_IDR) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private macros --------------------------------------------------------*/ | |||
| /** @defgroup CRC_Private_Macros CRC Private Macros | |||
| * @{ | |||
| */ | |||
| #define IS_DEFAULT_POLYNOMIAL(DEFAULT) (((DEFAULT) == DEFAULT_POLYNOMIAL_ENABLE) || \ | |||
| ((DEFAULT) == DEFAULT_POLYNOMIAL_DISABLE)) | |||
| #define IS_DEFAULT_INIT_VALUE(VALUE) (((VALUE) == DEFAULT_INIT_VALUE_ENABLE) || \ | |||
| ((VALUE) == DEFAULT_INIT_VALUE_DISABLE)) | |||
| #define IS_CRC_POL_LENGTH(LENGTH) (((LENGTH) == CRC_POLYLENGTH_32B) || \ | |||
| ((LENGTH) == CRC_POLYLENGTH_16B) || \ | |||
| ((LENGTH) == CRC_POLYLENGTH_8B) || \ | |||
| ((LENGTH) == CRC_POLYLENGTH_7B)) | |||
| #define IS_CRC_INPUTDATA_FORMAT(FORMAT) (((FORMAT) == CRC_INPUTDATA_FORMAT_BYTES) || \ | |||
| ((FORMAT) == CRC_INPUTDATA_FORMAT_HALFWORDS) || \ | |||
| ((FORMAT) == CRC_INPUTDATA_FORMAT_WORDS)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Include CRC HAL Extended module */ | |||
| #include "stm32l0xx_hal_crc_ex.h" | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup CRC_Exported_Functions CRC Exported Functions | |||
| * @{ | |||
| */ | |||
| /* Initialization and de-initialization functions ****************************/ | |||
| /** @defgroup CRC_Exported_Functions_Group1 Initialization and de-initialization functions | |||
| * @{ | |||
| */ | |||
| HAL_StatusTypeDef HAL_CRC_Init(CRC_HandleTypeDef *hcrc); | |||
| HAL_StatusTypeDef HAL_CRC_DeInit(CRC_HandleTypeDef *hcrc); | |||
| void HAL_CRC_MspInit(CRC_HandleTypeDef *hcrc); | |||
| void HAL_CRC_MspDeInit(CRC_HandleTypeDef *hcrc); | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Peripheral Control functions ***********************************************/ | |||
| /** @defgroup CRC_Exported_Functions_Group2 Peripheral Control functions | |||
| * @{ | |||
| */ | |||
| uint32_t HAL_CRC_Accumulate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); | |||
| uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength); | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Peripheral State and Error functions ***************************************/ | |||
| /** @defgroup CRC_Exported_Functions_Group3 Peripheral State functions | |||
| * @{ | |||
| */ | |||
| HAL_CRC_StateTypeDef HAL_CRC_GetState(CRC_HandleTypeDef *hcrc); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* STM32L0xx_HAL_CRC_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,153 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_crc_ex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of CRC HAL extended module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef STM32L0xx_HAL_CRC_EX_H | |||
| #define STM32L0xx_HAL_CRC_EX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @addtogroup CRCEx | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup CRCEx_Exported_Constants CRC Extended Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRCEx_Input_Data_Inversion Input Data Inversion Modes | |||
| * @{ | |||
| */ | |||
| #define CRC_INPUTDATA_INVERSION_NONE 0x00000000U /*!< No input data inversion */ | |||
| #define CRC_INPUTDATA_INVERSION_BYTE CRC_CR_REV_IN_0 /*!< Byte-wise input data inversion */ | |||
| #define CRC_INPUTDATA_INVERSION_HALFWORD CRC_CR_REV_IN_1 /*!< HalfWord-wise input data inversion */ | |||
| #define CRC_INPUTDATA_INVERSION_WORD CRC_CR_REV_IN /*!< Word-wise input data inversion */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRCEx_Output_Data_Inversion Output Data Inversion Modes | |||
| * @{ | |||
| */ | |||
| #define CRC_OUTPUTDATA_INVERSION_DISABLE 0x00000000U /*!< No output data inversion */ | |||
| #define CRC_OUTPUTDATA_INVERSION_ENABLE CRC_CR_REV_OUT /*!< Bit-wise output data inversion */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| /** @defgroup CRCEx_Exported_Macros CRC Extended Exported Macros | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief Set CRC output reversal | |||
| * @param __HANDLE__ CRC handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_OUTPUTREVERSAL_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= CRC_CR_REV_OUT) | |||
| /** | |||
| * @brief Unset CRC output reversal | |||
| * @param __HANDLE__ CRC handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_OUTPUTREVERSAL_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~(CRC_CR_REV_OUT)) | |||
| /** | |||
| * @brief Set CRC non-default polynomial | |||
| * @param __HANDLE__ CRC handle | |||
| * @param __POLYNOMIAL__ 7, 8, 16 or 32-bit polynomial | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRC_POLYNOMIAL_CONFIG(__HANDLE__, __POLYNOMIAL__) ((__HANDLE__)->Instance->POL = (__POLYNOMIAL__)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private macros --------------------------------------------------------*/ | |||
| /** @defgroup CRCEx_Private_Macros CRC Extended Private Macros | |||
| * @{ | |||
| */ | |||
| #define IS_CRC_INPUTDATA_INVERSION_MODE(MODE) (((MODE) == CRC_INPUTDATA_INVERSION_NONE) || \ | |||
| ((MODE) == CRC_INPUTDATA_INVERSION_BYTE) || \ | |||
| ((MODE) == CRC_INPUTDATA_INVERSION_HALFWORD) || \ | |||
| ((MODE) == CRC_INPUTDATA_INVERSION_WORD)) | |||
| #define IS_CRC_OUTPUTDATA_INVERSION_MODE(MODE) (((MODE) == CRC_OUTPUTDATA_INVERSION_DISABLE) || \ | |||
| ((MODE) == CRC_OUTPUTDATA_INVERSION_ENABLE)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @addtogroup CRCEx_Exported_Functions | |||
| * @{ | |||
| */ | |||
| /** @addtogroup CRCEx_Exported_Functions_Group1 | |||
| * @{ | |||
| */ | |||
| /* Initialization and de-initialization functions ****************************/ | |||
| HAL_StatusTypeDef HAL_CRCEx_Polynomial_Set(CRC_HandleTypeDef *hcrc, uint32_t Pol, uint32_t PolyLength); | |||
| HAL_StatusTypeDef HAL_CRCEx_Input_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t InputReverseMode); | |||
| HAL_StatusTypeDef HAL_CRCEx_Output_Data_Reverse(CRC_HandleTypeDef *hcrc, uint32_t OutputReverseMode); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* STM32L0xx_HAL_CRC_EX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,411 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_cryp.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of CRYP HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_CRYP_H | |||
| #define __STM32L0xx_HAL_CRYP_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if defined (STM32L021xx) || defined (STM32L041xx) || defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRYP CRYP | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup CRYP_Exported_Types CRYP Exported Types | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief CRYP Configuration Structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint32_t DataType; /*!< 32-bit data, 16-bit data, 8-bit data or 1-bit string. | |||
| This parameter can be a value of @ref CRYP_Data_Type */ | |||
| uint8_t* pKey; /*!< The key used for encryption/decryption */ | |||
| uint8_t* pInitVect; /*!< The initialization vector used also as initialization | |||
| counter in CTR mode */ | |||
| }CRYP_InitTypeDef; | |||
| /** | |||
| * @brief HAL CRYP State structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_CRYP_STATE_RESET = 0x00U, /*!< CRYP not yet initialized or disabled */ | |||
| HAL_CRYP_STATE_READY = 0x01U, /*!< CRYP initialized and ready for use */ | |||
| HAL_CRYP_STATE_BUSY = 0x02U, /*!< CRYP internal processing is ongoing */ | |||
| HAL_CRYP_STATE_TIMEOUT = 0x03U, /*!< CRYP timeout state */ | |||
| HAL_CRYP_STATE_ERROR = 0x04U /*!< CRYP error state */ | |||
| }HAL_CRYP_STATETypeDef; | |||
| /** | |||
| * @brief HAL CRYP phase structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_CRYP_PHASE_READY = 0x01U, /*!< CRYP peripheral is ready for initialization. */ | |||
| HAL_CRYP_PHASE_PROCESS = 0x02U, /*!< CRYP peripheral is in processing phase */ | |||
| }HAL_PhaseTypeDef; | |||
| /** | |||
| * @brief CRYP handle Structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| AES_TypeDef *Instance; /*!< Register base address */ | |||
| CRYP_InitTypeDef Init; /*!< CRYP required parameters */ | |||
| uint8_t *pCrypInBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ | |||
| uint8_t *pCrypOutBuffPtr; /*!< Pointer to CRYP processing (encryption, decryption,...) buffer */ | |||
| __IO uint16_t CrypInCount; /*!< Counter of inputed data */ | |||
| __IO uint16_t CrypOutCount; /*!< Counter of outputed data */ | |||
| HAL_StatusTypeDef Status; /*!< CRYP peripheral status */ | |||
| HAL_PhaseTypeDef Phase; /*!< CRYP peripheral phase */ | |||
| DMA_HandleTypeDef *hdmain; /*!< CRYP In DMA handle parameters */ | |||
| DMA_HandleTypeDef *hdmaout; /*!< CRYP Out DMA handle parameters */ | |||
| HAL_LockTypeDef Lock; /*!< CRYP locking object */ | |||
| __IO HAL_CRYP_STATETypeDef State; /*!< CRYP peripheral state */ | |||
| }CRYP_HandleTypeDef; | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup CRYP_Exported_Constants CRYP Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRYP_Data_Type CRYP Data Type | |||
| * @{ | |||
| */ | |||
| #define CRYP_DATATYPE_32B ((uint32_t)0x00000000U) | |||
| #define CRYP_DATATYPE_16B AES_CR_DATATYPE_0 | |||
| #define CRYP_DATATYPE_8B AES_CR_DATATYPE_1 | |||
| #define CRYP_DATATYPE_1B AES_CR_DATATYPE | |||
| #define IS_CRYP_DATATYPE(DATATYPE) (((DATATYPE) == CRYP_DATATYPE_32B) || \ | |||
| ((DATATYPE) == CRYP_DATATYPE_16B) || \ | |||
| ((DATATYPE) == CRYP_DATATYPE_8B) || \ | |||
| ((DATATYPE) == CRYP_DATATYPE_1B)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_AlgoModeDirection CRYP Algo Mode Direction | |||
| * @{ | |||
| */ | |||
| #define CRYP_CR_ALGOMODE_DIRECTION (uint32_t)(AES_CR_MODE|AES_CR_CHMOD) | |||
| #define CRYP_CR_ALGOMODE_AES_ECB_ENCRYPT ((uint32_t)0x00000000U) | |||
| #define CRYP_CR_ALGOMODE_AES_ECB_KEYDERDECRYPT (AES_CR_MODE) | |||
| #define CRYP_CR_ALGOMODE_AES_CBC_ENCRYPT (AES_CR_CHMOD_0) | |||
| #define CRYP_CR_ALGOMODE_AES_CBC_KEYDERDECRYPT ((uint32_t)(AES_CR_CHMOD_0|AES_CR_MODE)) | |||
| #define CRYP_CR_ALGOMODE_AES_CTR_ENCRYPT (AES_CR_CHMOD_1) | |||
| #define CRYP_CR_ALGOMODE_AES_CTR_DECRYPT ((uint32_t)(AES_CR_CHMOD_1 | AES_CR_MODE_1)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_AES_Interrupts AES Interrupts | |||
| * @{ | |||
| */ | |||
| #define CRYP_IT_CC AES_CR_CCIE /*!< Computation Complete interrupt */ | |||
| #define CRYP_IT_ERR AES_CR_ERRIE /*!< Error interrupt */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_AES_Flags AES Flags | |||
| * @{ | |||
| */ | |||
| #define CRYP_FLAG_CCF AES_SR_CCF /*!< Computation Complete Flag */ | |||
| #define CRYP_FLAG_RDERR AES_SR_RDERR /*!< Read Error Flag */ | |||
| #define CRYP_FLAG_WRERR AES_SR_WRERR /*!< Write Error Flag */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_AES_Clear_Flags AES Clear Flags | |||
| * @{ | |||
| */ | |||
| #define CRYP_CLEARFLAG_CCF AES_CR_CCFC /*!< Computation Complete Flag Clear */ | |||
| #define CRYP_CLEARFLAG_RDERR AES_CR_ERRC /*!< Read Error Clear */ | |||
| #define CRYP_CLEARFLAG_WRERR AES_CR_ERRC /*!< Write Error Clear */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| /** @defgroup CRYP_Exported_Macros CRYP Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Reset CRYP handle state | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_CRYP_STATE_RESET) | |||
| /** | |||
| * @brief Enable/Disable the CRYP peripheral. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR, AES_CR_EN) | |||
| #define __HAL_CRYP_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR, AES_CR_EN) | |||
| /** | |||
| * @brief Set the algorithm mode: AES-ECB, AES-CBC, AES-CTR, DES-ECB, DES-CBC,... | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __MODE__ The algorithm mode. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_SET_MODE(__HANDLE__,__MODE__) SET_BIT((__HANDLE__)->Instance->CR, (__MODE__)) | |||
| /** @brief Check whether the specified CRYP flag is set or not. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __FLAG__ specifies the flag to check. | |||
| * This parameter can be one of the following values: | |||
| * @arg CRYP_FLAG_CCF : Computation Complete Flag | |||
| * @arg CRYP_FLAG_RDERR : Read Error Flag | |||
| * @arg CRYP_FLAG_WRERR : Write Error Flag | |||
| * @retval The new state of __FLAG__ (TRUE or FALSE). | |||
| */ | |||
| #define __HAL_CRYP_GET_FLAG(__HANDLE__,__FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) | |||
| /** @brief Clear the CRYP pending flag. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __FLAG__ specifies the flag to clear. | |||
| * This parameter can be one of the following values: | |||
| * @arg CRYP_CLEARFLAG_CCF : Computation Complete Clear Flag | |||
| * @arg CRYP_CLEARFLAG_RDERR : Read Error Clear | |||
| * @arg CRYP_CLEARFLAG_WRERR : Write Error Clear | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_CLEAR_FLAG(__HANDLE__, __FLAG__) SET_BIT((__HANDLE__)->Instance->CR, (__FLAG__)) | |||
| /** | |||
| * @brief Enable the CRYP interrupt. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __INTERRUPT__ CRYP Interrupt. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_ENABLE_IT(__HANDLE__,__INTERRUPT__) SET_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) | |||
| /** | |||
| * @brief Disable the CRYP interrupt. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __INTERRUPT__ CRYP interrupt. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_DISABLE_IT(__HANDLE__,__INTERRUPT__) CLEAR_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) | |||
| /** @brief Checks if the specified CRYP interrupt source is enabled or disabled. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __INTERRUPT__ CRYP interrupt source to check | |||
| * This parameter can be one of the following values: | |||
| * @arg CRYP_IT_CC : Computation Complete interrupt | |||
| * @arg CRYP_IT_ERR : Error interrupt (used for RDERR and WRERR) | |||
| * @retval State of interruption (SET or RESET) | |||
| */ | |||
| #define __HAL_CRYP_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \ | |||
| (( ((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__) \ | |||
| )? SET : RESET \ | |||
| ) | |||
| /** @brief Clear the CRYP pending IT. | |||
| * @param __HANDLE__ specifies the CRYP handle. | |||
| * @param __IT__ specifies the IT to clear. | |||
| * This parameter can be one of the following values: | |||
| * @arg CRYP_CLEARFLAG_CCF : Computation Complete Clear Flag | |||
| * @arg CRYP_CLEARFLAG_RDERR : Read Error Clear | |||
| * @arg CRYP_CLEARFLAG_WRERR : Write Error Clear | |||
| * @retval None | |||
| */ | |||
| #define __HAL_CRYP_CLEAR_IT(__HANDLE__, __IT__) SET_BIT((__HANDLE__)->Instance->CR, (__IT__)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Include CRYP HAL Extension module */ | |||
| #include "stm32l0xx_hal_cryp_ex.h" | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup CRYP_Exported_Functions CRYP Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRYP_Exported_Functions_Group1 Initialization and de-initialization functions | |||
| * @{ | |||
| */ | |||
| /* Initialization/de-initialization functions *********************************/ | |||
| HAL_StatusTypeDef HAL_CRYP_Init(CRYP_HandleTypeDef *hcryp); | |||
| HAL_StatusTypeDef HAL_CRYP_DeInit(CRYP_HandleTypeDef *hcryp); | |||
| /* MSP functions *************************************************************/ | |||
| void HAL_CRYP_MspInit(CRYP_HandleTypeDef *hcryp); | |||
| void HAL_CRYP_MspDeInit(CRYP_HandleTypeDef *hcryp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_Exported_Functions_Group2 AES processing functions | |||
| * @{ | |||
| */ | |||
| /* AES encryption/decryption using polling ***********************************/ | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData, uint32_t Timeout); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData, uint32_t Timeout); | |||
| /* AES encryption/decryption using interrupt *********************************/ | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_IT(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| /* AES encryption/decryption using DMA ***************************************/ | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESECB_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCBC_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Encrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pPlainData, uint16_t Size, uint8_t *pCypherData); | |||
| HAL_StatusTypeDef HAL_CRYP_AESCTR_Decrypt_DMA(CRYP_HandleTypeDef *hcryp, uint8_t *pCypherData, uint16_t Size, uint8_t *pPlainData); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup CRYP_Exported_Functions_Group3 DMA callback functions | |||
| * @{ | |||
| */ | |||
| /* CallBack functions ********************************************************/ | |||
| void HAL_CRYP_InCpltCallback(CRYP_HandleTypeDef *hcryp); | |||
| void HAL_CRYP_OutCpltCallback(CRYP_HandleTypeDef *hcryp); | |||
| void HAL_CRYP_ErrorCallback(CRYP_HandleTypeDef *hcryp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_Exported_Functions_Group4 CRYP IRQ handler | |||
| * @{ | |||
| */ | |||
| /* Processing functions ********************************************************/ | |||
| void HAL_CRYP_IRQHandler(CRYP_HandleTypeDef *hcryp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup CRYP_Exported_Functions_Group5 Peripheral State functions | |||
| * @{ | |||
| */ | |||
| /* Peripheral State functions **************************************************/ | |||
| HAL_CRYP_STATETypeDef HAL_CRYP_GetState(CRYP_HandleTypeDef *hcryp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Define the private group ***********************************/ | |||
| /**************************************************************/ | |||
| /** @defgroup CRYP_Private CRYP Private | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /**************************************************************/ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* STM32L021xx || STM32L041xx || STM32L061xx || STM32L062xx || STM32L063xx || STM32L081xx || STM32L082xx || STM32L083xx */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_CRYP_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,81 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_cryp_ex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of CRYPEx HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_CRYP_EX_H | |||
| #define __STM32L0xx_HAL_CRYP_EX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if defined (STM32L021xx) || defined (STM32L041xx) || defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) || (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRYPEx CRYPEx | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup CRYPEx_Exported_Functions CRYPEx Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup CRYPEx_Exported_Functions_Group1 Extended features functions | |||
| * @{ | |||
| */ | |||
| /* CallBack functions ********************************************************/ | |||
| void HAL_CRYPEx_ComputationCpltCallback(CRYP_HandleTypeDef *hcryp); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* STM32L021xx || STM32L041xx || STM32L061xx || STM32L062xx || STM32L063xx || STM32L081xx || STM32L082xx || STM32L083xx */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* __STM32L0xx_HAL_CRYP_EX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,486 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_dac.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of DAC HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_DAC_H | |||
| #define __STM32L0xx_HAL_DAC_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if !defined (STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) && !defined (STM32L011xx) && !defined (STM32L021xx) && !defined (STM32L031xx) && !defined (STM32L041xx) && !defined (STM32L051xx) && !defined (STM32L061xx) && !defined (STM32L071xx) && !defined (STM32L081xx) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup DAC DAC | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup DAC_Exported_Types DAC Exported Types | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief HAL State structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_DAC_STATE_RESET = 0x00U, /*!< DAC not yet initialized or disabled */ | |||
| HAL_DAC_STATE_READY = 0x01U, /*!< DAC initialized and ready for use */ | |||
| HAL_DAC_STATE_BUSY = 0x02U, /*!< DAC internal processing is ongoing */ | |||
| HAL_DAC_STATE_TIMEOUT = 0x03U, /*!< DAC timeout state */ | |||
| HAL_DAC_STATE_ERROR = 0x04U /*!< DAC error state */ | |||
| }HAL_DAC_StateTypeDef; | |||
| /** | |||
| * @brief DAC handle Structure definition | |||
| */ | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| typedef struct __DAC_HandleTypeDef | |||
| #else | |||
| typedef struct DAC_HandleTypeDef | |||
| #endif | |||
| { | |||
| DAC_TypeDef *Instance; /*!< Register base address */ | |||
| __IO HAL_DAC_StateTypeDef State; /*!< DAC communication state */ | |||
| HAL_LockTypeDef Lock; /*!< DAC locking object */ | |||
| DMA_HandleTypeDef *DMA_Handle1; /*!< Pointer DMA handler for channel 1 */ | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| DMA_HandleTypeDef *DMA_Handle2; /*!< Pointer DMA handler for channel 2 */ | |||
| #endif | |||
| __IO uint32_t ErrorCode; /*!< DAC Error code */ | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| void (* ConvCpltCallbackCh1) (struct __DAC_HandleTypeDef *hdac); | |||
| void (* ConvHalfCpltCallbackCh1) (struct __DAC_HandleTypeDef *hdac); | |||
| void (* ErrorCallbackCh1) (struct __DAC_HandleTypeDef *hdac); | |||
| void (* DMAUnderrunCallbackCh1) (struct __DAC_HandleTypeDef *hdac); | |||
| void (* ConvCpltCallbackCh2) (struct __DAC_HandleTypeDef* hdac); | |||
| void (* ConvHalfCpltCallbackCh2) (struct __DAC_HandleTypeDef* hdac); | |||
| void (* ErrorCallbackCh2) (struct __DAC_HandleTypeDef* hdac); | |||
| void (* DMAUnderrunCallbackCh2) (struct __DAC_HandleTypeDef* hdac); | |||
| void (* MspInitCallback) (struct __DAC_HandleTypeDef *hdac); | |||
| void (* MspDeInitCallback ) (struct __DAC_HandleTypeDef *hdac); | |||
| #endif /* USE_HAL_DAC_REGISTER_CALLBACKS */ | |||
| }DAC_HandleTypeDef; | |||
| /** | |||
| * @brief DAC Configuration regular Channel structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint32_t DAC_Trigger; /*!< Specifies the external trigger for the selected DAC channel. | |||
| This parameter can be a value of @ref DAC_trigger_selection */ | |||
| uint32_t DAC_OutputBuffer; /*!< Specifies whether the DAC channel output buffer is enabled or disabled. | |||
| This parameter can be a value of @ref DAC_output_buffer */ | |||
| }DAC_ChannelConfTypeDef; | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| /** | |||
| * @brief HAL DAC Callback ID enumeration definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_DAC_CH1_COMPLETE_CB_ID = 0x00U, /*!< DAC CH1 Complete Callback ID */ | |||
| HAL_DAC_CH1_HALF_COMPLETE_CB_ID = 0x01U, /*!< DAC CH1 half Complete Callback ID */ | |||
| HAL_DAC_CH1_ERROR_ID = 0x02U, /*!< DAC CH1 error Callback ID */ | |||
| HAL_DAC_CH1_UNDERRUN_CB_ID = 0x03U, /*!< DAC CH1 underrun Callback ID */ | |||
| HAL_DAC_CH2_COMPLETE_CB_ID = 0x04U, /*!< DAC CH2 Complete Callback ID */ | |||
| HAL_DAC_CH2_HALF_COMPLETE_CB_ID = 0x05U, /*!< DAC CH2 half Complete Callback ID */ | |||
| HAL_DAC_CH2_ERROR_ID = 0x06U, /*!< DAC CH2 error Callback ID */ | |||
| HAL_DAC_CH2_UNDERRUN_CB_ID = 0x07U, /*!< DAC CH2 underrun Callback ID */ | |||
| HAL_DAC_MSP_INIT_CB_ID = 0x08U, /*!< DAC MspInit Callback ID */ | |||
| HAL_DAC_MSP_DEINIT_CB_ID = 0x09U, /*!< DAC MspDeInit Callback ID */ | |||
| HAL_DAC_ALL_CB_ID = 0x0AU /*!< DAC All ID */ | |||
| }HAL_DAC_CallbackIDTypeDef; | |||
| /** | |||
| * @brief HAL DAC Callback pointer definition | |||
| */ | |||
| typedef void (*pDAC_CallbackTypeDef)(DAC_HandleTypeDef *hdac); | |||
| #endif /* USE_HAL_DAC_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup DAC_Exported_Constants DAC Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup DAC_Error_Code DAC Error Code | |||
| * @{ | |||
| */ | |||
| #define HAL_DAC_ERROR_NONE 0x00U /*!< No error */ | |||
| #define HAL_DAC_ERROR_DMAUNDERRUNCH1 0x01U /*!< DAC channel1 DMA underrun error */ | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define HAL_DAC_ERROR_DMAUNDERRUNCH2 0x02U /*!< DAC channel2 DMA underrun error */ | |||
| #endif | |||
| #define HAL_DAC_ERROR_DMA 0x04U /*!< DMA error */ | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| #define HAL_DAC_ERROR_INVALID_CALLBACK 0x10U /*!< Invalid callback error */ | |||
| #endif /* USE_HAL_DAC_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_trigger_selection DAC trigger selection | |||
| * @{ | |||
| */ | |||
| #define DAC_TRIGGER_NONE ((uint32_t)0x00000000U) /*!< Conversion is automatic once the DAC1_DHRxxxx register has been loaded, and not by external trigger */ | |||
| #define DAC_TRIGGER_T6_TRGO ((uint32_t) DAC_CR_TEN1) /*!< TIM6 TRGO selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_T21_TRGO ((uint32_t)( DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM21 TRGO selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_T2_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TEN1)) /*!< TIM2 TRGO selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_EXT_IT9 ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< EXTI Line9 event selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_SOFTWARE ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_1 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< Conversion started by software trigger for DAC channel */ | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define DAC_TRIGGER_T3_TRGO ((uint32_t)( DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM3 TRGO selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_T3_CH3 ((uint32_t)( DAC_CR_TSEL1_1 | DAC_CR_TEN1)) /*!< TIM3 CH3 selected as external conversion trigger for DAC channel */ | |||
| #define DAC_TRIGGER_T7_TRGO ((uint32_t)(DAC_CR_TSEL1_2 | DAC_CR_TSEL1_0 | DAC_CR_TEN1)) /*!< TIM7 TRGO selected as external conversion trigger for DAC channel */ | |||
| #endif | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T3_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T3_CH3) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T7_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T21_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) | |||
| #else /* STM32L072xx || STM32L073xx || STM32L082xx || STM32L083xx */ | |||
| #define IS_DAC_TRIGGER(TRIGGER) (((TRIGGER) == DAC_TRIGGER_NONE) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T6_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T21_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_T2_TRGO) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_EXT_IT9) || \ | |||
| ((TRIGGER) == DAC_TRIGGER_SOFTWARE)) | |||
| #endif /* STM32L072xx || STM32L073xx || STM32L082xx || STM32L083xx */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_output_buffer DAC output buffer | |||
| * @{ | |||
| */ | |||
| #define DAC_OUTPUTBUFFER_ENABLE ((uint32_t)0x00000000U) | |||
| #define DAC_OUTPUTBUFFER_DISABLE ((uint32_t)DAC_CR_BOFF1) | |||
| #define IS_DAC_OUTPUT_BUFFER_STATE(STATE) (((STATE) == DAC_OUTPUTBUFFER_ENABLE) || \ | |||
| ((STATE) == DAC_OUTPUTBUFFER_DISABLE)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_Channel_selection DAC Channel selection | |||
| * @{ | |||
| */ | |||
| #define DAC_CHANNEL_1 ((uint32_t)0x00000000U) | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define DAC_CHANNEL_2 ((uint32_t)0x00000010U) | |||
| #endif | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define IS_DAC_CHANNEL(CHANNEL) (((CHANNEL) == DAC_CHANNEL_1) || \ | |||
| ((CHANNEL) == DAC_CHANNEL_2)) | |||
| #else | |||
| #define IS_DAC_CHANNEL(CHANNEL) ((CHANNEL) == DAC_CHANNEL_1) | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_data_alignement DAC data alignement | |||
| * @{ | |||
| */ | |||
| #define DAC_ALIGN_12B_R ((uint32_t)0x00000000U) | |||
| #define DAC_ALIGN_12B_L ((uint32_t)0x00000004U) | |||
| #define DAC_ALIGN_8B_R ((uint32_t)0x00000008U) | |||
| #define IS_DAC_ALIGN(ALIGN) (((ALIGN) == DAC_ALIGN_12B_R) || \ | |||
| ((ALIGN) == DAC_ALIGN_12B_L) || \ | |||
| ((ALIGN) == DAC_ALIGN_8B_R)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_data DAC data | |||
| * @{ | |||
| */ | |||
| #define IS_DAC_DATA(DATA) ((DATA) <= 0xFFF0U) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_flags_definition DAC flags definition | |||
| * @{ | |||
| */ | |||
| #define DAC_FLAG_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define DAC_FLAG_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_IT_definition DAC IT definition | |||
| * @{ | |||
| */ | |||
| #define DAC_IT_DMAUDR1 ((uint32_t)DAC_SR_DMAUDR1) | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define DAC_IT_DMAUDR2 ((uint32_t)DAC_SR_DMAUDR2) | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| /** @defgroup DAC_Exported_Macros DAC Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Reset DAC handle state | |||
| * @param __HANDLE__ specifies the DAC handle. | |||
| * @retval None | |||
| */ | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| #define __HAL_DAC_RESET_HANDLE_STATE(__HANDLE__) do { \ | |||
| (__HANDLE__)->State = HAL_DAC_STATE_RESET; \ | |||
| (__HANDLE__)->MspInitCallback = NULL; \ | |||
| (__HANDLE__)->MspDeInitCallback = NULL; \ | |||
| } while(0) | |||
| #else | |||
| #define __HAL_DAC_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DAC_STATE_RESET) | |||
| #endif /* USE_HAL_DAC_REGISTER_CALLBACKS */ | |||
| /** @brief Enable the DAC channel | |||
| * @param __HANDLE__ specifies the DAC handle. | |||
| * @param __DAC_CHANNEL__ specifies the DAC channel | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DAC_ENABLE(__HANDLE__, __DAC_CHANNEL__) \ | |||
| SET_BIT((__HANDLE__)->Instance->CR, (DAC_CR_EN1 << (__DAC_CHANNEL__))) | |||
| /** @brief Disable the DAC channel | |||
| * @param __HANDLE__ specifies the DAC handle | |||
| * @param __DAC_CHANNEL__ specifies the DAC channel. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DAC_DISABLE(__HANDLE__, __DAC_CHANNEL__) \ | |||
| CLEAR_BIT((__HANDLE__)->Instance->CR, (DAC_CR_EN1 << (__DAC_CHANNEL__))) | |||
| #define __HAL_DAC_ENABLE_IT(__HANDLE__, __INTERRUPT__) \ | |||
| SET_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) | |||
| /** @brief Disable the DAC interrupt | |||
| * @param __HANDLE__ specifies the DAC handle | |||
| * @param __INTERRUPT__ specifies the DAC interrupt. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DAC_DISABLE_IT(__HANDLE__, __INTERRUPT__) \ | |||
| CLEAR_BIT((__HANDLE__)->Instance->CR, (__INTERRUPT__)) | |||
| /** @brief Check whether the specified DAC interrupt source is enabled or not. | |||
| * @param __HANDLE__ DAC handle | |||
| * @param __INTERRUPT__ DAC interrupt source to check | |||
| * This parameter can be any combination of the following values: | |||
| * @arg DAC_IT_DMAUDR1: DAC channel 1 DMA underrun interrupt | |||
| * @arg DAC_IT_DMAUDR2: DAC channel 2 DMA underrun interrupt (STM32L072xx STM32L073xx STM32L082xx STM32L083xx only) | |||
| * @retval State of interruption (SET or RESET) | |||
| */ | |||
| #define __HAL_DAC_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) \ | |||
| (((__HANDLE__)->Instance->CR & (__INTERRUPT__)) == (__INTERRUPT__)) | |||
| /** @brief Get the selected DAC's flag status. | |||
| * @param __HANDLE__ specifies the DAC handle. | |||
| * @param __FLAG__ specifies the FLAG. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DAC_GET_FLAG(__HANDLE__, __FLAG__) \ | |||
| ((((__HANDLE__)->Instance->SR) & (__FLAG__)) == (__FLAG__)) | |||
| /** @brief Clear the DAC's flag. | |||
| * @param __HANDLE__ specifies the DAC handle. | |||
| * @param __FLAG__ specifies the FLAG. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DAC_CLEAR_FLAG(__HANDLE__, __FLAG__) \ | |||
| (((__HANDLE__)->Instance->SR) = (__FLAG__)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Private macro ------------------------------------------------------------*/ | |||
| /** @defgroup DAC_Private_Macros DAC Private Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Set DHR12R1 alignment | |||
| * @param __ALIGNMENT__ specifies the DAC alignement | |||
| * @retval None | |||
| */ | |||
| #define DAC_DHR12R1_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000008U) + (__ALIGNMENT__)) | |||
| /** @brief Set DHR12R2 alignment | |||
| * @param __ALIGNMENT__ specifies the DAC alignement | |||
| * @retval None | |||
| */ | |||
| #define DAC_DHR12R2_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000014U) + (__ALIGNMENT__)) | |||
| /** @brief Set DHR12RD alignment | |||
| * @param __ALIGNMENT__ specifies the DAC alignement | |||
| * @retval None | |||
| */ | |||
| #define DAC_DHR12RD_ALIGNMENT(__ALIGNMENT__) (((uint32_t)0x00000020U) + (__ALIGNMENT__)) | |||
| /** @brief Enable the DAC interrupt | |||
| * @param __HANDLE__ specifies the DAC handle | |||
| * @param __INTERRUPT__ specifies the DAC interrupt. | |||
| * @retval None | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Include DAC HAL Extension module */ | |||
| #include "stm32l0xx_hal_dac_ex.h" | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup DAC_Exported_Functions DAC Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup DAC_Exported_Functions_Group1 Initialization and de-initialization functions | |||
| * @{ | |||
| */ | |||
| /* Initialization and de-initialization functions *****************************/ | |||
| HAL_StatusTypeDef HAL_DAC_Init(DAC_HandleTypeDef* hdac); | |||
| HAL_StatusTypeDef HAL_DAC_DeInit(DAC_HandleTypeDef* hdac); | |||
| void HAL_DAC_MspInit(DAC_HandleTypeDef* hdac); | |||
| void HAL_DAC_MspDeInit(DAC_HandleTypeDef* hdac); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_Exported_Functions_Group2 IO operation functions | |||
| * @{ | |||
| */ | |||
| /* IO operation functions *****************************************************/ | |||
| HAL_StatusTypeDef HAL_DAC_Start(DAC_HandleTypeDef* hdac, uint32_t Channel); | |||
| HAL_StatusTypeDef HAL_DAC_Stop(DAC_HandleTypeDef* hdac, uint32_t Channel); | |||
| HAL_StatusTypeDef HAL_DAC_Start_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t* pData, uint32_t Length, uint32_t Alignment); | |||
| HAL_StatusTypeDef HAL_DAC_Stop_DMA(DAC_HandleTypeDef* hdac, uint32_t Channel); | |||
| HAL_StatusTypeDef HAL_DAC_SetValue(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Alignment, uint32_t Data); | |||
| uint32_t HAL_DAC_GetValue(DAC_HandleTypeDef* hdac, uint32_t Channel); | |||
| void HAL_DAC_IRQHandler(DAC_HandleTypeDef* hdac); | |||
| void HAL_DAC_ConvCpltCallbackCh1(DAC_HandleTypeDef* hdac); | |||
| void HAL_DAC_ConvHalfCpltCallbackCh1(DAC_HandleTypeDef* hdac); | |||
| void HAL_DAC_ErrorCallbackCh1(DAC_HandleTypeDef *hdac); | |||
| void HAL_DAC_DMAUnderrunCallbackCh1(DAC_HandleTypeDef *hdac); | |||
| #if (USE_HAL_DAC_REGISTER_CALLBACKS == 1) | |||
| /* DAC callback registering/unregistering */ | |||
| HAL_StatusTypeDef HAL_DAC_RegisterCallback (DAC_HandleTypeDef *hdac, HAL_DAC_CallbackIDTypeDef CallbackId, pDAC_CallbackTypeDef pCallback); | |||
| HAL_StatusTypeDef HAL_DAC_UnRegisterCallback (DAC_HandleTypeDef *hdac, HAL_DAC_CallbackIDTypeDef CallbackId); | |||
| #endif /* USE_HAL_DAC_REGISTER_CALLBACKS */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_Exported_Functions_Group3 Peripheral Control functions | |||
| * @{ | |||
| */ | |||
| /* Peripheral Control functions ***********************************************/ | |||
| HAL_StatusTypeDef HAL_DAC_ConfigChannel(DAC_HandleTypeDef* hdac, DAC_ChannelConfTypeDef* sConfig, uint32_t Channel); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DAC_Exported_Functions_Group4 Peripheral State and Errors functions | |||
| * @{ | |||
| */ | |||
| /* Peripheral State functions ***************************************************/ | |||
| HAL_DAC_StateTypeDef HAL_DAC_GetState(DAC_HandleTypeDef* hdac); | |||
| uint32_t HAL_DAC_GetError(DAC_HandleTypeDef *hdac); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* !STM32L010xB && !STM32L010x8 && !STM32L010x6 && !STM32L010x4 && !STM32L011xx && !STM32L021xx && !STM32L031xx && !STM32L041xx && !STM32L061xx && !STM32L071xx && !STM32L081xx*/ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /*__STM32L0xx_HAL_DAC_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,167 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_dac_ex.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of DAC HAL Extension module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_DAC_EX_H | |||
| #define __STM32L0xx_HAL_DAC_EX_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| #if !defined(STM32L010xB) && !defined (STM32L010x8) && !defined (STM32L010x6) && !defined (STM32L010x4) && !defined (STM32L011xx) && !defined (STM32L021xx) && !defined (STM32L031xx) && !defined (STM32L041xx) && !defined (STM32L051xx) && !defined (STM32L061xx) && !defined (STM32L071xx) && !defined (STM32L081xx) | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @defgroup DACEx DACEx | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup DACEx_Exported_Constants DACEx Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup DACEx_lfsrunmask_triangleamplitude DACEx lfsrunmask triangleamplitude | |||
| * @{ | |||
| */ | |||
| #define DAC_LFSRUNMASK_BIT0 ((uint32_t)0x00000000U) /*!< Unmask DAC channel LFSR bit0 for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS1_0 ((uint32_t)DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[1:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS2_0 ((uint32_t)DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[2:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS3_0 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0)/*!< Unmask DAC channel LFSR bit[3:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS4_0 ((uint32_t)DAC_CR_MAMP1_2) /*!< Unmask DAC channel LFSR bit[4:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS5_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[5:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS6_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[6:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS7_0 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[7:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS8_0 ((uint32_t)DAC_CR_MAMP1_3) /*!< Unmask DAC channel LFSR bit[8:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS9_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[9:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS10_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Unmask DAC channel LFSR bit[10:0] for noise wave generation */ | |||
| #define DAC_LFSRUNMASK_BITS11_0 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Unmask DAC channel LFSR bit[11:0] for noise wave generation */ | |||
| #define DAC_TRIANGLEAMPLITUDE_1 ((uint32_t)0x00000000U) /*!< Select max triangle amplitude of 1 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_3 ((uint32_t)DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 3 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_7 ((uint32_t)DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 7 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_15 ((uint32_t)DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 15 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_31 ((uint32_t)DAC_CR_MAMP1_2) /*!< Select max triangle amplitude of 31 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_63 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 63 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_127 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 127 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_255 ((uint32_t)DAC_CR_MAMP1_2 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 255 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_511 ((uint32_t)DAC_CR_MAMP1_3) /*!< Select max triangle amplitude of 511 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_1023 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 1023 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_2047 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1) /*!< Select max triangle amplitude of 2047 */ | |||
| #define DAC_TRIANGLEAMPLITUDE_4095 ((uint32_t)DAC_CR_MAMP1_3 | DAC_CR_MAMP1_1 | DAC_CR_MAMP1_0) /*!< Select max triangle amplitude of 4095 */ | |||
| #define IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(VALUE) (((VALUE) == DAC_LFSRUNMASK_BIT0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS1_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS2_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS3_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS4_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS5_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS6_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS7_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS8_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS9_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS10_0) || \ | |||
| ((VALUE) == DAC_LFSRUNMASK_BITS11_0) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_1) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_3) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_7) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_15) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_31) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_63) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_127) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_255) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_511) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_1023) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_2047) || \ | |||
| ((VALUE) == DAC_TRIANGLEAMPLITUDE_4095)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @defgroup DACEx_Exported_Functions DACEx Exported Functions | |||
| * @{ | |||
| */ | |||
| /** @defgroup DACEx_Exported_Functions_Group1 Extended features functions | |||
| * @{ | |||
| */ | |||
| /* Extension features functions ***********************************************/ | |||
| HAL_StatusTypeDef HAL_DACEx_TriangleWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); | |||
| HAL_StatusTypeDef HAL_DACEx_NoiseWaveGenerate(DAC_HandleTypeDef* hdac, uint32_t Channel, uint32_t Amplitude); | |||
| #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| uint32_t HAL_DACEx_DualGetValue(DAC_HandleTypeDef* hdac); | |||
| HAL_StatusTypeDef HAL_DACEx_DualSetValue(DAC_HandleTypeDef* hdac, uint32_t Alignment, uint32_t Data1, uint32_t Data2); | |||
| void HAL_DACEx_ConvCpltCallbackCh2(DAC_HandleTypeDef* hdac); | |||
| void HAL_DACEx_ConvHalfCpltCallbackCh2(DAC_HandleTypeDef* hdac); | |||
| void HAL_DACEx_ErrorCallbackCh2(DAC_HandleTypeDef* hdac); | |||
| void HAL_DACEx_DMAUnderrunCallbackCh2(DAC_HandleTypeDef* hdac); | |||
| #endif | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Define the private group ***********************************/ | |||
| /**************************************************************/ | |||
| /** @defgroup DACEx_Private DACEx Private | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /**************************************************************/ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #endif /* !STM32L010xB && !STM32L010x8 && !STM32L010x6 && !STM32L010x4 && !STM32L011xx && !STM32L021xx && !STM32L031xx && !STM32L041xx && !STM32L051xx && !STM32L061xx && !STM32L071xx && !STM32L081xx*/ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /*__STM32L0xx_HAL_DAC_EX_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,190 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_def.h | |||
| * @author MCD Application Team | |||
| * @brief This file contains HAL common defines, enumeration, macros and | |||
| * structures definitions. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© Copyright (c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef __STM32L0xx_HAL_DEF | |||
| #define __STM32L0xx_HAL_DEF | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx.h" | |||
| #include "Legacy/stm32_hal_legacy.h" | |||
| #include <stddef.h> | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** | |||
| * @brief HAL Status structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_OK = 0x00U, | |||
| HAL_ERROR = 0x01U, | |||
| HAL_BUSY = 0x02U, | |||
| HAL_TIMEOUT = 0x03U | |||
| } HAL_StatusTypeDef; | |||
| /** | |||
| * @brief HAL Lock structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_UNLOCKED = 0x00U, | |||
| HAL_LOCKED = 0x01U | |||
| } HAL_LockTypeDef; | |||
| /* Exported macro ------------------------------------------------------------*/ | |||
| #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */ | |||
| #define HAL_MAX_DELAY 0xFFFFFFFFU | |||
| #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) == (BIT)) | |||
| #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U) | |||
| #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \ | |||
| do{ \ | |||
| (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \ | |||
| (__DMA_HANDLE__).Parent = (__HANDLE__); \ | |||
| } while(0) | |||
| /** @brief Reset the Handle's State field. | |||
| * @param __HANDLE__: specifies the Peripheral Handle. | |||
| * @note This macro can be used for the following purpose: | |||
| * - When the Handle is declared as local variable; before passing it as parameter | |||
| * to HAL_PPP_Init() for the first time, it is mandatory to use this macro | |||
| * to set to 0 the Handle's "State" field. | |||
| * Otherwise, "State" field may have any random value and the first time the function | |||
| * HAL_PPP_Init() is called, the low level hardware initialization will be missed | |||
| * (i.e. HAL_PPP_MspInit() will not be executed). | |||
| * - When there is a need to reconfigure the low level hardware: instead of calling | |||
| * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init(). | |||
| * In this later function, when the Handle's "State" field is set to 0, it will execute the function | |||
| * HAL_PPP_MspInit() which will reconfigure the low level hardware. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U) | |||
| #if (USE_RTOS == 1) | |||
| /* Reserved for future use */ | |||
| #error "USE_RTOS should be 0 in the current HAL release" | |||
| #else | |||
| #define __HAL_LOCK(__HANDLE__) \ | |||
| do{ \ | |||
| if((__HANDLE__)->Lock == HAL_LOCKED) \ | |||
| { \ | |||
| return HAL_BUSY; \ | |||
| } \ | |||
| else \ | |||
| { \ | |||
| (__HANDLE__)->Lock = HAL_LOCKED; \ | |||
| } \ | |||
| }while (0) | |||
| #define __HAL_UNLOCK(__HANDLE__) \ | |||
| do{ \ | |||
| (__HANDLE__)->Lock = HAL_UNLOCKED; \ | |||
| }while (0) | |||
| #endif /* USE_RTOS */ | |||
| #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */ | |||
| #ifndef __weak | |||
| #define __weak __attribute__((weak)) | |||
| #endif /* __weak */ | |||
| #ifndef __packed | |||
| #define __packed __attribute__((__packed__)) | |||
| #endif /* __packed */ | |||
| #define __NOINLINE __attribute__ ( (noinline) ) | |||
| #endif /* __GNUC__ */ | |||
| /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */ | |||
| #if defined (__GNUC__) && !defined (__CC_ARM) /* GNU Compiler */ | |||
| #ifndef __ALIGN_END | |||
| #define __ALIGN_END __attribute__ ((aligned (4))) | |||
| #endif /* __ALIGN_END */ | |||
| #ifndef __ALIGN_BEGIN | |||
| #define __ALIGN_BEGIN | |||
| #endif /* __ALIGN_BEGIN */ | |||
| #else | |||
| #ifndef __ALIGN_END | |||
| #define __ALIGN_END | |||
| #endif /* __ALIGN_END */ | |||
| #ifndef __ALIGN_BEGIN | |||
| #if defined (__CC_ARM) /* ARM Compiler */ | |||
| #define __ALIGN_BEGIN __align(4) | |||
| #elif defined (__ICCARM__) /* IAR Compiler */ | |||
| #define __ALIGN_BEGIN | |||
| #endif /* __CC_ARM */ | |||
| #endif /* __ALIGN_BEGIN */ | |||
| #endif /* __GNUC__ */ | |||
| /** | |||
| * @brief __RAM_FUNC definition | |||
| */ | |||
| #if defined ( __CC_ARM ) | |||
| /* ARM Compiler | |||
| ------------ | |||
| RAM functions are defined using the toolchain options. | |||
| Functions that are executed in RAM should reside in a separate source module. | |||
| Using the 'Options for File' dialog you can simply change the 'Code / Const' | |||
| area of a module to a memory space in physical RAM. | |||
| Available memory areas are declared in the 'Target' tab of the 'Options for Target' | |||
| dialog. | |||
| */ | |||
| #define __RAM_FUNC | |||
| #define __NOINLINE __attribute__ ( (noinline) ) | |||
| #elif defined ( __ICCARM__ ) | |||
| /* ICCARM Compiler | |||
| --------------- | |||
| RAM functions are defined using a specific toolchain keyword "__ramfunc". | |||
| */ | |||
| #define __RAM_FUNC __ramfunc | |||
| #define __NOINLINE _Pragma("optimize = no_inline") | |||
| #elif defined ( __GNUC__ ) | |||
| /* GNU Compiler | |||
| ------------ | |||
| RAM functions are defined using a specific toolchain attribute | |||
| "__attribute__((section(".RamFunc")))". | |||
| */ | |||
| #define __RAM_FUNC __attribute__((section(".RamFunc"))) | |||
| #endif | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* ___STM32L0xx_HAL_DEF */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||
| @@ -0,0 +1,675 @@ | |||
| /** | |||
| ****************************************************************************** | |||
| * @file stm32l0xx_hal_dma.h | |||
| * @author MCD Application Team | |||
| * @brief Header file of DMA HAL module. | |||
| ****************************************************************************** | |||
| * @attention | |||
| * | |||
| * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics. | |||
| * All rights reserved.</center></h2> | |||
| * | |||
| * This software component is licensed by ST under BSD 3-Clause license, | |||
| * the "License"; You may not use this file except in compliance with the | |||
| * License. You may obtain a copy of the License at: | |||
| * opensource.org/licenses/BSD-3-Clause | |||
| * | |||
| ****************************************************************************** | |||
| */ | |||
| /* Define to prevent recursive inclusion -------------------------------------*/ | |||
| #ifndef STM32L0xx_HAL_DMA_H | |||
| #define STM32L0xx_HAL_DMA_H | |||
| #ifdef __cplusplus | |||
| extern "C" { | |||
| #endif | |||
| /* Includes ------------------------------------------------------------------*/ | |||
| #include "stm32l0xx_hal_def.h" | |||
| /** @addtogroup STM32L0xx_HAL_Driver | |||
| * @{ | |||
| */ | |||
| /** @addtogroup DMA | |||
| * @{ | |||
| */ | |||
| /* Exported types ------------------------------------------------------------*/ | |||
| /** @defgroup DMA_Exported_Types DMA Exported Types | |||
| * @{ | |||
| */ | |||
| /** | |||
| * @brief DMA Configuration Structure definition | |||
| */ | |||
| typedef struct | |||
| { | |||
| uint32_t Request; /*!< Specifies the request selected for the specified channel. | |||
| This parameter can be a value of @ref DMA_request */ | |||
| uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral, | |||
| from memory to memory or from peripheral to memory. | |||
| This parameter can be a value of @ref DMA_Data_transfer_direction */ | |||
| uint32_t PeriphInc; /*!< Specifies whether the Peripheral address register should be incremented or not. | |||
| This parameter can be a value of @ref DMA_Peripheral_incremented_mode */ | |||
| uint32_t MemInc; /*!< Specifies whether the memory address register should be incremented or not. | |||
| This parameter can be a value of @ref DMA_Memory_incremented_mode */ | |||
| uint32_t PeriphDataAlignment; /*!< Specifies the Peripheral data width. | |||
| This parameter can be a value of @ref DMA_Peripheral_data_size */ | |||
| uint32_t MemDataAlignment; /*!< Specifies the Memory data width. | |||
| This parameter can be a value of @ref DMA_Memory_data_size */ | |||
| uint32_t Mode; /*!< Specifies the operation mode of the DMAy Channelx. | |||
| This parameter can be a value of @ref DMA_mode | |||
| @note The circular buffer mode cannot be used if the memory-to-memory | |||
| data transfer is configured on the selected Channel */ | |||
| uint32_t Priority; /*!< Specifies the software priority for the DMAy Channelx. | |||
| This parameter can be a value of @ref DMA_Priority_level */ | |||
| } DMA_InitTypeDef; | |||
| /** | |||
| * @brief HAL DMA State structures definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_DMA_STATE_RESET = 0x00U, /*!< DMA not yet initialized or disabled */ | |||
| HAL_DMA_STATE_READY = 0x01U, /*!< DMA initialized and ready for use */ | |||
| HAL_DMA_STATE_BUSY = 0x02U, /*!< DMA process is ongoing */ | |||
| HAL_DMA_STATE_TIMEOUT = 0x03U, /*!< DMA timeout state */ | |||
| }HAL_DMA_StateTypeDef; | |||
| /** | |||
| * @brief HAL DMA Error Code structure definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_DMA_FULL_TRANSFER = 0x00U, /*!< Full transfer */ | |||
| HAL_DMA_HALF_TRANSFER = 0x01U /*!< Half Transfer */ | |||
| }HAL_DMA_LevelCompleteTypeDef; | |||
| /** | |||
| * @brief HAL DMA Callback ID structure definition | |||
| */ | |||
| typedef enum | |||
| { | |||
| HAL_DMA_XFER_CPLT_CB_ID = 0x00U, /*!< Full transfer */ | |||
| HAL_DMA_XFER_HALFCPLT_CB_ID = 0x01U, /*!< Half transfer */ | |||
| HAL_DMA_XFER_ERROR_CB_ID = 0x02U, /*!< Error */ | |||
| HAL_DMA_XFER_ABORT_CB_ID = 0x03U, /*!< Abort */ | |||
| HAL_DMA_XFER_ALL_CB_ID = 0x04U /*!< All */ | |||
| }HAL_DMA_CallbackIDTypeDef; | |||
| /** | |||
| * @brief DMA handle Structure definition | |||
| */ | |||
| typedef struct __DMA_HandleTypeDef | |||
| { | |||
| DMA_Channel_TypeDef *Instance; /*!< Register base address */ | |||
| DMA_InitTypeDef Init; /*!< DMA communication parameters */ | |||
| HAL_LockTypeDef Lock; /*!< DMA locking object */ | |||
| __IO HAL_DMA_StateTypeDef State; /*!< DMA transfer state */ | |||
| void *Parent; /*!< Parent object state */ | |||
| void (* XferCpltCallback)(struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer complete callback */ | |||
| void (* XferHalfCpltCallback)(struct __DMA_HandleTypeDef * hdma); /*!< DMA Half transfer complete callback */ | |||
| void (* XferErrorCallback)(struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer error callback */ | |||
| void (* XferAbortCallback)( struct __DMA_HandleTypeDef * hdma); /*!< DMA transfer abort callback */ | |||
| __IO uint32_t ErrorCode; /*!< DMA Error code */ | |||
| DMA_TypeDef *DmaBaseAddress; /*!< DMA Channel Base Address */ | |||
| uint32_t ChannelIndex; /*!< DMA Channel Index */ | |||
| }DMA_HandleTypeDef; | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported constants --------------------------------------------------------*/ | |||
| /** @defgroup DMA_Exported_Constants DMA Exported Constants | |||
| * @{ | |||
| */ | |||
| /** @defgroup DMA_Error_Code DMA Error Code | |||
| * @{ | |||
| */ | |||
| #define HAL_DMA_ERROR_NONE 0x00000000U /*!< No error */ | |||
| #define HAL_DMA_ERROR_TE 0x00000001U /*!< Transfer error */ | |||
| #define HAL_DMA_ERROR_NO_XFER 0x00000004U /*!< Abort requested with no Xfer ongoing */ | |||
| #define HAL_DMA_ERROR_TIMEOUT 0x00000020U /*!< Timeout error */ | |||
| #define HAL_DMA_ERROR_NOT_SUPPORTED 0x00000100U /*!< Not supported mode */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_request DMA request | |||
| * @{ | |||
| */ | |||
| #if defined (STM32L010x4) || defined (STM32L010x6) || defined (STM32L010x8) || defined (STM32L010xC) | |||
| #define DMA_REQUEST_0 0U | |||
| #define DMA_REQUEST_1 1U | |||
| #define DMA_REQUEST_4 4U | |||
| #define DMA_REQUEST_5 5U | |||
| #define DMA_REQUEST_6 6U | |||
| #define DMA_REQUEST_8 8U | |||
| #define IS_DMA_ALL_REQUEST(REQUEST) (((REQUEST) == DMA_REQUEST_0) || \ | |||
| ((REQUEST) == DMA_REQUEST_1) || \ | |||
| ((REQUEST) == DMA_REQUEST_4) || \ | |||
| ((REQUEST) == DMA_REQUEST_5) || \ | |||
| ((REQUEST) == DMA_REQUEST_6) || \ | |||
| ((REQUEST) == DMA_REQUEST_8)) | |||
| /* STM32L010x4 || STM32L010x6 || STM32L010x8 || STM32L010xC */ | |||
| #elif defined (STM32L021xx) || defined (STM32L041xx) || defined (STM32L061xx) || defined (STM32L062xx) || defined (STM32L063xx) || defined (STM32L081xx) || defined (STM32L082xx) || defined (STM32L083xx) | |||
| #define DMA_REQUEST_0 0U | |||
| #define DMA_REQUEST_1 1U | |||
| #define DMA_REQUEST_2 2U | |||
| #define DMA_REQUEST_3 3U | |||
| #define DMA_REQUEST_4 4U | |||
| #define DMA_REQUEST_5 5U | |||
| #define DMA_REQUEST_6 6U | |||
| #define DMA_REQUEST_7 7U | |||
| #define DMA_REQUEST_8 8U | |||
| #define DMA_REQUEST_9 9U | |||
| #define DMA_REQUEST_10 10U | |||
| #define DMA_REQUEST_11 11U /* AES product only */ | |||
| #define DMA_REQUEST_12 12U | |||
| #define DMA_REQUEST_13 13U | |||
| #define DMA_REQUEST_14 14U | |||
| #define DMA_REQUEST_15 15U | |||
| #define IS_DMA_ALL_REQUEST(REQUEST) (((REQUEST) == DMA_REQUEST_0) || \ | |||
| ((REQUEST) == DMA_REQUEST_1) || \ | |||
| ((REQUEST) == DMA_REQUEST_2) || \ | |||
| ((REQUEST) == DMA_REQUEST_3) || \ | |||
| ((REQUEST) == DMA_REQUEST_4) || \ | |||
| ((REQUEST) == DMA_REQUEST_5) || \ | |||
| ((REQUEST) == DMA_REQUEST_6) || \ | |||
| ((REQUEST) == DMA_REQUEST_7) || \ | |||
| ((REQUEST) == DMA_REQUEST_8) || \ | |||
| ((REQUEST) == DMA_REQUEST_9) || \ | |||
| ((REQUEST) == DMA_REQUEST_10) || \ | |||
| ((REQUEST) == DMA_REQUEST_11) || \ | |||
| ((REQUEST) == DMA_REQUEST_12) || \ | |||
| ((REQUEST) == DMA_REQUEST_13) || \ | |||
| ((REQUEST) == DMA_REQUEST_14) || \ | |||
| ((REQUEST) == DMA_REQUEST_15)) | |||
| /* (STM32L021xx) || (STM32L041xx) || (STM32L061xx) || (STM32L062xx) || (STM32L063xx) || (STM32L081xx) || (STM32L082xx) || (STM32L083xx) */ | |||
| #else | |||
| #define DMA_REQUEST_0 0U | |||
| #define DMA_REQUEST_1 1U | |||
| #define DMA_REQUEST_2 2U | |||
| #define DMA_REQUEST_3 3U | |||
| #define DMA_REQUEST_4 4U | |||
| #define DMA_REQUEST_5 5U | |||
| #define DMA_REQUEST_6 6U | |||
| #define DMA_REQUEST_7 7U | |||
| #define DMA_REQUEST_8 8U | |||
| #define DMA_REQUEST_9 9U | |||
| #define DMA_REQUEST_10 10U | |||
| #define DMA_REQUEST_12 12U | |||
| #define DMA_REQUEST_13 13U | |||
| #define DMA_REQUEST_14 14U | |||
| #define DMA_REQUEST_15 15U | |||
| #define IS_DMA_ALL_REQUEST(REQUEST) (((REQUEST) == DMA_REQUEST_0) || \ | |||
| ((REQUEST) == DMA_REQUEST_1) || \ | |||
| ((REQUEST) == DMA_REQUEST_2) || \ | |||
| ((REQUEST) == DMA_REQUEST_3) || \ | |||
| ((REQUEST) == DMA_REQUEST_4) || \ | |||
| ((REQUEST) == DMA_REQUEST_5) || \ | |||
| ((REQUEST) == DMA_REQUEST_6) || \ | |||
| ((REQUEST) == DMA_REQUEST_7) || \ | |||
| ((REQUEST) == DMA_REQUEST_8) || \ | |||
| ((REQUEST) == DMA_REQUEST_9) || \ | |||
| ((REQUEST) == DMA_REQUEST_10) || \ | |||
| ((REQUEST) == DMA_REQUEST_12) || \ | |||
| ((REQUEST) == DMA_REQUEST_13) || \ | |||
| ((REQUEST) == DMA_REQUEST_14) || \ | |||
| ((REQUEST) == DMA_REQUEST_15)) | |||
| #endif /* (STM32L031xx) || (STM32L051xx) || (STM32L052xx) || (STM32L053xx) || (STM32L071xx) || (STM32L072xx) || (STM32L073xx) */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Data_transfer_direction DMA Data transfer direction | |||
| * @{ | |||
| */ | |||
| #define DMA_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */ | |||
| #define DMA_MEMORY_TO_PERIPH DMA_CCR_DIR /*!< Memory to peripheral direction */ | |||
| #define DMA_MEMORY_TO_MEMORY DMA_CCR_MEM2MEM /*!< Memory to memory direction */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Peripheral_incremented_mode DMA Peripheral incremented mode | |||
| * @{ | |||
| */ | |||
| #define DMA_PINC_ENABLE DMA_CCR_PINC /*!< Peripheral increment mode Enable */ | |||
| #define DMA_PINC_DISABLE 0x00000000U /*!< Peripheral increment mode Disable */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Memory_incremented_mode DMA Memory incremented mode | |||
| * @{ | |||
| */ | |||
| #define DMA_MINC_ENABLE DMA_CCR_MINC /*!< Memory increment mode Enable */ | |||
| #define DMA_MINC_DISABLE 0x00000000U /*!< Memory increment mode Disable */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Peripheral_data_size DMA Peripheral data size | |||
| * @{ | |||
| */ | |||
| #define DMA_PDATAALIGN_BYTE 0x00000000U /*!< Peripheral data alignment : Byte */ | |||
| #define DMA_PDATAALIGN_HALFWORD DMA_CCR_PSIZE_0 /*!< Peripheral data alignment : HalfWord */ | |||
| #define DMA_PDATAALIGN_WORD DMA_CCR_PSIZE_1 /*!< Peripheral data alignment : Word */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Memory_data_size DMA Memory data size | |||
| * @{ | |||
| */ | |||
| #define DMA_MDATAALIGN_BYTE 0x00000000U /*!< Memory data alignment : Byte */ | |||
| #define DMA_MDATAALIGN_HALFWORD DMA_CCR_MSIZE_0 /*!< Memory data alignment : HalfWord */ | |||
| #define DMA_MDATAALIGN_WORD DMA_CCR_MSIZE_1 /*!< Memory data alignment : Word */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_mode DMA mode | |||
| * @{ | |||
| */ | |||
| #define DMA_NORMAL 0x00000000U /*!< Normal mode */ | |||
| #define DMA_CIRCULAR DMA_CCR_CIRC /*!< Circular mode */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_Priority_level DMA Priority level | |||
| * @{ | |||
| */ | |||
| #define DMA_PRIORITY_LOW 0x00000000U /*!< Priority level : Low */ | |||
| #define DMA_PRIORITY_MEDIUM DMA_CCR_PL_0 /*!< Priority level : Medium */ | |||
| #define DMA_PRIORITY_HIGH DMA_CCR_PL_1 /*!< Priority level : High */ | |||
| #define DMA_PRIORITY_VERY_HIGH DMA_CCR_PL /*!< Priority level : Very_High */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_interrupt_enable_definitions DMA interrupt enable definitions | |||
| * @{ | |||
| */ | |||
| #define DMA_IT_TC DMA_CCR_TCIE | |||
| #define DMA_IT_HT DMA_CCR_HTIE | |||
| #define DMA_IT_TE DMA_CCR_TEIE | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @defgroup DMA_flag_definitions DMA flag definitions | |||
| * @{ | |||
| */ | |||
| #define DMA_FLAG_GL1 DMA_ISR_GIF1 | |||
| #define DMA_FLAG_TC1 DMA_ISR_TCIF1 | |||
| #define DMA_FLAG_HT1 DMA_ISR_HTIF1 | |||
| #define DMA_FLAG_TE1 DMA_ISR_TEIF1 | |||
| #define DMA_FLAG_GL2 DMA_ISR_GIF2 | |||
| #define DMA_FLAG_TC2 DMA_ISR_TCIF2 | |||
| #define DMA_FLAG_HT2 DMA_ISR_HTIF2 | |||
| #define DMA_FLAG_TE2 DMA_ISR_TEIF2 | |||
| #define DMA_FLAG_GL3 DMA_ISR_GIF3 | |||
| #define DMA_FLAG_TC3 DMA_ISR_TCIF3 | |||
| #define DMA_FLAG_HT3 DMA_ISR_HTIF3 | |||
| #define DMA_FLAG_TE3 DMA_ISR_TEIF3 | |||
| #define DMA_FLAG_GL4 DMA_ISR_GIF4 | |||
| #define DMA_FLAG_TC4 DMA_ISR_TCIF4 | |||
| #define DMA_FLAG_HT4 DMA_ISR_HTIF4 | |||
| #define DMA_FLAG_TE4 DMA_ISR_TEIF4 | |||
| #define DMA_FLAG_GL5 DMA_ISR_GIF5 | |||
| #define DMA_FLAG_TC5 DMA_ISR_TCIF5 | |||
| #define DMA_FLAG_HT5 DMA_ISR_HTIF5 | |||
| #define DMA_FLAG_TE5 DMA_ISR_TEIF5 | |||
| #define DMA_FLAG_GL6 DMA_ISR_GIF6 | |||
| #define DMA_FLAG_TC6 DMA_ISR_TCIF6 | |||
| #define DMA_FLAG_HT6 DMA_ISR_HTIF6 | |||
| #define DMA_FLAG_TE6 DMA_ISR_TEIF6 | |||
| #define DMA_FLAG_GL7 DMA_ISR_GIF7 | |||
| #define DMA_FLAG_TC7 DMA_ISR_TCIF7 | |||
| #define DMA_FLAG_HT7 DMA_ISR_HTIF7 | |||
| #define DMA_FLAG_TE7 DMA_ISR_TEIF7 | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported macros -----------------------------------------------------------*/ | |||
| /** @defgroup DMA_Exported_Macros DMA Exported Macros | |||
| * @{ | |||
| */ | |||
| /** @brief Reset DMA handle state. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DMA_STATE_RESET) | |||
| /** | |||
| * @brief Enable the specified DMA Channel. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR |= DMA_CCR_EN) | |||
| /** | |||
| * @brief Disable the specified DMA Channel. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CCR &= ~DMA_CCR_EN) | |||
| /* Interrupt & Flag management */ | |||
| /** | |||
| * @brief Return the current DMA Channel transfer complete flag. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval The specified transfer complete flag index. | |||
| */ | |||
| #if defined (STM32L010x4) || defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\ | |||
| DMA_FLAG_TC5) | |||
| #else | |||
| #define __HAL_DMA_GET_TC_FLAG_INDEX(__HANDLE__) \ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TC1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TC2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TC3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TC4 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TC5 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TC6 :\ | |||
| DMA_FLAG_TC7) | |||
| #endif | |||
| /** | |||
| * @brief Return the current DMA Channel half transfer complete flag. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval The specified half transfer complete flag index. | |||
| */ | |||
| #if defined (STM32L010x4) || defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\ | |||
| DMA_FLAG_HT5) | |||
| #else | |||
| #define __HAL_DMA_GET_HT_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_HT1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_HT2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_HT3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_HT4 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_HT5 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_HT6 :\ | |||
| DMA_FLAG_HT7) | |||
| #endif | |||
| /** | |||
| * @brief Returns the current DMA Channel transfer error flag. | |||
| * @param __HANDLE__ DMA handle | |||
| * @retval The specified transfer error flag index. | |||
| */ | |||
| #if defined (STM32L010x4) || defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\ | |||
| DMA_FLAG_TE5) | |||
| #else | |||
| #define __HAL_DMA_GET_TE_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_FLAG_TE1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_FLAG_TE2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_FLAG_TE3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_FLAG_TE4 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_FLAG_TE5 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_FLAG_TE6 :\ | |||
| DMA_FLAG_TE7) | |||
| #endif | |||
| /** | |||
| * @brief Returns the current DMA Channel Global interrupt flag. | |||
| * @param __HANDLE__ DMA handle | |||
| * @retval The specified transfer error flag index. | |||
| */ | |||
| #if defined (STM32L010x4) || defined (STM32L011xx) || defined (STM32L021xx) | |||
| #define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_ISR_GIF1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_ISR_GIF2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_ISR_GIF3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_ISR_GIF4 :\ | |||
| DMA_ISR_GIF5) | |||
| #else | |||
| #define __HAL_DMA_GET_GI_FLAG_INDEX(__HANDLE__)\ | |||
| (((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel1))? DMA_ISR_GIF1 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel2))? DMA_ISR_GIF2 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel3))? DMA_ISR_GIF3 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel4))? DMA_ISR_GIF4 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel5))? DMA_ISR_GIF5 :\ | |||
| ((uint32_t)((__HANDLE__)->Instance) == ((uint32_t)DMA1_Channel6))? DMA_ISR_GIF6 :\ | |||
| DMA_ISR_GIF7) | |||
| #endif | |||
| /** | |||
| * @brief Get the DMA Channel pending flags. | |||
| * @param __HANDLE__ DMA handle | |||
| * @param __FLAG__ Get the specified flag. | |||
| * This parameter can be any combination of the following values: | |||
| * @arg DMA_FLAG_TCIFx: Transfer complete flag | |||
| * @arg DMA_FLAG_HTIFx: Half transfer complete flag | |||
| * @arg DMA_FLAG_TEIFx: Transfer error flag | |||
| * @arg DMA_ISR_GIFx: Global interrupt flag | |||
| * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Channel flag. | |||
| * @retval The state of FLAG (SET or RESET). | |||
| */ | |||
| #define __HAL_DMA_GET_FLAG(__HANDLE__, __FLAG__) (DMA1->ISR & (__FLAG__)) | |||
| /** | |||
| * @brief Clears the DMA Channel pending flags. | |||
| * @param __HANDLE__ DMA handle | |||
| * @param __FLAG__ specifies the flag to clear. | |||
| * This parameter can be any combination of the following values: | |||
| * @arg DMA_FLAG_TCx: Transfer complete flag | |||
| * @arg DMA_FLAG_HTx: Half transfer complete flag | |||
| * @arg DMA_FLAG_TEx: Transfer error flag | |||
| * @arg DMA_FLAG_GLx: Global interrupt flag | |||
| * Where x can be 0_4, 1_5, 2_6 or 3_7 to select the DMA Channel flag. | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__) (DMA1->IFCR = (__FLAG__)) | |||
| /** | |||
| * @brief Enable the specified DMA Channel interrupts. | |||
| * @param __HANDLE__: DMA handle | |||
| * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled. | |||
| * This parameter can be any combination of the following values: | |||
| * @arg DMA_IT_TC: Transfer complete interrupt mask | |||
| * @arg DMA_IT_HT: Half transfer complete interrupt mask | |||
| * @arg DMA_IT_TE: Transfer error interrupt mask | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR |= (__INTERRUPT__)) | |||
| /** | |||
| * @brief Disable the specified DMA Channel interrupts. | |||
| * @param __HANDLE__: DMA handle | |||
| * @param __INTERRUPT__: specifies the DMA interrupt sources to be enabled or disabled. | |||
| * This parameter can be any combination of the following values: | |||
| * @arg DMA_IT_TC: Transfer complete interrupt mask | |||
| * @arg DMA_IT_HT: Half transfer complete interrupt mask | |||
| * @arg DMA_IT_TE: Transfer error interrupt mask | |||
| * @retval None | |||
| */ | |||
| #define __HAL_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->CCR &= ~(__INTERRUPT__)) | |||
| /** | |||
| * @brief Check whether the specified DMA Channel interrupt is enabled or not. | |||
| * @param __HANDLE__: DMA handle | |||
| * @param __INTERRUPT__: specifies the DMA interrupt source to check. | |||
| * This parameter can be one of the following values: | |||
| * @arg DMA_IT_TC: Transfer complete interrupt mask | |||
| * @arg DMA_IT_HT: Half transfer complete interrupt mask | |||
| * @arg DMA_IT_TE: Transfer error interrupt mask | |||
| * @retval The state of DMA_IT (SET or RESET). | |||
| */ | |||
| #define __HAL_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) (((__HANDLE__)->Instance->CCR & (__INTERRUPT__))) | |||
| /** | |||
| * @brief Return the number of remaining data units in the current DMA Channel transfer. | |||
| * @param __HANDLE__: DMA handle | |||
| * @retval The number of remaining data units in the current DMA Channel transfer. | |||
| */ | |||
| #define __HAL_DMA_GET_COUNTER(__HANDLE__) ((__HANDLE__)->Instance->CNDTR) | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Exported functions --------------------------------------------------------*/ | |||
| /** @addtogroup DMA_Exported_Functions | |||
| * @{ | |||
| */ | |||
| /** @addtogroup DMA_Exported_Functions_Group1 | |||
| * @{ | |||
| */ | |||
| /* Initialization and de-initialization functions *****************************/ | |||
| HAL_StatusTypeDef HAL_DMA_Init(DMA_HandleTypeDef *hdma); | |||
| HAL_StatusTypeDef HAL_DMA_DeInit (DMA_HandleTypeDef *hdma); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup DMA_Exported_Functions_Group2 | |||
| * @{ | |||
| */ | |||
| /* IO operation functions *****************************************************/ | |||
| HAL_StatusTypeDef HAL_DMA_Start (DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); | |||
| HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength); | |||
| HAL_StatusTypeDef HAL_DMA_Abort(DMA_HandleTypeDef *hdma); | |||
| HAL_StatusTypeDef HAL_DMA_Abort_IT(DMA_HandleTypeDef *hdma); | |||
| HAL_StatusTypeDef HAL_DMA_PollForTransfer(DMA_HandleTypeDef *hdma, HAL_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout); | |||
| void HAL_DMA_IRQHandler(DMA_HandleTypeDef *hdma); | |||
| HAL_StatusTypeDef HAL_DMA_RegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID, void (* pCallback)( DMA_HandleTypeDef * _hdma)); | |||
| HAL_StatusTypeDef HAL_DMA_UnRegisterCallback(DMA_HandleTypeDef *hdma, HAL_DMA_CallbackIDTypeDef CallbackID); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** @addtogroup DMA_Exported_Functions_Group3 | |||
| * @{ | |||
| */ | |||
| /* Peripheral State and Error functions ***************************************/ | |||
| HAL_DMA_StateTypeDef HAL_DMA_GetState(DMA_HandleTypeDef *hdma); | |||
| uint32_t HAL_DMA_GetError(DMA_HandleTypeDef *hdma); | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| /* Define the private group ***********************************/ | |||
| /**************************************************************/ | |||
| /** @defgroup DMA_Private DMA Private | |||
| * @{ | |||
| */ | |||
| #define IS_DMA_DIRECTION(DIRECTION) (((DIRECTION) == DMA_PERIPH_TO_MEMORY ) || \ | |||
| ((DIRECTION) == DMA_MEMORY_TO_PERIPH) || \ | |||
| ((DIRECTION) == DMA_MEMORY_TO_MEMORY)) | |||
| #define IS_DMA_BUFFER_SIZE(SIZE) (((SIZE) >= 0x1U) && ((SIZE) < 0x10000U)) | |||
| #define IS_DMA_PERIPHERAL_INC_STATE(STATE) (((STATE) == DMA_PINC_ENABLE) || \ | |||
| ((STATE) == DMA_PINC_DISABLE)) | |||
| #define IS_DMA_MEMORY_INC_STATE(STATE) (((STATE) == DMA_MINC_ENABLE) || \ | |||
| ((STATE) == DMA_MINC_DISABLE)) | |||
| #define IS_DMA_PERIPHERAL_DATA_SIZE(SIZE) (((SIZE) == DMA_PDATAALIGN_BYTE) || \ | |||
| ((SIZE) == DMA_PDATAALIGN_HALFWORD) || \ | |||
| ((SIZE) == DMA_PDATAALIGN_WORD)) | |||
| #define IS_DMA_MEMORY_DATA_SIZE(SIZE) (((SIZE) == DMA_MDATAALIGN_BYTE) || \ | |||
| ((SIZE) == DMA_MDATAALIGN_HALFWORD) || \ | |||
| ((SIZE) == DMA_MDATAALIGN_WORD )) | |||
| #define IS_DMA_MODE(MODE) (((MODE) == DMA_NORMAL ) || \ | |||
| ((MODE) == DMA_CIRCULAR)) | |||
| #define IS_DMA_PRIORITY(PRIORITY) (((PRIORITY) == DMA_PRIORITY_LOW ) || \ | |||
| ((PRIORITY) == DMA_PRIORITY_MEDIUM) || \ | |||
| ((PRIORITY) == DMA_PRIORITY_HIGH) || \ | |||
| ((PRIORITY) == DMA_PRIORITY_VERY_HIGH)) | |||
| /** | |||
| * @} | |||
| */ | |||
| /**************************************************************/ | |||
| /** | |||
| * @} | |||
| */ | |||
| /** | |||
| * @} | |||
| */ | |||
| #ifdef __cplusplus | |||
| } | |||
| #endif | |||
| #endif /* STM32L0xx_HAL_DMA_H */ | |||
| /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ | |||