├── README.md ├── stm32-nucleo-bo.jpg └── stm32F103_blinky_serial ├── .cproject ├── .gitignore ├── .project ├── .settings └── language.settings.xml ├── Debug ├── makefile ├── objects.mk ├── sources.mk ├── src │ ├── main.d │ └── subdir.mk ├── stm32F103_blinky_serial.elf ├── stm32F103_blinky_serial.hex ├── stm32F103_blinky_serial.map └── system │ └── src │ ├── cmsis │ ├── subdir.mk │ ├── system_stm32f10x.d │ └── vectors_stm32f10x.d │ ├── cortexm │ ├── _initialize_hardware.d │ ├── _reset_hardware.d │ ├── exception_handlers.d │ └── subdir.mk │ ├── diag │ ├── Trace.d │ ├── subdir.mk │ └── trace_impl.d │ ├── newlib │ ├── _cxx.d │ ├── _exit.d │ ├── _sbrk.d │ ├── _startup.d │ ├── _syscalls.d │ ├── assert.d │ └── subdir.mk │ └── stm32f1-stdperiph │ ├── misc.d │ ├── stm32f10x_gpio.d │ ├── stm32f10x_rcc.d │ ├── stm32f10x_usart.d │ └── subdir.mk ├── include └── stm32f10x_conf.h ├── ldscripts ├── libs.ld ├── mem.ld └── sections.ld ├── src └── main.c └── system ├── include ├── arm │ └── semihosting.h ├── cmsis │ ├── README_DEVICE.txt │ ├── arm_common_tables.h │ ├── arm_const_structs.h │ ├── arm_math.h │ ├── cmsis_armcc.h │ ├── cmsis_armcc_V6.h │ ├── cmsis_device.h │ ├── cmsis_gcc.h │ ├── core_cm0.h │ ├── core_cm0plus.h │ ├── core_cm3.h │ ├── core_cm4.h │ ├── core_cm7.h │ ├── core_cmFunc.h │ ├── core_cmInstr.h │ ├── core_cmSimd.h │ ├── core_sc000.h │ ├── core_sc300.h │ ├── stm32f10x.h │ └── system_stm32f10x.h ├── cortexm │ └── ExceptionHandlers.h ├── diag │ └── Trace.h └── stm32f1-stdperiph │ ├── README_STDPERIPH.txt │ ├── misc.h │ ├── stm32f10x_adc.h │ ├── stm32f10x_bkp.h │ ├── stm32f10x_can.h │ ├── stm32f10x_cec.h │ ├── stm32f10x_crc.h │ ├── stm32f10x_dac.h │ ├── stm32f10x_dbgmcu.h │ ├── stm32f10x_dma.h │ ├── stm32f10x_exti.h │ ├── stm32f10x_flash.h │ ├── stm32f10x_fsmc.h │ ├── stm32f10x_gpio.h │ ├── stm32f10x_i2c.h │ ├── stm32f10x_iwdg.h │ ├── stm32f10x_pwr.h │ ├── stm32f10x_rcc.h │ ├── stm32f10x_rtc.h │ ├── stm32f10x_sdio.h │ ├── stm32f10x_spi.h │ ├── stm32f10x_tim.h │ ├── stm32f10x_usart.h │ └── stm32f10x_wwdg.h └── src ├── cmsis ├── README_DEVICE.txt ├── system_stm32f10x.c └── vectors_stm32f10x.c ├── cortexm ├── _initialize_hardware.c ├── _reset_hardware.c └── exception_handlers.c ├── diag ├── Trace.c └── trace_impl.c ├── newlib ├── README.txt ├── _cxx.cpp ├── _exit.c ├── _sbrk.c ├── _startup.c ├── _syscalls.c └── assert.c └── stm32f1-stdperiph ├── README_STDPERIPH.txt ├── misc.c ├── stm32f10x_adc.c ├── stm32f10x_bkp.c ├── stm32f10x_can.c ├── stm32f10x_cec.c ├── stm32f10x_crc.c ├── stm32f10x_dac.c ├── stm32f10x_dbgmcu.c ├── stm32f10x_dma.c ├── stm32f10x_exti.c ├── stm32f10x_flash.c ├── stm32f10x_fsmc.c ├── stm32f10x_gpio.c ├── stm32f10x_i2c.c ├── stm32f10x_iwdg.c ├── stm32f10x_pwr.c ├── stm32f10x_rcc.c ├── stm32f10x_rtc.c ├── stm32f10x_sdio.c ├── stm32f10x_spi.c ├── stm32f10x_tim.c ├── stm32f10x_usart.c └── stm32f10x_wwdg.c /README.md: -------------------------------------------------------------------------------- 1 | ![STM32](stm32-nucleo-bo.jpg) 2 | 3 | Getting Started with STM32 ARM Cortex-M3 using GCC (STM32F103, NUCLEO-F103RB). 4 | 5 | Read more here: 6 | 7 | http://electronut.in/stm32-start/ 8 | 9 | -------------------------------------------------------------------------------- /stm32-nucleo-bo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electronut/stm32-start/81aaaea012df8f3bfed3962b696fdf4114e50ebe/stm32-nucleo-bo.jpg -------------------------------------------------------------------------------- /stm32F103_blinky_serial/.gitignore: -------------------------------------------------------------------------------- 1 | /Release/ 2 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | stm32F103_blinky_serial 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | org.eclipse.cdt.core.ccnature 26 | 27 | 28 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | -include ../makefile.init 6 | 7 | RM := rm -rf 8 | 9 | # All of the sources participating in the build are defined here 10 | -include sources.mk 11 | -include system/src/stm32f1-stdperiph/subdir.mk 12 | -include system/src/newlib/subdir.mk 13 | -include system/src/diag/subdir.mk 14 | -include system/src/cortexm/subdir.mk 15 | -include system/src/cmsis/subdir.mk 16 | -include src/subdir.mk 17 | -include subdir.mk 18 | -include objects.mk 19 | 20 | ifneq ($(MAKECMDGOALS),clean) 21 | ifneq ($(strip $(CC_DEPS)),) 22 | -include $(CC_DEPS) 23 | endif 24 | ifneq ($(strip $(C++_DEPS)),) 25 | -include $(C++_DEPS) 26 | endif 27 | ifneq ($(strip $(C_UPPER_DEPS)),) 28 | -include $(C_UPPER_DEPS) 29 | endif 30 | ifneq ($(strip $(CXX_DEPS)),) 31 | -include $(CXX_DEPS) 32 | endif 33 | ifneq ($(strip $(ASM_DEPS)),) 34 | -include $(ASM_DEPS) 35 | endif 36 | ifneq ($(strip $(S_UPPER_DEPS)),) 37 | -include $(S_UPPER_DEPS) 38 | endif 39 | ifneq ($(strip $(C_DEPS)),) 40 | -include $(C_DEPS) 41 | endif 42 | ifneq ($(strip $(CPP_DEPS)),) 43 | -include $(CPP_DEPS) 44 | endif 45 | endif 46 | 47 | -include ../makefile.defs 48 | 49 | # Add inputs and outputs from these tool invocations to the build variables 50 | SECONDARY_FLASH += \ 51 | stm32F103_blinky_serial.hex \ 52 | 53 | SECONDARY_SIZE += \ 54 | stm32F103_blinky_serial.siz \ 55 | 56 | 57 | # All Target 58 | all: stm32F103_blinky_serial.elf secondary-outputs 59 | 60 | # Tool invocations 61 | stm32F103_blinky_serial.elf: $(OBJS) $(USER_OBJS) 62 | @echo 'Building target: $@' 63 | @echo 'Invoking: Cross ARM C++ Linker' 64 | arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -T mem.ld -T libs.ld -T sections.ld -nostartfiles -Xlinker --gc-sections -L"../ldscripts" -Wl,-Map,"stm32F103_blinky_serial.map" --specs=nano.specs -o "stm32F103_blinky_serial.elf" $(OBJS) $(USER_OBJS) $(LIBS) 65 | @echo 'Finished building target: $@' 66 | @echo ' ' 67 | 68 | stm32F103_blinky_serial.hex: stm32F103_blinky_serial.elf 69 | @echo 'Invoking: Cross ARM GNU Create Flash Image' 70 | arm-none-eabi-objcopy -O ihex "stm32F103_blinky_serial.elf" "stm32F103_blinky_serial.hex" 71 | @echo 'Finished building: $@' 72 | @echo ' ' 73 | 74 | stm32F103_blinky_serial.siz: stm32F103_blinky_serial.elf 75 | @echo 'Invoking: Cross ARM GNU Print Size' 76 | arm-none-eabi-size --format=berkeley "stm32F103_blinky_serial.elf" 77 | @echo 'Finished building: $@' 78 | @echo ' ' 79 | 80 | # Other Targets 81 | clean: 82 | -$(RM) $(CC_DEPS)$(C++_DEPS)$(OBJS)$(C_UPPER_DEPS)$(CXX_DEPS)$(SECONDARY_FLASH)$(SECONDARY_SIZE)$(ASM_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(CPP_DEPS) stm32F103_blinky_serial.elf 83 | -@echo ' ' 84 | 85 | secondary-outputs: $(SECONDARY_FLASH) $(SECONDARY_SIZE) 86 | 87 | .PHONY: all clean dependents 88 | .SECONDARY: 89 | 90 | -include ../makefile.targets 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/objects.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | USER_OBJS := 6 | 7 | LIBS := 8 | 9 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/sources.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | ELF_SRCS := 6 | C_UPPER_SRCS := 7 | CXX_SRCS := 8 | C++_SRCS := 9 | OBJ_SRCS := 10 | CC_SRCS := 11 | ASM_SRCS := 12 | C_SRCS := 13 | CPP_SRCS := 14 | S_UPPER_SRCS := 15 | O_SRCS := 16 | CC_DEPS := 17 | C++_DEPS := 18 | OBJS := 19 | C_UPPER_DEPS := 20 | CXX_DEPS := 21 | SECONDARY_FLASH := 22 | SECONDARY_SIZE := 23 | ASM_DEPS := 24 | S_UPPER_DEPS := 25 | C_DEPS := 26 | CPP_DEPS := 27 | 28 | # Every subdirectory with source files must be described here 29 | SUBDIRS := \ 30 | src \ 31 | system/src/cmsis \ 32 | system/src/cortexm \ 33 | system/src/diag \ 34 | system/src/newlib \ 35 | system/src/stm32f1-stdperiph \ 36 | 37 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/src/main.d: -------------------------------------------------------------------------------- 1 | src/main.o: ../src/main.c ../system/include/diag/Trace.h \ 2 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 3 | ../system/include/cmsis/core_cmInstr.h \ 4 | ../system/include/cmsis/cmsis_gcc.h \ 5 | ../system/include/cmsis/core_cmFunc.h \ 6 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 7 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 8 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 29 | ../system/include/stm32f1-stdperiph/misc.h 30 | 31 | ../system/include/diag/Trace.h: 32 | 33 | ../system/include/cmsis/stm32f10x.h: 34 | 35 | ../system/include/cmsis/core_cm3.h: 36 | 37 | ../system/include/cmsis/core_cmInstr.h: 38 | 39 | ../system/include/cmsis/cmsis_gcc.h: 40 | 41 | ../system/include/cmsis/core_cmFunc.h: 42 | 43 | ../system/include/cmsis/system_stm32f10x.h: 44 | 45 | ../include/stm32f10x_conf.h: 46 | 47 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 48 | 49 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 50 | 51 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 52 | 53 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 54 | 55 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 56 | 57 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 58 | 59 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 60 | 61 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 62 | 63 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 64 | 65 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 66 | 67 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 68 | 69 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 70 | 71 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 72 | 73 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 74 | 75 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 76 | 77 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 78 | 79 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 80 | 81 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 82 | 83 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 84 | 85 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 86 | 87 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 88 | 89 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 90 | 91 | ../system/include/stm32f1-stdperiph/misc.h: 92 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/src/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../src/main.c 8 | 9 | OBJS += \ 10 | ./src/main.o 11 | 12 | C_DEPS += \ 13 | ./src/main.d 14 | 15 | 16 | # Each subdirectory must supply rules for building sources it contributes 17 | src/%.o: ../src/%.c 18 | @echo 'Building file: $<' 19 | @echo 'Invoking: Cross ARM C Compiler' 20 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 21 | @echo 'Finished building: $<' 22 | @echo ' ' 23 | 24 | 25 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/stm32F103_blinky_serial.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/electronut/stm32-start/81aaaea012df8f3bfed3962b696fdf4114e50ebe/stm32F103_blinky_serial/Debug/stm32F103_blinky_serial.elf -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cmsis/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../system/src/cmsis/system_stm32f10x.c \ 8 | ../system/src/cmsis/vectors_stm32f10x.c 9 | 10 | OBJS += \ 11 | ./system/src/cmsis/system_stm32f10x.o \ 12 | ./system/src/cmsis/vectors_stm32f10x.o 13 | 14 | C_DEPS += \ 15 | ./system/src/cmsis/system_stm32f10x.d \ 16 | ./system/src/cmsis/vectors_stm32f10x.d 17 | 18 | 19 | # Each subdirectory must supply rules for building sources it contributes 20 | system/src/cmsis/%.o: ../system/src/cmsis/%.c 21 | @echo 'Building file: $<' 22 | @echo 'Invoking: Cross ARM C Compiler' 23 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 24 | @echo 'Finished building: $<' 25 | @echo ' ' 26 | 27 | 28 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cmsis/system_stm32f10x.d: -------------------------------------------------------------------------------- 1 | system/src/cmsis/system_stm32f10x.o: \ 2 | ../system/src/cmsis/system_stm32f10x.c \ 3 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 4 | ../system/include/cmsis/core_cmInstr.h \ 5 | ../system/include/cmsis/cmsis_gcc.h \ 6 | ../system/include/cmsis/core_cmFunc.h \ 7 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 8 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 30 | ../system/include/stm32f1-stdperiph/misc.h 31 | 32 | ../system/include/cmsis/stm32f10x.h: 33 | 34 | ../system/include/cmsis/core_cm3.h: 35 | 36 | ../system/include/cmsis/core_cmInstr.h: 37 | 38 | ../system/include/cmsis/cmsis_gcc.h: 39 | 40 | ../system/include/cmsis/core_cmFunc.h: 41 | 42 | ../system/include/cmsis/system_stm32f10x.h: 43 | 44 | ../include/stm32f10x_conf.h: 45 | 46 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 47 | 48 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 51 | 52 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 89 | 90 | ../system/include/stm32f1-stdperiph/misc.h: 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cmsis/vectors_stm32f10x.d: -------------------------------------------------------------------------------- 1 | system/src/cmsis/vectors_stm32f10x.o: \ 2 | ../system/src/cmsis/vectors_stm32f10x.c \ 3 | ../system/include/cortexm/ExceptionHandlers.h 4 | 5 | ../system/include/cortexm/ExceptionHandlers.h: 6 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cortexm/_initialize_hardware.d: -------------------------------------------------------------------------------- 1 | system/src/cortexm/_initialize_hardware.o: \ 2 | ../system/src/cortexm/_initialize_hardware.c \ 3 | ../system/include/cmsis/cmsis_device.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/cmsis/stm32f10x.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 30 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 31 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 32 | ../system/include/stm32f1-stdperiph/misc.h 33 | 34 | ../system/include/cmsis/cmsis_device.h: 35 | 36 | ../system/include/cmsis/stm32f10x.h: 37 | 38 | ../system/include/cmsis/core_cm3.h: 39 | 40 | ../system/include/cmsis/core_cmInstr.h: 41 | 42 | ../system/include/cmsis/cmsis_gcc.h: 43 | 44 | ../system/include/cmsis/core_cmFunc.h: 45 | 46 | ../system/include/cmsis/system_stm32f10x.h: 47 | 48 | ../include/stm32f10x_conf.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 51 | 52 | ../system/include/cmsis/stm32f10x.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 89 | 90 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 91 | 92 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 93 | 94 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 95 | 96 | ../system/include/stm32f1-stdperiph/misc.h: 97 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cortexm/_reset_hardware.d: -------------------------------------------------------------------------------- 1 | system/src/cortexm/_reset_hardware.o: \ 2 | ../system/src/cortexm/_reset_hardware.c \ 3 | ../system/include/cmsis/cmsis_device.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/cmsis/stm32f10x.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 30 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 31 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 32 | ../system/include/stm32f1-stdperiph/misc.h 33 | 34 | ../system/include/cmsis/cmsis_device.h: 35 | 36 | ../system/include/cmsis/stm32f10x.h: 37 | 38 | ../system/include/cmsis/core_cm3.h: 39 | 40 | ../system/include/cmsis/core_cmInstr.h: 41 | 42 | ../system/include/cmsis/cmsis_gcc.h: 43 | 44 | ../system/include/cmsis/core_cmFunc.h: 45 | 46 | ../system/include/cmsis/system_stm32f10x.h: 47 | 48 | ../include/stm32f10x_conf.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 51 | 52 | ../system/include/cmsis/stm32f10x.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 89 | 90 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 91 | 92 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 93 | 94 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 95 | 96 | ../system/include/stm32f1-stdperiph/misc.h: 97 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cortexm/exception_handlers.d: -------------------------------------------------------------------------------- 1 | system/src/cortexm/exception_handlers.o: \ 2 | ../system/src/cortexm/exception_handlers.c \ 3 | ../system/include/cortexm/ExceptionHandlers.h \ 4 | ../system/include/cmsis/cmsis_device.h \ 5 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 6 | ../system/include/cmsis/core_cmInstr.h \ 7 | ../system/include/cmsis/cmsis_gcc.h \ 8 | ../system/include/cmsis/core_cmFunc.h \ 9 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 11 | ../system/include/cmsis/stm32f10x.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 30 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 31 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 32 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 33 | ../system/include/stm32f1-stdperiph/misc.h \ 34 | ../system/include/arm/semihosting.h ../system/include/diag/Trace.h 35 | 36 | ../system/include/cortexm/ExceptionHandlers.h: 37 | 38 | ../system/include/cmsis/cmsis_device.h: 39 | 40 | ../system/include/cmsis/stm32f10x.h: 41 | 42 | ../system/include/cmsis/core_cm3.h: 43 | 44 | ../system/include/cmsis/core_cmInstr.h: 45 | 46 | ../system/include/cmsis/cmsis_gcc.h: 47 | 48 | ../system/include/cmsis/core_cmFunc.h: 49 | 50 | ../system/include/cmsis/system_stm32f10x.h: 51 | 52 | ../include/stm32f10x_conf.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 55 | 56 | ../system/include/cmsis/stm32f10x.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 89 | 90 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 91 | 92 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 93 | 94 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 95 | 96 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 97 | 98 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 99 | 100 | ../system/include/stm32f1-stdperiph/misc.h: 101 | 102 | ../system/include/arm/semihosting.h: 103 | 104 | ../system/include/diag/Trace.h: 105 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/cortexm/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../system/src/cortexm/_initialize_hardware.c \ 8 | ../system/src/cortexm/_reset_hardware.c \ 9 | ../system/src/cortexm/exception_handlers.c 10 | 11 | OBJS += \ 12 | ./system/src/cortexm/_initialize_hardware.o \ 13 | ./system/src/cortexm/_reset_hardware.o \ 14 | ./system/src/cortexm/exception_handlers.o 15 | 16 | C_DEPS += \ 17 | ./system/src/cortexm/_initialize_hardware.d \ 18 | ./system/src/cortexm/_reset_hardware.d \ 19 | ./system/src/cortexm/exception_handlers.d 20 | 21 | 22 | # Each subdirectory must supply rules for building sources it contributes 23 | system/src/cortexm/%.o: ../system/src/cortexm/%.c 24 | @echo 'Building file: $<' 25 | @echo 'Invoking: Cross ARM C Compiler' 26 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 27 | @echo 'Finished building: $<' 28 | @echo ' ' 29 | 30 | 31 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/diag/Trace.d: -------------------------------------------------------------------------------- 1 | system/src/diag/Trace.o: ../system/src/diag/Trace.c \ 2 | ../system/include/diag/Trace.h 3 | 4 | ../system/include/diag/Trace.h: 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/diag/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../system/src/diag/Trace.c \ 8 | ../system/src/diag/trace_impl.c 9 | 10 | OBJS += \ 11 | ./system/src/diag/Trace.o \ 12 | ./system/src/diag/trace_impl.o 13 | 14 | C_DEPS += \ 15 | ./system/src/diag/Trace.d \ 16 | ./system/src/diag/trace_impl.d 17 | 18 | 19 | # Each subdirectory must supply rules for building sources it contributes 20 | system/src/diag/%.o: ../system/src/diag/%.c 21 | @echo 'Building file: $<' 22 | @echo 'Invoking: Cross ARM C Compiler' 23 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 24 | @echo 'Finished building: $<' 25 | @echo ' ' 26 | 27 | 28 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/diag/trace_impl.d: -------------------------------------------------------------------------------- 1 | system/src/diag/trace_impl.o: ../system/src/diag/trace_impl.c \ 2 | ../system/include/cmsis/cmsis_device.h \ 3 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 4 | ../system/include/cmsis/core_cmInstr.h \ 5 | ../system/include/cmsis/cmsis_gcc.h \ 6 | ../system/include/cmsis/core_cmFunc.h \ 7 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 8 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 9 | ../system/include/cmsis/stm32f10x.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 30 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 31 | ../system/include/stm32f1-stdperiph/misc.h \ 32 | ../system/include/diag/Trace.h ../system/include/arm/semihosting.h 33 | 34 | ../system/include/cmsis/cmsis_device.h: 35 | 36 | ../system/include/cmsis/stm32f10x.h: 37 | 38 | ../system/include/cmsis/core_cm3.h: 39 | 40 | ../system/include/cmsis/core_cmInstr.h: 41 | 42 | ../system/include/cmsis/cmsis_gcc.h: 43 | 44 | ../system/include/cmsis/core_cmFunc.h: 45 | 46 | ../system/include/cmsis/system_stm32f10x.h: 47 | 48 | ../include/stm32f10x_conf.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 51 | 52 | ../system/include/cmsis/stm32f10x.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 89 | 90 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 91 | 92 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 93 | 94 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 95 | 96 | ../system/include/stm32f1-stdperiph/misc.h: 97 | 98 | ../system/include/diag/Trace.h: 99 | 100 | ../system/include/arm/semihosting.h: 101 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/_cxx.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/_cxx.o: ../system/src/newlib/_cxx.cpp \ 2 | ../system/include/diag/Trace.h 3 | 4 | ../system/include/diag/Trace.h: 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/_exit.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/_exit.o: ../system/src/newlib/_exit.c \ 2 | ../system/include/diag/Trace.h 3 | 4 | ../system/include/diag/Trace.h: 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/_sbrk.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/_sbrk.o: ../system/src/newlib/_sbrk.c 2 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/_startup.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/_startup.o: ../system/src/newlib/_startup.c 2 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/_syscalls.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/_syscalls.o: ../system/src/newlib/_syscalls.c 2 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/assert.d: -------------------------------------------------------------------------------- 1 | system/src/newlib/assert.o: ../system/src/newlib/assert.c \ 2 | ../system/include/diag/Trace.h 3 | 4 | ../system/include/diag/Trace.h: 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/newlib/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../system/src/newlib/_exit.c \ 8 | ../system/src/newlib/_sbrk.c \ 9 | ../system/src/newlib/_startup.c \ 10 | ../system/src/newlib/_syscalls.c \ 11 | ../system/src/newlib/assert.c 12 | 13 | CPP_SRCS += \ 14 | ../system/src/newlib/_cxx.cpp 15 | 16 | OBJS += \ 17 | ./system/src/newlib/_cxx.o \ 18 | ./system/src/newlib/_exit.o \ 19 | ./system/src/newlib/_sbrk.o \ 20 | ./system/src/newlib/_startup.o \ 21 | ./system/src/newlib/_syscalls.o \ 22 | ./system/src/newlib/assert.o 23 | 24 | C_DEPS += \ 25 | ./system/src/newlib/_exit.d \ 26 | ./system/src/newlib/_sbrk.d \ 27 | ./system/src/newlib/_startup.d \ 28 | ./system/src/newlib/_syscalls.d \ 29 | ./system/src/newlib/assert.d 30 | 31 | CPP_DEPS += \ 32 | ./system/src/newlib/_cxx.d 33 | 34 | 35 | # Each subdirectory must supply rules for building sources it contributes 36 | system/src/newlib/%.o: ../system/src/newlib/%.cpp 37 | @echo 'Building file: $<' 38 | @echo 'Invoking: Cross ARM C++ Compiler' 39 | arm-none-eabi-g++ -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 40 | @echo 'Finished building: $<' 41 | @echo ' ' 42 | 43 | system/src/newlib/%.o: ../system/src/newlib/%.c 44 | @echo 'Building file: $<' 45 | @echo 'Invoking: Cross ARM C Compiler' 46 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 47 | @echo 'Finished building: $<' 48 | @echo ' ' 49 | 50 | 51 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/stm32f1-stdperiph/misc.d: -------------------------------------------------------------------------------- 1 | system/src/stm32f1-stdperiph/misc.o: \ 2 | ../system/src/stm32f1-stdperiph/misc.c \ 3 | ../system/include/stm32f1-stdperiph/misc.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 30 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h 31 | 32 | ../system/include/stm32f1-stdperiph/misc.h: 33 | 34 | ../system/include/cmsis/stm32f10x.h: 35 | 36 | ../system/include/cmsis/core_cm3.h: 37 | 38 | ../system/include/cmsis/core_cmInstr.h: 39 | 40 | ../system/include/cmsis/cmsis_gcc.h: 41 | 42 | ../system/include/cmsis/core_cmFunc.h: 43 | 44 | ../system/include/cmsis/system_stm32f10x.h: 45 | 46 | ../include/stm32f10x_conf.h: 47 | 48 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 51 | 52 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 89 | 90 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/stm32f1-stdperiph/stm32f10x_gpio.d: -------------------------------------------------------------------------------- 1 | system/src/stm32f1-stdperiph/stm32f10x_gpio.o: \ 2 | ../system/src/stm32f1-stdperiph/stm32f10x_gpio.c \ 3 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 30 | ../system/include/stm32f1-stdperiph/misc.h 31 | 32 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 33 | 34 | ../system/include/cmsis/stm32f10x.h: 35 | 36 | ../system/include/cmsis/core_cm3.h: 37 | 38 | ../system/include/cmsis/core_cmInstr.h: 39 | 40 | ../system/include/cmsis/cmsis_gcc.h: 41 | 42 | ../system/include/cmsis/core_cmFunc.h: 43 | 44 | ../system/include/cmsis/system_stm32f10x.h: 45 | 46 | ../include/stm32f10x_conf.h: 47 | 48 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 51 | 52 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 89 | 90 | ../system/include/stm32f1-stdperiph/misc.h: 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/stm32f1-stdperiph/stm32f10x_rcc.d: -------------------------------------------------------------------------------- 1 | system/src/stm32f1-stdperiph/stm32f10x_rcc.o: \ 2 | ../system/src/stm32f1-stdperiph/stm32f10x_rcc.c \ 3 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 30 | ../system/include/stm32f1-stdperiph/misc.h 31 | 32 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 33 | 34 | ../system/include/cmsis/stm32f10x.h: 35 | 36 | ../system/include/cmsis/core_cm3.h: 37 | 38 | ../system/include/cmsis/core_cmInstr.h: 39 | 40 | ../system/include/cmsis/cmsis_gcc.h: 41 | 42 | ../system/include/cmsis/core_cmFunc.h: 43 | 44 | ../system/include/cmsis/system_stm32f10x.h: 45 | 46 | ../include/stm32f10x_conf.h: 47 | 48 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 51 | 52 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 89 | 90 | ../system/include/stm32f1-stdperiph/misc.h: 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/stm32f1-stdperiph/stm32f10x_usart.d: -------------------------------------------------------------------------------- 1 | system/src/stm32f1-stdperiph/stm32f10x_usart.o: \ 2 | ../system/src/stm32f1-stdperiph/stm32f10x_usart.c \ 3 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h \ 4 | ../system/include/cmsis/stm32f10x.h ../system/include/cmsis/core_cm3.h \ 5 | ../system/include/cmsis/core_cmInstr.h \ 6 | ../system/include/cmsis/cmsis_gcc.h \ 7 | ../system/include/cmsis/core_cmFunc.h \ 8 | ../system/include/cmsis/system_stm32f10x.h ../include/stm32f10x_conf.h \ 9 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h \ 10 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h \ 11 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h \ 12 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h \ 13 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h \ 14 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h \ 15 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h \ 16 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h \ 17 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h \ 18 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h \ 19 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h \ 20 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h \ 21 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h \ 22 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h \ 23 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h \ 24 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h \ 25 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h \ 26 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h \ 27 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h \ 28 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h \ 29 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h \ 30 | ../system/include/stm32f1-stdperiph/misc.h 31 | 32 | ../system/include/stm32f1-stdperiph/stm32f10x_usart.h: 33 | 34 | ../system/include/cmsis/stm32f10x.h: 35 | 36 | ../system/include/cmsis/core_cm3.h: 37 | 38 | ../system/include/cmsis/core_cmInstr.h: 39 | 40 | ../system/include/cmsis/cmsis_gcc.h: 41 | 42 | ../system/include/cmsis/core_cmFunc.h: 43 | 44 | ../system/include/cmsis/system_stm32f10x.h: 45 | 46 | ../include/stm32f10x_conf.h: 47 | 48 | ../system/include/stm32f1-stdperiph/stm32f10x_adc.h: 49 | 50 | ../system/include/stm32f1-stdperiph/stm32f10x_bkp.h: 51 | 52 | ../system/include/stm32f1-stdperiph/stm32f10x_can.h: 53 | 54 | ../system/include/stm32f1-stdperiph/stm32f10x_cec.h: 55 | 56 | ../system/include/stm32f1-stdperiph/stm32f10x_crc.h: 57 | 58 | ../system/include/stm32f1-stdperiph/stm32f10x_dac.h: 59 | 60 | ../system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: 61 | 62 | ../system/include/stm32f1-stdperiph/stm32f10x_dma.h: 63 | 64 | ../system/include/stm32f1-stdperiph/stm32f10x_exti.h: 65 | 66 | ../system/include/stm32f1-stdperiph/stm32f10x_flash.h: 67 | 68 | ../system/include/stm32f1-stdperiph/stm32f10x_fsmc.h: 69 | 70 | ../system/include/stm32f1-stdperiph/stm32f10x_gpio.h: 71 | 72 | ../system/include/stm32f1-stdperiph/stm32f10x_i2c.h: 73 | 74 | ../system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: 75 | 76 | ../system/include/stm32f1-stdperiph/stm32f10x_pwr.h: 77 | 78 | ../system/include/stm32f1-stdperiph/stm32f10x_rcc.h: 79 | 80 | ../system/include/stm32f1-stdperiph/stm32f10x_rtc.h: 81 | 82 | ../system/include/stm32f1-stdperiph/stm32f10x_sdio.h: 83 | 84 | ../system/include/stm32f1-stdperiph/stm32f10x_spi.h: 85 | 86 | ../system/include/stm32f1-stdperiph/stm32f10x_tim.h: 87 | 88 | ../system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: 89 | 90 | ../system/include/stm32f1-stdperiph/misc.h: 91 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/Debug/system/src/stm32f1-stdperiph/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../system/src/stm32f1-stdperiph/misc.c \ 8 | ../system/src/stm32f1-stdperiph/stm32f10x_gpio.c \ 9 | ../system/src/stm32f1-stdperiph/stm32f10x_rcc.c \ 10 | ../system/src/stm32f1-stdperiph/stm32f10x_usart.c 11 | 12 | OBJS += \ 13 | ./system/src/stm32f1-stdperiph/misc.o \ 14 | ./system/src/stm32f1-stdperiph/stm32f10x_gpio.o \ 15 | ./system/src/stm32f1-stdperiph/stm32f10x_rcc.o \ 16 | ./system/src/stm32f1-stdperiph/stm32f10x_usart.o 17 | 18 | C_DEPS += \ 19 | ./system/src/stm32f1-stdperiph/misc.d \ 20 | ./system/src/stm32f1-stdperiph/stm32f10x_gpio.d \ 21 | ./system/src/stm32f1-stdperiph/stm32f10x_rcc.d \ 22 | ./system/src/stm32f1-stdperiph/stm32f10x_usart.d 23 | 24 | 25 | # Each subdirectory must supply rules for building sources it contributes 26 | system/src/stm32f1-stdperiph/%.o: ../system/src/stm32f1-stdperiph/%.c 27 | @echo 'Building file: $<' 28 | @echo 'Invoking: Cross ARM C Compiler' 29 | arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F10X_MD -DUSE_STDPERIPH_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f1-stdperiph" -std=gnu11 -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@)" -c -o "$@" "$<" 30 | @echo 'Finished building: $<' 31 | @echo ' ' 32 | 33 | 34 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/include/stm32f10x_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/STM32F10x_StdPeriph_Template/stm32f10x_conf.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 08-April-2011 7 | * @brief Library configuration file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F10x_CONF_H 24 | #define __STM32F10x_CONF_H 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | /* Uncomment/Comment the line below to enable/disable peripheral header file inclusion */ 28 | #include "stm32f10x_adc.h" 29 | #include "stm32f10x_bkp.h" 30 | #include "stm32f10x_can.h" 31 | #include "stm32f10x_cec.h" 32 | #include "stm32f10x_crc.h" 33 | #include "stm32f10x_dac.h" 34 | #include "stm32f10x_dbgmcu.h" 35 | #include "stm32f10x_dma.h" 36 | #include "stm32f10x_exti.h" 37 | #include "stm32f10x_flash.h" 38 | #include "stm32f10x_fsmc.h" 39 | #include "stm32f10x_gpio.h" 40 | #include "stm32f10x_i2c.h" 41 | #include "stm32f10x_iwdg.h" 42 | #include "stm32f10x_pwr.h" 43 | #include "stm32f10x_rcc.h" 44 | #include "stm32f10x_rtc.h" 45 | #include "stm32f10x_sdio.h" 46 | #include "stm32f10x_spi.h" 47 | #include "stm32f10x_tim.h" 48 | #include "stm32f10x_usart.h" 49 | #include "stm32f10x_wwdg.h" 50 | #include "misc.h" /* High level functions for NVIC and SysTick (add-on to CMSIS functions) */ 51 | 52 | /* Exported types ------------------------------------------------------------*/ 53 | /* Exported constants --------------------------------------------------------*/ 54 | /* Uncomment the line below to expanse the "assert_param" macro in the 55 | Standard Peripheral Library drivers code */ 56 | /* #define USE_FULL_ASSERT 1 */ 57 | 58 | /* Exported macro ------------------------------------------------------------*/ 59 | #ifdef USE_FULL_ASSERT 60 | 61 | /** 62 | * @brief The assert_param macro is used for function's parameters check. 63 | * @param expr: If expr is false, it calls assert_failed function which reports 64 | * the name of the source file and the source line number of the call 65 | * that failed. If expr is true, it returns no value. 66 | * @retval None 67 | */ 68 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 69 | /* Exported functions ------------------------------------------------------- */ 70 | void assert_failed(uint8_t* file, uint32_t line); 71 | #else 72 | #define assert_param(expr) ((void)0) 73 | #endif /* USE_FULL_ASSERT */ 74 | 75 | //#define VECT_TAB_SRAM 76 | 77 | #endif /* __STM32F10x_CONF_H */ 78 | 79 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 80 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/ldscripts/libs.ld: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * Placeholder to list other libraries required by the application. 4 | 5 | GROUP( 6 | ) 7 | 8 | */ 9 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/ldscripts/mem.ld: -------------------------------------------------------------------------------- 1 | /* 2 | * Memory Spaces Definitions. 3 | * 4 | * Need modifying for a specific board. 5 | * FLASH.ORIGIN: starting address of flash 6 | * FLASH.LENGTH: length of flash 7 | * RAM.ORIGIN: starting address of RAM bank 0 8 | * RAM.LENGTH: length of RAM bank 0 9 | * 10 | * The values below can be addressed in further linker scripts 11 | * using functions like 'ORIGIN(RAM)' or 'LENGTH(RAM)'. 12 | */ 13 | 14 | MEMORY 15 | { 16 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 20K 17 | CCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 0 18 | FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 128K 19 | FLASHB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 20 | EXTMEMB0 (rx) : ORIGIN = 0x00000000, LENGTH = 0 21 | EXTMEMB1 (rx) : ORIGIN = 0x00000000, LENGTH = 0 22 | EXTMEMB2 (rx) : ORIGIN = 0x00000000, LENGTH = 0 23 | EXTMEMB3 (rx) : ORIGIN = 0x00000000, LENGTH = 0 24 | MEMORY_ARRAY (xrw) : ORIGIN = 0x00000000, LENGTH = 0 25 | } 26 | 27 | /* 28 | * For external ram use something like: 29 | 30 | RAM (xrw) : ORIGIN = 0x68000000, LENGTH = 20K 31 | 32 | */ 33 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/src/main.c: -------------------------------------------------------------------------------- 1 | // Getting started with STM32F103 2 | // blinky + serial 3 | // electronut.in 4 | 5 | 6 | #include 7 | #include 8 | #include "diag/Trace.h" 9 | 10 | #include "stm32f10x.h" 11 | #include "stm32f10x_rcc.h" 12 | #include "stm32f10x_gpio.h" 13 | #include "stm32f10x_usart.h" 14 | 15 | 16 | // Sample pragmas to cope with warnings. Please note the related line at 17 | // the end of this function, used to pop the compiler diagnostics status. 18 | #pragma GCC diagnostic push 19 | #pragma GCC diagnostic ignored "-Wunused-parameter" 20 | #pragma GCC diagnostic ignored "-Wmissing-declarations" 21 | #pragma GCC diagnostic ignored "-Wreturn-type" 22 | 23 | static volatile uint32_t sysTickCount = 0; 24 | 25 | void myDelay(uint32_t nTime) 26 | { 27 | sysTickCount = nTime; 28 | while(sysTickCount != 0); 29 | } 30 | 31 | void SysTick_Handler() 32 | { 33 | if (sysTickCount != 0) { 34 | sysTickCount--; 35 | } 36 | } 37 | 38 | int uart_putc(USART_TypeDef* USARTx, char c) 39 | { 40 | assert_param(IS_USART_123_PERIPH(USARTx)); 41 | 42 | while (USART_GetFlagStatus(USARTx, USART_FLAG_TXE) == RESET); 43 | USARTx->DR = (c & 0xff); 44 | return 0; 45 | } 46 | 47 | int uart_getc (USART_TypeDef* USARTx) 48 | { 49 | assert_param(IS_USART_123_PERIPH(USARTx)); 50 | 51 | while (USART_GetFlagStatus(USARTx, USART_FLAG_RXNE) == RESET); 52 | return USARTx->DR & 0xff; 53 | } 54 | 55 | int main(int argc, char* argv[]) 56 | { 57 | // print trace info - goes to Eclipse console 58 | trace_puts("Hello ARM World!"); 59 | trace_printf("System clock: %u Hz\n", SystemCoreClock); 60 | 61 | // LED is on PA5 62 | 63 | // enable clock for peripheral GPIOA and GPIOC 64 | RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_GPIOC, ENABLE); 65 | 66 | // initialize GPIO structure 67 | GPIO_InitTypeDef gpioInitStruct; 68 | GPIO_StructInit(&gpioInitStruct); 69 | gpioInitStruct.GPIO_Pin = GPIO_Pin_5; 70 | gpioInitStruct.GPIO_Mode = GPIO_Mode_Out_PP; 71 | gpioInitStruct.GPIO_Speed = GPIO_Speed_2MHz; 72 | GPIO_Init(GPIOA, &gpioInitStruct); 73 | 74 | // set PC13 (User button 1) as input 75 | gpioInitStruct.GPIO_Pin = GPIO_Pin_13; 76 | gpioInitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING; 77 | GPIO_Init(GPIOC, &gpioInitStruct); 78 | 79 | 80 | // serial comms 81 | // use PA2 (TX) and PA3 (RX) 82 | // USART2 83 | // These are connected to the ST-Link circuit on the Nucleo board 84 | // so the serial output will be via USB, on your computer 85 | 86 | // enable clock for USART2 87 | RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART2, ENABLE); 88 | 89 | // setup Tx/RX pins: 90 | 91 | // init TX 92 | gpioInitStruct.GPIO_Pin = GPIO_Pin_2; 93 | gpioInitStruct.GPIO_Mode = GPIO_Mode_AF_PP; 94 | gpioInitStruct.GPIO_Speed = GPIO_Speed_50MHz; 95 | GPIO_Init(GPIOA, &gpioInitStruct); 96 | // init RX 97 | gpioInitStruct.GPIO_Pin = GPIO_Pin_3; 98 | gpioInitStruct.GPIO_Mode = GPIO_Mode_IN_FLOATING; 99 | GPIO_Init(GPIOA, &gpioInitStruct); 100 | 101 | // setup USART2: 102 | 103 | // initialize struct 104 | USART_InitTypeDef usartInitStruct; 105 | USART_StructInit(&usartInitStruct); 106 | // set parameters 107 | usartInitStruct.USART_BaudRate = 9600; 108 | usartInitStruct.USART_Mode = USART_Mode_Rx | USART_Mode_Tx; 109 | USART_Init(USART2, &usartInitStruct); 110 | USART_Cmd(USART2, ENABLE); 111 | 112 | // set up a timer 113 | SysTick_Config(SystemCoreClock/1000); 114 | 115 | // Infinite loop 116 | volatile uint8_t val = 0; 117 | uart_putc(USART2, '.'); 118 | uart_putc(USART2, '\n'); 119 | while (1) 120 | { 121 | // read PC13 input 122 | uint8_t input = GPIO_ReadInputDataBit(GPIOC, GPIO_Pin_13); 123 | if (!input) { 124 | trace_printf("button pressed!\n"); 125 | val = 1; 126 | } 127 | 128 | // if flag set go into serial input mode 129 | if (val) { 130 | // show prompt 131 | uart_putc(USART2, '>'); 132 | // get input 133 | char c = uart_getc(USART2); 134 | uart_putc(USART2, '\n'); 135 | uart_putc(USART2, '.'); 136 | uart_putc(USART2, '\n'); 137 | // set LED 138 | int led = (c == '0') ? 0 : 1; 139 | GPIO_WriteBit(GPIOA, GPIO_Pin_5, led); 140 | // reset input mode flag 141 | val = 0; 142 | } 143 | 144 | // wait 145 | myDelay(500); 146 | } 147 | } 148 | 149 | // pop the compiler diagnostics status 150 | #pragma GCC diagnostic pop 151 | 152 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/arm/semihosting.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | #ifndef ARM_SEMIHOSTING_H_ 7 | #define ARM_SEMIHOSTING_H_ 8 | 9 | // ---------------------------------------------------------------------------- 10 | 11 | // Semihosting operations. 12 | enum OperationNumber 13 | { 14 | // Regular operations 15 | SEMIHOSTING_EnterSVC = 0x17, 16 | SEMIHOSTING_ReportException = 0x18, 17 | SEMIHOSTING_SYS_CLOSE = 0x02, 18 | SEMIHOSTING_SYS_CLOCK = 0x10, 19 | SEMIHOSTING_SYS_ELAPSED = 0x30, 20 | SEMIHOSTING_SYS_ERRNO = 0x13, 21 | SEMIHOSTING_SYS_FLEN = 0x0C, 22 | SEMIHOSTING_SYS_GET_CMDLINE = 0x15, 23 | SEMIHOSTING_SYS_HEAPINFO = 0x16, 24 | SEMIHOSTING_SYS_ISERROR = 0x08, 25 | SEMIHOSTING_SYS_ISTTY = 0x09, 26 | SEMIHOSTING_SYS_OPEN = 0x01, 27 | SEMIHOSTING_SYS_READ = 0x06, 28 | SEMIHOSTING_SYS_READC = 0x07, 29 | SEMIHOSTING_SYS_REMOVE = 0x0E, 30 | SEMIHOSTING_SYS_RENAME = 0x0F, 31 | SEMIHOSTING_SYS_SEEK = 0x0A, 32 | SEMIHOSTING_SYS_SYSTEM = 0x12, 33 | SEMIHOSTING_SYS_TICKFREQ = 0x31, 34 | SEMIHOSTING_SYS_TIME = 0x11, 35 | SEMIHOSTING_SYS_TMPNAM = 0x0D, 36 | SEMIHOSTING_SYS_WRITE = 0x05, 37 | SEMIHOSTING_SYS_WRITEC = 0x03, 38 | SEMIHOSTING_SYS_WRITE0 = 0x04, 39 | 40 | // Codes returned by SEMIHOSTING_ReportException 41 | ADP_Stopped_ApplicationExit = ((2 << 16) + 38), 42 | ADP_Stopped_RunTimeError = ((2 << 16) + 35), 43 | 44 | }; 45 | 46 | // ---------------------------------------------------------------------------- 47 | 48 | // SWI numbers and reason codes for RDI (Angel) monitors. 49 | #define AngelSWI_ARM 0x123456 50 | #ifdef __thumb__ 51 | #define AngelSWI 0xAB 52 | #else 53 | #define AngelSWI AngelSWI_ARM 54 | #endif 55 | // For thumb only architectures use the BKPT instruction instead of SWI. 56 | #if defined(__ARM_ARCH_7M__) \ 57 | || defined(__ARM_ARCH_7EM__) \ 58 | || defined(__ARM_ARCH_6M__) 59 | #define AngelSWIInsn "bkpt" 60 | #define AngelSWIAsm bkpt 61 | #else 62 | #define AngelSWIInsn "swi" 63 | #define AngelSWIAsm swi 64 | #endif 65 | 66 | #if defined(OS_DEBUG_SEMIHOSTING_FAULTS) 67 | // Testing the local semihosting handler cannot use another BKPT, since this 68 | // configuration cannot trigger HaedFault exceptions while the debugger is 69 | // connected, so we use an illegal op code, that will trigger an 70 | // UsageFault exception. 71 | #define AngelSWITestFault "setend be" 72 | #define AngelSWITestFaultOpCode (0xB658) 73 | #endif 74 | 75 | static inline int 76 | __attribute__ ((always_inline)) 77 | call_host (int reason, void* arg) 78 | { 79 | int value; 80 | asm volatile ( 81 | 82 | " mov r0, %[rsn] \n" 83 | " mov r1, %[arg] \n" 84 | #if defined(OS_DEBUG_SEMIHOSTING_FAULTS) 85 | " " AngelSWITestFault " \n" 86 | #else 87 | " " AngelSWIInsn " %[swi] \n" 88 | #endif 89 | " mov %[val], r0" 90 | 91 | : [val] "=r" (value) /* Outputs */ 92 | : [rsn] "r" (reason), [arg] "r" (arg), [swi] "i" (AngelSWI) /* Inputs */ 93 | : "r0", "r1", "r2", "r3", "ip", "lr", "memory", "cc" 94 | // Clobbers r0 and r1, and lr if in supervisor mode 95 | ); 96 | 97 | // Accordingly to page 13-77 of ARM DUI 0040D other registers 98 | // can also be clobbered. Some memory positions may also be 99 | // changed by a system call, so they should not be kept in 100 | // registers. Note: we are assuming the manual is right and 101 | // Angel is respecting the APCS. 102 | return value; 103 | } 104 | 105 | // ---------------------------------------------------------------------------- 106 | 107 | // Function used in _exit() to return the status code as Angel exception. 108 | static inline void 109 | __attribute__ ((always_inline,noreturn)) 110 | report_exception (int reason) 111 | { 112 | call_host (SEMIHOSTING_ReportException, (void*) reason); 113 | 114 | for (;;) 115 | ; 116 | } 117 | 118 | // ---------------------------------------------------------------------------- 119 | 120 | #endif // ARM_SEMIHOSTING_H_ 121 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/README_DEVICE.txt: -------------------------------------------------------------------------------- 1 | The stm32f10x.h and system_stm32f10x.h files are from stsw-stm32054.zip, 2 | the folder: 3 | 4 | STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x 5 | 6 | The cmsis_device.h is added for convenience. 7 | 8 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. October 2015 5 | * $Revision: V.1.4.5 a 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #ifndef _ARM_COMMON_TABLES_H 42 | #define _ARM_COMMON_TABLES_H 43 | 44 | #include "arm_math.h" 45 | 46 | extern const uint16_t armBitRevTable[1024]; 47 | extern const q15_t armRecipTableQ15[64]; 48 | extern const q31_t armRecipTableQ31[64]; 49 | /* extern const q31_t realCoefAQ31[1024]; */ 50 | /* extern const q31_t realCoefBQ31[1024]; */ 51 | extern const float32_t twiddleCoef_16[32]; 52 | extern const float32_t twiddleCoef_32[64]; 53 | extern const float32_t twiddleCoef_64[128]; 54 | extern const float32_t twiddleCoef_128[256]; 55 | extern const float32_t twiddleCoef_256[512]; 56 | extern const float32_t twiddleCoef_512[1024]; 57 | extern const float32_t twiddleCoef_1024[2048]; 58 | extern const float32_t twiddleCoef_2048[4096]; 59 | extern const float32_t twiddleCoef_4096[8192]; 60 | #define twiddleCoef twiddleCoef_4096 61 | extern const q31_t twiddleCoef_16_q31[24]; 62 | extern const q31_t twiddleCoef_32_q31[48]; 63 | extern const q31_t twiddleCoef_64_q31[96]; 64 | extern const q31_t twiddleCoef_128_q31[192]; 65 | extern const q31_t twiddleCoef_256_q31[384]; 66 | extern const q31_t twiddleCoef_512_q31[768]; 67 | extern const q31_t twiddleCoef_1024_q31[1536]; 68 | extern const q31_t twiddleCoef_2048_q31[3072]; 69 | extern const q31_t twiddleCoef_4096_q31[6144]; 70 | extern const q15_t twiddleCoef_16_q15[24]; 71 | extern const q15_t twiddleCoef_32_q15[48]; 72 | extern const q15_t twiddleCoef_64_q15[96]; 73 | extern const q15_t twiddleCoef_128_q15[192]; 74 | extern const q15_t twiddleCoef_256_q15[384]; 75 | extern const q15_t twiddleCoef_512_q15[768]; 76 | extern const q15_t twiddleCoef_1024_q15[1536]; 77 | extern const q15_t twiddleCoef_2048_q15[3072]; 78 | extern const q15_t twiddleCoef_4096_q15[6144]; 79 | extern const float32_t twiddleCoef_rfft_32[32]; 80 | extern const float32_t twiddleCoef_rfft_64[64]; 81 | extern const float32_t twiddleCoef_rfft_128[128]; 82 | extern const float32_t twiddleCoef_rfft_256[256]; 83 | extern const float32_t twiddleCoef_rfft_512[512]; 84 | extern const float32_t twiddleCoef_rfft_1024[1024]; 85 | extern const float32_t twiddleCoef_rfft_2048[2048]; 86 | extern const float32_t twiddleCoef_rfft_4096[4096]; 87 | 88 | 89 | /* floating-point bit reversal tables */ 90 | #define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 ) 91 | #define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 ) 92 | #define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 ) 93 | #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 ) 94 | #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 ) 95 | #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 ) 96 | #define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800) 97 | #define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808) 98 | #define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032) 99 | 100 | extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH]; 101 | extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH]; 102 | extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH]; 103 | extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH]; 104 | extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH]; 105 | extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH]; 106 | extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH]; 107 | extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH]; 108 | extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH]; 109 | 110 | /* fixed-point bit reversal tables */ 111 | #define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 ) 112 | #define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 ) 113 | #define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 ) 114 | #define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 ) 115 | #define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 ) 116 | #define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 ) 117 | #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 ) 118 | #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984) 119 | #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032) 120 | 121 | extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH]; 122 | extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH]; 123 | extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH]; 124 | extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH]; 125 | extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH]; 126 | extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH]; 127 | extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH]; 128 | extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH]; 129 | extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH]; 130 | 131 | /* Tables for Fast Math Sine and Cosine */ 132 | extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1]; 133 | extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1]; 134 | extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1]; 135 | 136 | #endif /* ARM_COMMON_TABLES_H */ 137 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/arm_const_structs.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_const_structs.h 9 | * 10 | * Description: This file has constant structs that are initialized for 11 | * user convenience. For example, some can be given as 12 | * arguments to the arm_cfft_f32() function. 13 | * 14 | * Target Processor: Cortex-M4/Cortex-M3 15 | * 16 | * Redistribution and use in source and binary forms, with or without 17 | * modification, are permitted provided that the following conditions 18 | * are met: 19 | * - Redistributions of source code must retain the above copyright 20 | * notice, this list of conditions and the following disclaimer. 21 | * - Redistributions in binary form must reproduce the above copyright 22 | * notice, this list of conditions and the following disclaimer in 23 | * the documentation and/or other materials provided with the 24 | * distribution. 25 | * - Neither the name of ARM LIMITED nor the names of its contributors 26 | * may be used to endorse or promote products derived from this 27 | * software without specific prior written permission. 28 | * 29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 40 | * POSSIBILITY OF SUCH DAMAGE. 41 | * -------------------------------------------------------------------- */ 42 | 43 | #ifndef _ARM_CONST_STRUCTS_H 44 | #define _ARM_CONST_STRUCTS_H 45 | 46 | #include "arm_math.h" 47 | #include "arm_common_tables.h" 48 | 49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16; 50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32; 51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64; 52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128; 53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256; 54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512; 55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024; 56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048; 57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096; 58 | 59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16; 60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32; 61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64; 62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128; 63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256; 64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512; 65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024; 66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048; 67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096; 68 | 69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16; 70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32; 71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64; 72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128; 73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256; 74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512; 75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024; 76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048; 77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096; 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/cmsis_device.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | #ifndef STM32F1_CMSIS_DEVICE_H_ 7 | #define STM32F1_CMSIS_DEVICE_H_ 8 | 9 | #include "stm32f10x.h" 10 | 11 | #endif // STM32F1_CMSIS_DEVICE_H_ 12 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/core_cmFunc.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmFunc.h 3 | * @brief CMSIS Cortex-M Core Function Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMFUNC_H 42 | #define __CORE_CMFUNC_H 43 | 44 | 45 | /* ########################### Core Function Access ########################### */ 46 | /** \ingroup CMSIS_Core_FunctionInterface 47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@} end of CMSIS_Core_RegAccFunctions */ 86 | 87 | #endif /* __CORE_CMFUNC_H */ 88 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/core_cmInstr.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmInstr.h 3 | * @brief CMSIS Cortex-M Core Instruction Access Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMINSTR_H 42 | #define __CORE_CMINSTR_H 43 | 44 | 45 | /* ########################## Core Instruction Access ######################### */ 46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface 47 | Access to dedicated instructions 48 | @{ 49 | */ 50 | 51 | /*------------------ RealView Compiler -----------------*/ 52 | #if defined ( __CC_ARM ) 53 | #include "cmsis_armcc.h" 54 | 55 | /*------------------ ARM Compiler V6 -------------------*/ 56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 57 | #include "cmsis_armcc_V6.h" 58 | 59 | /*------------------ GNU Compiler ----------------------*/ 60 | #elif defined ( __GNUC__ ) 61 | #include "cmsis_gcc.h" 62 | 63 | /*------------------ ICC Compiler ----------------------*/ 64 | #elif defined ( __ICCARM__ ) 65 | #include 66 | 67 | /*------------------ TI CCS Compiler -------------------*/ 68 | #elif defined ( __TMS470__ ) 69 | #include 70 | 71 | /*------------------ TASKING Compiler ------------------*/ 72 | #elif defined ( __TASKING__ ) 73 | /* 74 | * The CMSIS functions have been implemented as intrinsics in the compiler. 75 | * Please use "carm -?i" to get an up to date list of all intrinsics, 76 | * Including the CMSIS ones. 77 | */ 78 | 79 | /*------------------ COSMIC Compiler -------------------*/ 80 | #elif defined ( __CSMC__ ) 81 | #include 82 | 83 | #endif 84 | 85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */ 86 | 87 | #endif /* __CORE_CMINSTR_H */ 88 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/core_cmSimd.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file core_cmSimd.h 3 | * @brief CMSIS Cortex-M SIMD Header File 4 | * @version V4.30 5 | * @date 20. October 2015 6 | ******************************************************************************/ 7 | /* Copyright (c) 2009 - 2015 ARM LIMITED 8 | 9 | All rights reserved. 10 | Redistribution and use in source and binary forms, with or without 11 | modification, are permitted provided that the following conditions are met: 12 | - Redistributions of source code must retain the above copyright 13 | notice, this list of conditions and the following disclaimer. 14 | - Redistributions in binary form must reproduce the above copyright 15 | notice, this list of conditions and the following disclaimer in the 16 | documentation and/or other materials provided with the distribution. 17 | - Neither the name of ARM nor the names of its contributors may be used 18 | to endorse or promote products derived from this software without 19 | specific prior written permission. 20 | * 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. 32 | ---------------------------------------------------------------------------*/ 33 | 34 | 35 | #if defined ( __ICCARM__ ) 36 | #pragma system_include /* treat file as system include file for MISRA check */ 37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 38 | #pragma clang system_header /* treat file as system include file */ 39 | #endif 40 | 41 | #ifndef __CORE_CMSIMD_H 42 | #define __CORE_CMSIMD_H 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | 49 | /* ################### Compiler specific Intrinsics ########################### */ 50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics 51 | Access to dedicated SIMD instructions 52 | @{ 53 | */ 54 | 55 | /*------------------ RealView Compiler -----------------*/ 56 | #if defined ( __CC_ARM ) 57 | #include "cmsis_armcc.h" 58 | 59 | /*------------------ ARM Compiler V6 -------------------*/ 60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) 61 | #include "cmsis_armcc_V6.h" 62 | 63 | /*------------------ GNU Compiler ----------------------*/ 64 | #elif defined ( __GNUC__ ) 65 | #include "cmsis_gcc.h" 66 | 67 | /*------------------ ICC Compiler ----------------------*/ 68 | #elif defined ( __ICCARM__ ) 69 | #include 70 | 71 | /*------------------ TI CCS Compiler -------------------*/ 72 | #elif defined ( __TMS470__ ) 73 | #include 74 | 75 | /*------------------ TASKING Compiler ------------------*/ 76 | #elif defined ( __TASKING__ ) 77 | /* 78 | * The CMSIS functions have been implemented as intrinsics in the compiler. 79 | * Please use "carm -?i" to get an up to date list of all intrinsics, 80 | * Including the CMSIS ones. 81 | */ 82 | 83 | /*------------------ COSMIC Compiler -------------------*/ 84 | #elif defined ( __CSMC__ ) 85 | #include 86 | 87 | #endif 88 | 89 | /*@} end of group CMSIS_SIMD_intrinsics */ 90 | 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __CORE_CMSIMD_H */ 97 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cmsis/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/cortexm/ExceptionHandlers.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | #ifndef CORTEXM_EXCEPTION_HANDLERS_H_ 7 | #define CORTEXM_EXCEPTION_HANDLERS_H_ 8 | 9 | #include 10 | 11 | #if defined(DEBUG) 12 | #define __DEBUG_BKPT() asm volatile ("bkpt 0") 13 | #endif 14 | 15 | // ---------------------------------------------------------------------------- 16 | 17 | #if defined(__cplusplus) 18 | extern "C" 19 | { 20 | #endif 21 | 22 | // External references to cortexm_handlers.c 23 | 24 | extern void 25 | Reset_Handler (void); 26 | extern void 27 | NMI_Handler (void); 28 | extern void 29 | HardFault_Handler (void); 30 | 31 | #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 32 | extern void 33 | MemManage_Handler (void); 34 | extern void 35 | BusFault_Handler (void); 36 | extern void 37 | UsageFault_Handler (void); 38 | extern void 39 | DebugMon_Handler (void); 40 | #endif 41 | 42 | extern void 43 | SVC_Handler (void); 44 | 45 | extern void 46 | PendSV_Handler (void); 47 | extern void 48 | SysTick_Handler (void); 49 | 50 | // Exception Stack Frame of the Cortex-M3 or Cortex-M4 processor. 51 | typedef struct 52 | { 53 | uint32_t r0; 54 | uint32_t r1; 55 | uint32_t r2; 56 | uint32_t r3; 57 | uint32_t r12; 58 | uint32_t lr; 59 | uint32_t pc; 60 | uint32_t psr; 61 | #if defined(__ARM_ARCH_7EM__) 62 | uint32_t s[16]; 63 | #endif 64 | } ExceptionStackFrame; 65 | 66 | #if defined(TRACE) 67 | #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 68 | void 69 | dumpExceptionStack (ExceptionStackFrame* frame, uint32_t cfsr, uint32_t mmfar, 70 | uint32_t bfar, uint32_t lr); 71 | #endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 72 | #if defined(__ARM_ARCH_6M__) 73 | void 74 | dumpExceptionStack (ExceptionStackFrame* frame, uint32_t lr); 75 | #endif // defined(__ARM_ARCH_6M__) 76 | #endif // defined(TRACE) 77 | 78 | void 79 | HardFault_Handler_C (ExceptionStackFrame* frame, uint32_t lr); 80 | 81 | #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 82 | void 83 | UsageFault_Handler_C (ExceptionStackFrame* frame, uint32_t lr); 84 | void 85 | BusFault_Handler_C (ExceptionStackFrame* frame, uint32_t lr); 86 | #endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 87 | 88 | #if defined(__cplusplus) 89 | } 90 | #endif 91 | 92 | // ---------------------------------------------------------------------------- 93 | 94 | #endif // CORTEXM_EXCEPTION_HANDLERS_H_ 95 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/diag/Trace.h: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | #ifndef DIAG_TRACE_H_ 7 | #define DIAG_TRACE_H_ 8 | 9 | // ---------------------------------------------------------------------------- 10 | 11 | #include 12 | 13 | // ---------------------------------------------------------------------------- 14 | 15 | // The trace device is an independent output channel, intended for debug 16 | // purposes. 17 | // 18 | // The API is simple, and mimics the standard output calls: 19 | // - trace_printf() 20 | // - trace_puts() 21 | // - trace_putchar(); 22 | // 23 | // The implementation is done in 24 | // - trace_write() 25 | // 26 | // Trace support is enabled by adding the TRACE definition. 27 | // By default the trace messages are forwarded to the ITM output, 28 | // but can be rerouted via any device or completely suppressed by 29 | // changing the definitions required in system/src/diag/trace_impl.c 30 | // (currently OS_USE_TRACE_ITM, OS_USE_TRACE_SEMIHOSTING_DEBUG/_STDOUT). 31 | // 32 | // When TRACE is not defined, all functions are inlined to empty bodies. 33 | // This has the advantage that the trace call do not need to be conditionally 34 | // compiled with #ifdef TRACE/#endif 35 | 36 | 37 | #if defined(TRACE) 38 | 39 | #if defined(__cplusplus) 40 | extern "C" 41 | { 42 | #endif 43 | 44 | void 45 | trace_initialize(void); 46 | 47 | // Implementation dependent 48 | ssize_t 49 | trace_write(const char* buf, size_t nbyte); 50 | 51 | // ----- Portable ----- 52 | 53 | int 54 | trace_printf(const char* format, ...); 55 | 56 | int 57 | trace_puts(const char *s); 58 | 59 | int 60 | trace_putchar(int c); 61 | 62 | void 63 | trace_dump_args(int argc, char* argv[]); 64 | 65 | #if defined(__cplusplus) 66 | } 67 | #endif 68 | 69 | #else // !defined(TRACE) 70 | 71 | #if defined(__cplusplus) 72 | extern "C" 73 | { 74 | #endif 75 | 76 | inline void 77 | trace_initialize(void); 78 | 79 | // Implementation dependent 80 | inline ssize_t 81 | trace_write(const char* buf, size_t nbyte); 82 | 83 | inline int 84 | trace_printf(const char* format, ...); 85 | 86 | inline int 87 | trace_puts(const char *s); 88 | 89 | inline int 90 | trace_putchar(int c); 91 | 92 | inline void 93 | trace_dump_args(int argc, char* argv[]); 94 | 95 | #if defined(__cplusplus) 96 | } 97 | #endif 98 | 99 | inline void 100 | __attribute__((always_inline)) 101 | trace_initialize(void) 102 | { 103 | } 104 | 105 | // Empty definitions when trace is not defined 106 | inline ssize_t 107 | __attribute__((always_inline)) 108 | trace_write(const char* buf __attribute__((unused)), 109 | size_t nbyte __attribute__((unused))) 110 | { 111 | return 0; 112 | } 113 | 114 | inline int 115 | __attribute__((always_inline)) 116 | trace_printf(const char* format __attribute__((unused)), ...) 117 | { 118 | return 0; 119 | } 120 | 121 | inline int 122 | __attribute__((always_inline)) 123 | trace_puts(const char *s __attribute__((unused))) 124 | { 125 | return 0; 126 | } 127 | 128 | inline int 129 | __attribute__((always_inline)) 130 | trace_putchar(int c) 131 | { 132 | return c; 133 | } 134 | 135 | inline void 136 | __attribute__((always_inline)) 137 | trace_dump_args(int argc __attribute__((unused)), 138 | char* argv[] __attribute__((unused))) 139 | { 140 | } 141 | 142 | #endif // defined(TRACE) 143 | 144 | // ---------------------------------------------------------------------------- 145 | 146 | #endif // DIAG_TRACE_H_ 147 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/README_STDPERIPH.txt: -------------------------------------------------------------------------------- 1 | These files are from stsw-stm32054.zip, the folder: 2 | 3 | STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/inc 4 | 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/misc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file misc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the miscellaneous 8 | * firmware library functions (add-on to CMSIS functions). 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __MISC_H 25 | #define __MISC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup MISC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup MISC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @brief NVIC Init Structure definition 48 | */ 49 | 50 | typedef struct 51 | { 52 | uint8_t NVIC_IRQChannel; /*!< Specifies the IRQ channel to be enabled or disabled. 53 | This parameter can be a value of @ref IRQn_Type 54 | (For the complete STM32 Devices IRQ Channels list, please 55 | refer to stm32f10x.h file) */ 56 | 57 | uint8_t NVIC_IRQChannelPreemptionPriority; /*!< Specifies the pre-emption priority for the IRQ channel 58 | specified in NVIC_IRQChannel. This parameter can be a value 59 | between 0 and 15 as described in the table @ref NVIC_Priority_Table */ 60 | 61 | uint8_t NVIC_IRQChannelSubPriority; /*!< Specifies the subpriority level for the IRQ channel specified 62 | in NVIC_IRQChannel. This parameter can be a value 63 | between 0 and 15 as described in the table @ref NVIC_Priority_Table */ 64 | 65 | FunctionalState NVIC_IRQChannelCmd; /*!< Specifies whether the IRQ channel defined in NVIC_IRQChannel 66 | will be enabled or disabled. 67 | This parameter can be set either to ENABLE or DISABLE */ 68 | } NVIC_InitTypeDef; 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @defgroup NVIC_Priority_Table 75 | * @{ 76 | */ 77 | 78 | /** 79 | @code 80 | The table below gives the allowed values of the pre-emption priority and subpriority according 81 | to the Priority Grouping configuration performed by NVIC_PriorityGroupConfig function 82 | ============================================================================================================================ 83 | NVIC_PriorityGroup | NVIC_IRQChannelPreemptionPriority | NVIC_IRQChannelSubPriority | Description 84 | ============================================================================================================================ 85 | NVIC_PriorityGroup_0 | 0 | 0-15 | 0 bits for pre-emption priority 86 | | | | 4 bits for subpriority 87 | ---------------------------------------------------------------------------------------------------------------------------- 88 | NVIC_PriorityGroup_1 | 0-1 | 0-7 | 1 bits for pre-emption priority 89 | | | | 3 bits for subpriority 90 | ---------------------------------------------------------------------------------------------------------------------------- 91 | NVIC_PriorityGroup_2 | 0-3 | 0-3 | 2 bits for pre-emption priority 92 | | | | 2 bits for subpriority 93 | ---------------------------------------------------------------------------------------------------------------------------- 94 | NVIC_PriorityGroup_3 | 0-7 | 0-1 | 3 bits for pre-emption priority 95 | | | | 1 bits for subpriority 96 | ---------------------------------------------------------------------------------------------------------------------------- 97 | NVIC_PriorityGroup_4 | 0-15 | 0 | 4 bits for pre-emption priority 98 | | | | 0 bits for subpriority 99 | ============================================================================================================================ 100 | @endcode 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** @defgroup MISC_Exported_Constants 108 | * @{ 109 | */ 110 | 111 | /** @defgroup Vector_Table_Base 112 | * @{ 113 | */ 114 | 115 | #define NVIC_VectTab_RAM ((uint32_t)0x20000000) 116 | #define NVIC_VectTab_FLASH ((uint32_t)0x08000000) 117 | #define IS_NVIC_VECTTAB(VECTTAB) (((VECTTAB) == NVIC_VectTab_RAM) || \ 118 | ((VECTTAB) == NVIC_VectTab_FLASH)) 119 | /** 120 | * @} 121 | */ 122 | 123 | /** @defgroup System_Low_Power 124 | * @{ 125 | */ 126 | 127 | #define NVIC_LP_SEVONPEND ((uint8_t)0x10) 128 | #define NVIC_LP_SLEEPDEEP ((uint8_t)0x04) 129 | #define NVIC_LP_SLEEPONEXIT ((uint8_t)0x02) 130 | #define IS_NVIC_LP(LP) (((LP) == NVIC_LP_SEVONPEND) || \ 131 | ((LP) == NVIC_LP_SLEEPDEEP) || \ 132 | ((LP) == NVIC_LP_SLEEPONEXIT)) 133 | /** 134 | * @} 135 | */ 136 | 137 | /** @defgroup Preemption_Priority_Group 138 | * @{ 139 | */ 140 | 141 | #define NVIC_PriorityGroup_0 ((uint32_t)0x700) /*!< 0 bits for pre-emption priority 142 | 4 bits for subpriority */ 143 | #define NVIC_PriorityGroup_1 ((uint32_t)0x600) /*!< 1 bits for pre-emption priority 144 | 3 bits for subpriority */ 145 | #define NVIC_PriorityGroup_2 ((uint32_t)0x500) /*!< 2 bits for pre-emption priority 146 | 2 bits for subpriority */ 147 | #define NVIC_PriorityGroup_3 ((uint32_t)0x400) /*!< 3 bits for pre-emption priority 148 | 1 bits for subpriority */ 149 | #define NVIC_PriorityGroup_4 ((uint32_t)0x300) /*!< 4 bits for pre-emption priority 150 | 0 bits for subpriority */ 151 | 152 | #define IS_NVIC_PRIORITY_GROUP(GROUP) (((GROUP) == NVIC_PriorityGroup_0) || \ 153 | ((GROUP) == NVIC_PriorityGroup_1) || \ 154 | ((GROUP) == NVIC_PriorityGroup_2) || \ 155 | ((GROUP) == NVIC_PriorityGroup_3) || \ 156 | ((GROUP) == NVIC_PriorityGroup_4)) 157 | 158 | #define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) 159 | 160 | #define IS_NVIC_SUB_PRIORITY(PRIORITY) ((PRIORITY) < 0x10) 161 | 162 | #define IS_NVIC_OFFSET(OFFSET) ((OFFSET) < 0x000FFFFF) 163 | 164 | /** 165 | * @} 166 | */ 167 | 168 | /** @defgroup SysTick_clock_source 169 | * @{ 170 | */ 171 | 172 | #define SysTick_CLKSource_HCLK_Div8 ((uint32_t)0xFFFFFFFB) 173 | #define SysTick_CLKSource_HCLK ((uint32_t)0x00000004) 174 | #define IS_SYSTICK_CLK_SOURCE(SOURCE) (((SOURCE) == SysTick_CLKSource_HCLK) || \ 175 | ((SOURCE) == SysTick_CLKSource_HCLK_Div8)) 176 | /** 177 | * @} 178 | */ 179 | 180 | /** 181 | * @} 182 | */ 183 | 184 | /** @defgroup MISC_Exported_Macros 185 | * @{ 186 | */ 187 | 188 | /** 189 | * @} 190 | */ 191 | 192 | /** @defgroup MISC_Exported_Functions 193 | * @{ 194 | */ 195 | 196 | void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup); 197 | void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct); 198 | void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset); 199 | void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState); 200 | void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource); 201 | 202 | #ifdef __cplusplus 203 | } 204 | #endif 205 | 206 | #endif /* __MISC_H */ 207 | 208 | /** 209 | * @} 210 | */ 211 | 212 | /** 213 | * @} 214 | */ 215 | 216 | /** 217 | * @} 218 | */ 219 | 220 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 221 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_bkp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_bkp.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the BKP firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_BKP_H 25 | #define __STM32F10x_BKP_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup BKP 39 | * @{ 40 | */ 41 | 42 | /** @defgroup BKP_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup BKP_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup Tamper_Pin_active_level 55 | * @{ 56 | */ 57 | 58 | #define BKP_TamperPinLevel_High ((uint16_t)0x0000) 59 | #define BKP_TamperPinLevel_Low ((uint16_t)0x0001) 60 | #define IS_BKP_TAMPER_PIN_LEVEL(LEVEL) (((LEVEL) == BKP_TamperPinLevel_High) || \ 61 | ((LEVEL) == BKP_TamperPinLevel_Low)) 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup RTC_output_source_to_output_on_the_Tamper_pin 67 | * @{ 68 | */ 69 | 70 | #define BKP_RTCOutputSource_None ((uint16_t)0x0000) 71 | #define BKP_RTCOutputSource_CalibClock ((uint16_t)0x0080) 72 | #define BKP_RTCOutputSource_Alarm ((uint16_t)0x0100) 73 | #define BKP_RTCOutputSource_Second ((uint16_t)0x0300) 74 | #define IS_BKP_RTC_OUTPUT_SOURCE(SOURCE) (((SOURCE) == BKP_RTCOutputSource_None) || \ 75 | ((SOURCE) == BKP_RTCOutputSource_CalibClock) || \ 76 | ((SOURCE) == BKP_RTCOutputSource_Alarm) || \ 77 | ((SOURCE) == BKP_RTCOutputSource_Second)) 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @defgroup Data_Backup_Register 83 | * @{ 84 | */ 85 | 86 | #define BKP_DR1 ((uint16_t)0x0004) 87 | #define BKP_DR2 ((uint16_t)0x0008) 88 | #define BKP_DR3 ((uint16_t)0x000C) 89 | #define BKP_DR4 ((uint16_t)0x0010) 90 | #define BKP_DR5 ((uint16_t)0x0014) 91 | #define BKP_DR6 ((uint16_t)0x0018) 92 | #define BKP_DR7 ((uint16_t)0x001C) 93 | #define BKP_DR8 ((uint16_t)0x0020) 94 | #define BKP_DR9 ((uint16_t)0x0024) 95 | #define BKP_DR10 ((uint16_t)0x0028) 96 | #define BKP_DR11 ((uint16_t)0x0040) 97 | #define BKP_DR12 ((uint16_t)0x0044) 98 | #define BKP_DR13 ((uint16_t)0x0048) 99 | #define BKP_DR14 ((uint16_t)0x004C) 100 | #define BKP_DR15 ((uint16_t)0x0050) 101 | #define BKP_DR16 ((uint16_t)0x0054) 102 | #define BKP_DR17 ((uint16_t)0x0058) 103 | #define BKP_DR18 ((uint16_t)0x005C) 104 | #define BKP_DR19 ((uint16_t)0x0060) 105 | #define BKP_DR20 ((uint16_t)0x0064) 106 | #define BKP_DR21 ((uint16_t)0x0068) 107 | #define BKP_DR22 ((uint16_t)0x006C) 108 | #define BKP_DR23 ((uint16_t)0x0070) 109 | #define BKP_DR24 ((uint16_t)0x0074) 110 | #define BKP_DR25 ((uint16_t)0x0078) 111 | #define BKP_DR26 ((uint16_t)0x007C) 112 | #define BKP_DR27 ((uint16_t)0x0080) 113 | #define BKP_DR28 ((uint16_t)0x0084) 114 | #define BKP_DR29 ((uint16_t)0x0088) 115 | #define BKP_DR30 ((uint16_t)0x008C) 116 | #define BKP_DR31 ((uint16_t)0x0090) 117 | #define BKP_DR32 ((uint16_t)0x0094) 118 | #define BKP_DR33 ((uint16_t)0x0098) 119 | #define BKP_DR34 ((uint16_t)0x009C) 120 | #define BKP_DR35 ((uint16_t)0x00A0) 121 | #define BKP_DR36 ((uint16_t)0x00A4) 122 | #define BKP_DR37 ((uint16_t)0x00A8) 123 | #define BKP_DR38 ((uint16_t)0x00AC) 124 | #define BKP_DR39 ((uint16_t)0x00B0) 125 | #define BKP_DR40 ((uint16_t)0x00B4) 126 | #define BKP_DR41 ((uint16_t)0x00B8) 127 | #define BKP_DR42 ((uint16_t)0x00BC) 128 | 129 | #define IS_BKP_DR(DR) (((DR) == BKP_DR1) || ((DR) == BKP_DR2) || ((DR) == BKP_DR3) || \ 130 | ((DR) == BKP_DR4) || ((DR) == BKP_DR5) || ((DR) == BKP_DR6) || \ 131 | ((DR) == BKP_DR7) || ((DR) == BKP_DR8) || ((DR) == BKP_DR9) || \ 132 | ((DR) == BKP_DR10) || ((DR) == BKP_DR11) || ((DR) == BKP_DR12) || \ 133 | ((DR) == BKP_DR13) || ((DR) == BKP_DR14) || ((DR) == BKP_DR15) || \ 134 | ((DR) == BKP_DR16) || ((DR) == BKP_DR17) || ((DR) == BKP_DR18) || \ 135 | ((DR) == BKP_DR19) || ((DR) == BKP_DR20) || ((DR) == BKP_DR21) || \ 136 | ((DR) == BKP_DR22) || ((DR) == BKP_DR23) || ((DR) == BKP_DR24) || \ 137 | ((DR) == BKP_DR25) || ((DR) == BKP_DR26) || ((DR) == BKP_DR27) || \ 138 | ((DR) == BKP_DR28) || ((DR) == BKP_DR29) || ((DR) == BKP_DR30) || \ 139 | ((DR) == BKP_DR31) || ((DR) == BKP_DR32) || ((DR) == BKP_DR33) || \ 140 | ((DR) == BKP_DR34) || ((DR) == BKP_DR35) || ((DR) == BKP_DR36) || \ 141 | ((DR) == BKP_DR37) || ((DR) == BKP_DR38) || ((DR) == BKP_DR39) || \ 142 | ((DR) == BKP_DR40) || ((DR) == BKP_DR41) || ((DR) == BKP_DR42)) 143 | 144 | #define IS_BKP_CALIBRATION_VALUE(VALUE) ((VALUE) <= 0x7F) 145 | /** 146 | * @} 147 | */ 148 | 149 | /** 150 | * @} 151 | */ 152 | 153 | /** @defgroup BKP_Exported_Macros 154 | * @{ 155 | */ 156 | 157 | /** 158 | * @} 159 | */ 160 | 161 | /** @defgroup BKP_Exported_Functions 162 | * @{ 163 | */ 164 | 165 | void BKP_DeInit(void); 166 | void BKP_TamperPinLevelConfig(uint16_t BKP_TamperPinLevel); 167 | void BKP_TamperPinCmd(FunctionalState NewState); 168 | void BKP_ITConfig(FunctionalState NewState); 169 | void BKP_RTCOutputConfig(uint16_t BKP_RTCOutputSource); 170 | void BKP_SetRTCCalibrationValue(uint8_t CalibrationValue); 171 | void BKP_WriteBackupRegister(uint16_t BKP_DR, uint16_t Data); 172 | uint16_t BKP_ReadBackupRegister(uint16_t BKP_DR); 173 | FlagStatus BKP_GetFlagStatus(void); 174 | void BKP_ClearFlag(void); 175 | ITStatus BKP_GetITStatus(void); 176 | void BKP_ClearITPendingBit(void); 177 | 178 | #ifdef __cplusplus 179 | } 180 | #endif 181 | 182 | #endif /* __STM32F10x_BKP_H */ 183 | /** 184 | * @} 185 | */ 186 | 187 | /** 188 | * @} 189 | */ 190 | 191 | /** 192 | * @} 193 | */ 194 | 195 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 196 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_cec.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_cec.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CEC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CEC_H 25 | #define __STM32F10x_CEC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CEC 39 | * @{ 40 | */ 41 | 42 | 43 | /** @defgroup CEC_Exported_Types 44 | * @{ 45 | */ 46 | 47 | /** 48 | * @brief CEC Init structure definition 49 | */ 50 | typedef struct 51 | { 52 | uint16_t CEC_BitTimingMode; /*!< Configures the CEC Bit Timing Error Mode. 53 | This parameter can be a value of @ref CEC_BitTiming_Mode */ 54 | uint16_t CEC_BitPeriodMode; /*!< Configures the CEC Bit Period Error Mode. 55 | This parameter can be a value of @ref CEC_BitPeriod_Mode */ 56 | }CEC_InitTypeDef; 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | /** @defgroup CEC_Exported_Constants 63 | * @{ 64 | */ 65 | 66 | /** @defgroup CEC_BitTiming_Mode 67 | * @{ 68 | */ 69 | #define CEC_BitTimingStdMode ((uint16_t)0x00) /*!< Bit timing error Standard Mode */ 70 | #define CEC_BitTimingErrFreeMode CEC_CFGR_BTEM /*!< Bit timing error Free Mode */ 71 | 72 | #define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \ 73 | ((MODE) == CEC_BitTimingErrFreeMode)) 74 | /** 75 | * @} 76 | */ 77 | 78 | /** @defgroup CEC_BitPeriod_Mode 79 | * @{ 80 | */ 81 | #define CEC_BitPeriodStdMode ((uint16_t)0x00) /*!< Bit period error Standard Mode */ 82 | #define CEC_BitPeriodFlexibleMode CEC_CFGR_BPEM /*!< Bit period error Flexible Mode */ 83 | 84 | #define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \ 85 | ((MODE) == CEC_BitPeriodFlexibleMode)) 86 | /** 87 | * @} 88 | */ 89 | 90 | 91 | /** @defgroup CEC_interrupts_definition 92 | * @{ 93 | */ 94 | #define CEC_IT_TERR CEC_CSR_TERR 95 | #define CEC_IT_TBTRF CEC_CSR_TBTRF 96 | #define CEC_IT_RERR CEC_CSR_RERR 97 | #define CEC_IT_RBTF CEC_CSR_RBTF 98 | #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \ 99 | ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF)) 100 | /** 101 | * @} 102 | */ 103 | 104 | 105 | /** @defgroup CEC_Own_Address 106 | * @{ 107 | */ 108 | #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10) 109 | /** 110 | * @} 111 | */ 112 | 113 | /** @defgroup CEC_Prescaler 114 | * @{ 115 | */ 116 | #define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF) 117 | 118 | /** 119 | * @} 120 | */ 121 | 122 | /** @defgroup CEC_flags_definition 123 | * @{ 124 | */ 125 | 126 | /** 127 | * @brief ESR register flags 128 | */ 129 | #define CEC_FLAG_BTE ((uint32_t)0x10010000) 130 | #define CEC_FLAG_BPE ((uint32_t)0x10020000) 131 | #define CEC_FLAG_RBTFE ((uint32_t)0x10040000) 132 | #define CEC_FLAG_SBE ((uint32_t)0x10080000) 133 | #define CEC_FLAG_ACKE ((uint32_t)0x10100000) 134 | #define CEC_FLAG_LINE ((uint32_t)0x10200000) 135 | #define CEC_FLAG_TBTFE ((uint32_t)0x10400000) 136 | 137 | /** 138 | * @brief CSR register flags 139 | */ 140 | #define CEC_FLAG_TEOM ((uint32_t)0x00000002) 141 | #define CEC_FLAG_TERR ((uint32_t)0x00000004) 142 | #define CEC_FLAG_TBTRF ((uint32_t)0x00000008) 143 | #define CEC_FLAG_RSOM ((uint32_t)0x00000010) 144 | #define CEC_FLAG_REOM ((uint32_t)0x00000020) 145 | #define CEC_FLAG_RERR ((uint32_t)0x00000040) 146 | #define CEC_FLAG_RBTF ((uint32_t)0x00000080) 147 | 148 | #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00)) 149 | 150 | #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \ 151 | ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \ 152 | ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \ 153 | ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \ 154 | ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \ 155 | ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \ 156 | ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF)) 157 | 158 | /** 159 | * @} 160 | */ 161 | 162 | /** 163 | * @} 164 | */ 165 | 166 | /** @defgroup CEC_Exported_Macros 167 | * @{ 168 | */ 169 | 170 | /** 171 | * @} 172 | */ 173 | 174 | /** @defgroup CEC_Exported_Functions 175 | * @{ 176 | */ 177 | void CEC_DeInit(void); 178 | void CEC_Init(CEC_InitTypeDef* CEC_InitStruct); 179 | void CEC_Cmd(FunctionalState NewState); 180 | void CEC_ITConfig(FunctionalState NewState); 181 | void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress); 182 | void CEC_SetPrescaler(uint16_t CEC_Prescaler); 183 | void CEC_SendDataByte(uint8_t Data); 184 | uint8_t CEC_ReceiveDataByte(void); 185 | void CEC_StartOfMessage(void); 186 | void CEC_EndOfMessageCmd(FunctionalState NewState); 187 | FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG); 188 | void CEC_ClearFlag(uint32_t CEC_FLAG); 189 | ITStatus CEC_GetITStatus(uint8_t CEC_IT); 190 | void CEC_ClearITPendingBit(uint16_t CEC_IT); 191 | 192 | #ifdef __cplusplus 193 | } 194 | #endif 195 | 196 | #endif /* __STM32F10x_CEC_H */ 197 | 198 | /** 199 | * @} 200 | */ 201 | 202 | /** 203 | * @} 204 | */ 205 | 206 | /** 207 | * @} 208 | */ 209 | 210 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 211 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CRC_H 25 | #define __STM32F10x_CRC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CRC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup CRC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Exported_Macros 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Exported_Functions 67 | * @{ 68 | */ 69 | 70 | void CRC_ResetDR(void); 71 | uint32_t CRC_CalcCRC(uint32_t Data); 72 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 73 | uint32_t CRC_GetCRC(void); 74 | void CRC_SetIDRegister(uint8_t IDValue); 75 | uint8_t CRC_GetIDRegister(void); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __STM32F10x_CRC_H */ 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_dbgmcu.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_dbgmcu.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the DBGMCU 8 | * firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_DBGMCU_H 25 | #define __STM32F10x_DBGMCU_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup DBGMCU 39 | * @{ 40 | */ 41 | 42 | /** @defgroup DBGMCU_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup DBGMCU_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | #define DBGMCU_SLEEP ((uint32_t)0x00000001) 55 | #define DBGMCU_STOP ((uint32_t)0x00000002) 56 | #define DBGMCU_STANDBY ((uint32_t)0x00000004) 57 | #define DBGMCU_IWDG_STOP ((uint32_t)0x00000100) 58 | #define DBGMCU_WWDG_STOP ((uint32_t)0x00000200) 59 | #define DBGMCU_TIM1_STOP ((uint32_t)0x00000400) 60 | #define DBGMCU_TIM2_STOP ((uint32_t)0x00000800) 61 | #define DBGMCU_TIM3_STOP ((uint32_t)0x00001000) 62 | #define DBGMCU_TIM4_STOP ((uint32_t)0x00002000) 63 | #define DBGMCU_CAN1_STOP ((uint32_t)0x00004000) 64 | #define DBGMCU_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000) 65 | #define DBGMCU_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000) 66 | #define DBGMCU_TIM8_STOP ((uint32_t)0x00020000) 67 | #define DBGMCU_TIM5_STOP ((uint32_t)0x00040000) 68 | #define DBGMCU_TIM6_STOP ((uint32_t)0x00080000) 69 | #define DBGMCU_TIM7_STOP ((uint32_t)0x00100000) 70 | #define DBGMCU_CAN2_STOP ((uint32_t)0x00200000) 71 | #define DBGMCU_TIM15_STOP ((uint32_t)0x00400000) 72 | #define DBGMCU_TIM16_STOP ((uint32_t)0x00800000) 73 | #define DBGMCU_TIM17_STOP ((uint32_t)0x01000000) 74 | #define DBGMCU_TIM12_STOP ((uint32_t)0x02000000) 75 | #define DBGMCU_TIM13_STOP ((uint32_t)0x04000000) 76 | #define DBGMCU_TIM14_STOP ((uint32_t)0x08000000) 77 | #define DBGMCU_TIM9_STOP ((uint32_t)0x10000000) 78 | #define DBGMCU_TIM10_STOP ((uint32_t)0x20000000) 79 | #define DBGMCU_TIM11_STOP ((uint32_t)0x40000000) 80 | 81 | #define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0x800000F8) == 0x00) && ((PERIPH) != 0x00)) 82 | /** 83 | * @} 84 | */ 85 | 86 | /** @defgroup DBGMCU_Exported_Macros 87 | * @{ 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /** @defgroup DBGMCU_Exported_Functions 95 | * @{ 96 | */ 97 | 98 | uint32_t DBGMCU_GetREVID(void); 99 | uint32_t DBGMCU_GetDEVID(void); 100 | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState); 101 | 102 | #ifdef __cplusplus 103 | } 104 | #endif 105 | 106 | #endif /* __STM32F10x_DBGMCU_H */ 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | /** 116 | * @} 117 | */ 118 | 119 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 120 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_exti.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_exti.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the EXTI firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_EXTI_H 25 | #define __STM32F10x_EXTI_H 26 | 27 | // [ILG] 28 | #if defined ( __GNUC__ ) 29 | #pragma GCC diagnostic push 30 | #pragma GCC diagnostic ignored "-Wpadded" 31 | #endif 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f10x.h" 39 | 40 | /** @addtogroup STM32F10x_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup EXTI 45 | * @{ 46 | */ 47 | 48 | /** @defgroup EXTI_Exported_Types 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief EXTI mode enumeration 54 | */ 55 | 56 | typedef enum 57 | { 58 | EXTI_Mode_Interrupt = 0x00, 59 | EXTI_Mode_Event = 0x04 60 | }EXTIMode_TypeDef; 61 | 62 | #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event)) 63 | 64 | /** 65 | * @brief EXTI Trigger enumeration 66 | */ 67 | 68 | typedef enum 69 | { 70 | EXTI_Trigger_Rising = 0x08, 71 | EXTI_Trigger_Falling = 0x0C, 72 | EXTI_Trigger_Rising_Falling = 0x10 73 | }EXTITrigger_TypeDef; 74 | 75 | #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \ 76 | ((TRIGGER) == EXTI_Trigger_Falling) || \ 77 | ((TRIGGER) == EXTI_Trigger_Rising_Falling)) 78 | /** 79 | * @brief EXTI Init Structure definition 80 | */ 81 | 82 | typedef struct 83 | { 84 | uint32_t EXTI_Line; /*!< Specifies the EXTI lines to be enabled or disabled. 85 | This parameter can be any combination of @ref EXTI_Lines */ 86 | 87 | EXTIMode_TypeDef EXTI_Mode; /*!< Specifies the mode for the EXTI lines. 88 | This parameter can be a value of @ref EXTIMode_TypeDef */ 89 | 90 | EXTITrigger_TypeDef EXTI_Trigger; /*!< Specifies the trigger signal active edge for the EXTI lines. 91 | This parameter can be a value of @ref EXTIMode_TypeDef */ 92 | 93 | FunctionalState EXTI_LineCmd; /*!< Specifies the new state of the selected EXTI lines. 94 | This parameter can be set either to ENABLE or DISABLE */ 95 | }EXTI_InitTypeDef; 96 | 97 | /** 98 | * @} 99 | */ 100 | 101 | /** @defgroup EXTI_Exported_Constants 102 | * @{ 103 | */ 104 | 105 | /** @defgroup EXTI_Lines 106 | * @{ 107 | */ 108 | 109 | #define EXTI_Line0 ((uint32_t)0x00001) /*!< External interrupt line 0 */ 110 | #define EXTI_Line1 ((uint32_t)0x00002) /*!< External interrupt line 1 */ 111 | #define EXTI_Line2 ((uint32_t)0x00004) /*!< External interrupt line 2 */ 112 | #define EXTI_Line3 ((uint32_t)0x00008) /*!< External interrupt line 3 */ 113 | #define EXTI_Line4 ((uint32_t)0x00010) /*!< External interrupt line 4 */ 114 | #define EXTI_Line5 ((uint32_t)0x00020) /*!< External interrupt line 5 */ 115 | #define EXTI_Line6 ((uint32_t)0x00040) /*!< External interrupt line 6 */ 116 | #define EXTI_Line7 ((uint32_t)0x00080) /*!< External interrupt line 7 */ 117 | #define EXTI_Line8 ((uint32_t)0x00100) /*!< External interrupt line 8 */ 118 | #define EXTI_Line9 ((uint32_t)0x00200) /*!< External interrupt line 9 */ 119 | #define EXTI_Line10 ((uint32_t)0x00400) /*!< External interrupt line 10 */ 120 | #define EXTI_Line11 ((uint32_t)0x00800) /*!< External interrupt line 11 */ 121 | #define EXTI_Line12 ((uint32_t)0x01000) /*!< External interrupt line 12 */ 122 | #define EXTI_Line13 ((uint32_t)0x02000) /*!< External interrupt line 13 */ 123 | #define EXTI_Line14 ((uint32_t)0x04000) /*!< External interrupt line 14 */ 124 | #define EXTI_Line15 ((uint32_t)0x08000) /*!< External interrupt line 15 */ 125 | #define EXTI_Line16 ((uint32_t)0x10000) /*!< External interrupt line 16 Connected to the PVD Output */ 126 | #define EXTI_Line17 ((uint32_t)0x20000) /*!< External interrupt line 17 Connected to the RTC Alarm event */ 127 | #define EXTI_Line18 ((uint32_t)0x40000) /*!< External interrupt line 18 Connected to the USB Device/USB OTG FS 128 | Wakeup from suspend event */ 129 | #define EXTI_Line19 ((uint32_t)0x80000) /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */ 130 | 131 | #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00)) 132 | #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \ 133 | ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \ 134 | ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \ 135 | ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \ 136 | ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \ 137 | ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \ 138 | ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \ 139 | ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \ 140 | ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \ 141 | ((LINE) == EXTI_Line18) || ((LINE) == EXTI_Line19)) 142 | 143 | 144 | /** 145 | * @} 146 | */ 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | /** @defgroup EXTI_Exported_Macros 153 | * @{ 154 | */ 155 | 156 | /** 157 | * @} 158 | */ 159 | 160 | /** @defgroup EXTI_Exported_Functions 161 | * @{ 162 | */ 163 | 164 | void EXTI_DeInit(void); 165 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct); 166 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct); 167 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line); 168 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line); 169 | void EXTI_ClearFlag(uint32_t EXTI_Line); 170 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line); 171 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line); 172 | 173 | #ifdef __cplusplus 174 | } 175 | #endif 176 | 177 | // [ILG] 178 | #if defined ( __GNUC__ ) 179 | #pragma GCC diagnostic pop 180 | #endif 181 | 182 | #endif /* __STM32F10x_EXTI_H */ 183 | /** 184 | * @} 185 | */ 186 | 187 | /** 188 | * @} 189 | */ 190 | 191 | /** 192 | * @} 193 | */ 194 | 195 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 196 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_iwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_iwdg.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the IWDG 8 | * firmware library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_IWDG_H 25 | #define __STM32F10x_IWDG_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup IWDG 39 | * @{ 40 | */ 41 | 42 | /** @defgroup IWDG_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup IWDG_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup IWDG_WriteAccess 55 | * @{ 56 | */ 57 | 58 | #define IWDG_WriteAccess_Enable ((uint16_t)0x5555) 59 | #define IWDG_WriteAccess_Disable ((uint16_t)0x0000) 60 | #define IS_IWDG_WRITE_ACCESS(ACCESS) (((ACCESS) == IWDG_WriteAccess_Enable) || \ 61 | ((ACCESS) == IWDG_WriteAccess_Disable)) 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup IWDG_prescaler 67 | * @{ 68 | */ 69 | 70 | #define IWDG_Prescaler_4 ((uint8_t)0x00) 71 | #define IWDG_Prescaler_8 ((uint8_t)0x01) 72 | #define IWDG_Prescaler_16 ((uint8_t)0x02) 73 | #define IWDG_Prescaler_32 ((uint8_t)0x03) 74 | #define IWDG_Prescaler_64 ((uint8_t)0x04) 75 | #define IWDG_Prescaler_128 ((uint8_t)0x05) 76 | #define IWDG_Prescaler_256 ((uint8_t)0x06) 77 | #define IS_IWDG_PRESCALER(PRESCALER) (((PRESCALER) == IWDG_Prescaler_4) || \ 78 | ((PRESCALER) == IWDG_Prescaler_8) || \ 79 | ((PRESCALER) == IWDG_Prescaler_16) || \ 80 | ((PRESCALER) == IWDG_Prescaler_32) || \ 81 | ((PRESCALER) == IWDG_Prescaler_64) || \ 82 | ((PRESCALER) == IWDG_Prescaler_128)|| \ 83 | ((PRESCALER) == IWDG_Prescaler_256)) 84 | /** 85 | * @} 86 | */ 87 | 88 | /** @defgroup IWDG_Flag 89 | * @{ 90 | */ 91 | 92 | #define IWDG_FLAG_PVU ((uint16_t)0x0001) 93 | #define IWDG_FLAG_RVU ((uint16_t)0x0002) 94 | #define IS_IWDG_FLAG(FLAG) (((FLAG) == IWDG_FLAG_PVU) || ((FLAG) == IWDG_FLAG_RVU)) 95 | #define IS_IWDG_RELOAD(RELOAD) ((RELOAD) <= 0xFFF) 96 | /** 97 | * @} 98 | */ 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | /** @defgroup IWDG_Exported_Macros 105 | * @{ 106 | */ 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | /** @defgroup IWDG_Exported_Functions 113 | * @{ 114 | */ 115 | 116 | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess); 117 | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler); 118 | void IWDG_SetReload(uint16_t Reload); 119 | void IWDG_ReloadCounter(void); 120 | void IWDG_Enable(void); 121 | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG); 122 | 123 | #ifdef __cplusplus 124 | } 125 | #endif 126 | 127 | #endif /* __STM32F10x_IWDG_H */ 128 | /** 129 | * @} 130 | */ 131 | 132 | /** 133 | * @} 134 | */ 135 | 136 | /** 137 | * @} 138 | */ 139 | 140 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 141 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_pwr.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_pwr.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the PWR firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_PWR_H 25 | #define __STM32F10x_PWR_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup PWR 39 | * @{ 40 | */ 41 | 42 | /** @defgroup PWR_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup PWR_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup PVD_detection_level 55 | * @{ 56 | */ 57 | 58 | #define PWR_PVDLevel_2V2 ((uint32_t)0x00000000) 59 | #define PWR_PVDLevel_2V3 ((uint32_t)0x00000020) 60 | #define PWR_PVDLevel_2V4 ((uint32_t)0x00000040) 61 | #define PWR_PVDLevel_2V5 ((uint32_t)0x00000060) 62 | #define PWR_PVDLevel_2V6 ((uint32_t)0x00000080) 63 | #define PWR_PVDLevel_2V7 ((uint32_t)0x000000A0) 64 | #define PWR_PVDLevel_2V8 ((uint32_t)0x000000C0) 65 | #define PWR_PVDLevel_2V9 ((uint32_t)0x000000E0) 66 | #define IS_PWR_PVD_LEVEL(LEVEL) (((LEVEL) == PWR_PVDLevel_2V2) || ((LEVEL) == PWR_PVDLevel_2V3)|| \ 67 | ((LEVEL) == PWR_PVDLevel_2V4) || ((LEVEL) == PWR_PVDLevel_2V5)|| \ 68 | ((LEVEL) == PWR_PVDLevel_2V6) || ((LEVEL) == PWR_PVDLevel_2V7)|| \ 69 | ((LEVEL) == PWR_PVDLevel_2V8) || ((LEVEL) == PWR_PVDLevel_2V9)) 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @defgroup Regulator_state_is_STOP_mode 75 | * @{ 76 | */ 77 | 78 | #define PWR_Regulator_ON ((uint32_t)0x00000000) 79 | #define PWR_Regulator_LowPower ((uint32_t)0x00000001) 80 | #define IS_PWR_REGULATOR(REGULATOR) (((REGULATOR) == PWR_Regulator_ON) || \ 81 | ((REGULATOR) == PWR_Regulator_LowPower)) 82 | /** 83 | * @} 84 | */ 85 | 86 | /** @defgroup STOP_mode_entry 87 | * @{ 88 | */ 89 | 90 | #define PWR_STOPEntry_WFI ((uint8_t)0x01) 91 | #define PWR_STOPEntry_WFE ((uint8_t)0x02) 92 | #define IS_PWR_STOP_ENTRY(ENTRY) (((ENTRY) == PWR_STOPEntry_WFI) || ((ENTRY) == PWR_STOPEntry_WFE)) 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /** @defgroup PWR_Flag 99 | * @{ 100 | */ 101 | 102 | #define PWR_FLAG_WU ((uint32_t)0x00000001) 103 | #define PWR_FLAG_SB ((uint32_t)0x00000002) 104 | #define PWR_FLAG_PVDO ((uint32_t)0x00000004) 105 | #define IS_PWR_GET_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB) || \ 106 | ((FLAG) == PWR_FLAG_PVDO)) 107 | 108 | #define IS_PWR_CLEAR_FLAG(FLAG) (((FLAG) == PWR_FLAG_WU) || ((FLAG) == PWR_FLAG_SB)) 109 | /** 110 | * @} 111 | */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** @defgroup PWR_Exported_Macros 118 | * @{ 119 | */ 120 | 121 | /** 122 | * @} 123 | */ 124 | 125 | /** @defgroup PWR_Exported_Functions 126 | * @{ 127 | */ 128 | 129 | void PWR_DeInit(void); 130 | void PWR_BackupAccessCmd(FunctionalState NewState); 131 | void PWR_PVDCmd(FunctionalState NewState); 132 | void PWR_PVDLevelConfig(uint32_t PWR_PVDLevel); 133 | void PWR_WakeUpPinCmd(FunctionalState NewState); 134 | void PWR_EnterSTOPMode(uint32_t PWR_Regulator, uint8_t PWR_STOPEntry); 135 | void PWR_EnterSTANDBYMode(void); 136 | FlagStatus PWR_GetFlagStatus(uint32_t PWR_FLAG); 137 | void PWR_ClearFlag(uint32_t PWR_FLAG); 138 | 139 | #ifdef __cplusplus 140 | } 141 | #endif 142 | 143 | #endif /* __STM32F10x_PWR_H */ 144 | /** 145 | * @} 146 | */ 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | /** 153 | * @} 154 | */ 155 | 156 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 157 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_rtc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_rtc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the RTC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_RTC_H 25 | #define __STM32F10x_RTC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup RTC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup RTC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup RTC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup RTC_interrupts_define 55 | * @{ 56 | */ 57 | 58 | #define RTC_IT_OW ((uint16_t)0x0004) /*!< Overflow interrupt */ 59 | #define RTC_IT_ALR ((uint16_t)0x0002) /*!< Alarm interrupt */ 60 | #define RTC_IT_SEC ((uint16_t)0x0001) /*!< Second interrupt */ 61 | #define IS_RTC_IT(IT) ((((IT) & (uint16_t)0xFFF8) == 0x00) && ((IT) != 0x00)) 62 | #define IS_RTC_GET_IT(IT) (((IT) == RTC_IT_OW) || ((IT) == RTC_IT_ALR) || \ 63 | ((IT) == RTC_IT_SEC)) 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @defgroup RTC_interrupts_flags 69 | * @{ 70 | */ 71 | 72 | #define RTC_FLAG_RTOFF ((uint16_t)0x0020) /*!< RTC Operation OFF flag */ 73 | #define RTC_FLAG_RSF ((uint16_t)0x0008) /*!< Registers Synchronized flag */ 74 | #define RTC_FLAG_OW ((uint16_t)0x0004) /*!< Overflow flag */ 75 | #define RTC_FLAG_ALR ((uint16_t)0x0002) /*!< Alarm flag */ 76 | #define RTC_FLAG_SEC ((uint16_t)0x0001) /*!< Second flag */ 77 | #define IS_RTC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint16_t)0xFFF0) == 0x00) && ((FLAG) != 0x00)) 78 | #define IS_RTC_GET_FLAG(FLAG) (((FLAG) == RTC_FLAG_RTOFF) || ((FLAG) == RTC_FLAG_RSF) || \ 79 | ((FLAG) == RTC_FLAG_OW) || ((FLAG) == RTC_FLAG_ALR) || \ 80 | ((FLAG) == RTC_FLAG_SEC)) 81 | #define IS_RTC_PRESCALER(PRESCALER) ((PRESCALER) <= 0xFFFFF) 82 | 83 | /** 84 | * @} 85 | */ 86 | 87 | /** 88 | * @} 89 | */ 90 | 91 | /** @defgroup RTC_Exported_Macros 92 | * @{ 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | 99 | /** @defgroup RTC_Exported_Functions 100 | * @{ 101 | */ 102 | 103 | void RTC_ITConfig(uint16_t RTC_IT, FunctionalState NewState); 104 | void RTC_EnterConfigMode(void); 105 | void RTC_ExitConfigMode(void); 106 | uint32_t RTC_GetCounter(void); 107 | void RTC_SetCounter(uint32_t CounterValue); 108 | void RTC_SetPrescaler(uint32_t PrescalerValue); 109 | void RTC_SetAlarm(uint32_t AlarmValue); 110 | uint32_t RTC_GetDivider(void); 111 | void RTC_WaitForLastTask(void); 112 | void RTC_WaitForSynchro(void); 113 | FlagStatus RTC_GetFlagStatus(uint16_t RTC_FLAG); 114 | void RTC_ClearFlag(uint16_t RTC_FLAG); 115 | ITStatus RTC_GetITStatus(uint16_t RTC_IT); 116 | void RTC_ClearITPendingBit(uint16_t RTC_IT); 117 | 118 | #ifdef __cplusplus 119 | } 120 | #endif 121 | 122 | #endif /* __STM32F10x_RTC_H */ 123 | /** 124 | * @} 125 | */ 126 | 127 | /** 128 | * @} 129 | */ 130 | 131 | /** 132 | * @} 133 | */ 134 | 135 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 136 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/include/stm32f1-stdperiph/stm32f10x_wwdg.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_wwdg.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the WWDG firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_WWDG_H 25 | #define __STM32F10x_WWDG_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup WWDG 39 | * @{ 40 | */ 41 | 42 | /** @defgroup WWDG_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup WWDG_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** @defgroup WWDG_Prescaler 55 | * @{ 56 | */ 57 | 58 | #define WWDG_Prescaler_1 ((uint32_t)0x00000000) 59 | #define WWDG_Prescaler_2 ((uint32_t)0x00000080) 60 | #define WWDG_Prescaler_4 ((uint32_t)0x00000100) 61 | #define WWDG_Prescaler_8 ((uint32_t)0x00000180) 62 | #define IS_WWDG_PRESCALER(PRESCALER) (((PRESCALER) == WWDG_Prescaler_1) || \ 63 | ((PRESCALER) == WWDG_Prescaler_2) || \ 64 | ((PRESCALER) == WWDG_Prescaler_4) || \ 65 | ((PRESCALER) == WWDG_Prescaler_8)) 66 | #define IS_WWDG_WINDOW_VALUE(VALUE) ((VALUE) <= 0x7F) 67 | #define IS_WWDG_COUNTER(COUNTER) (((COUNTER) >= 0x40) && ((COUNTER) <= 0x7F)) 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** @defgroup WWDG_Exported_Macros 78 | * @{ 79 | */ 80 | /** 81 | * @} 82 | */ 83 | 84 | /** @defgroup WWDG_Exported_Functions 85 | * @{ 86 | */ 87 | 88 | void WWDG_DeInit(void); 89 | void WWDG_SetPrescaler(uint32_t WWDG_Prescaler); 90 | void WWDG_SetWindowValue(uint8_t WindowValue); 91 | void WWDG_EnableIT(void); 92 | void WWDG_SetCounter(uint8_t Counter); 93 | void WWDG_Enable(uint8_t Counter); 94 | FlagStatus WWDG_GetFlagStatus(void); 95 | void WWDG_ClearFlag(void); 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* __STM32F10x_WWDG_H */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /** 112 | * @} 113 | */ 114 | 115 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 116 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/cmsis/README_DEVICE.txt: -------------------------------------------------------------------------------- 1 | The system_stm32f10x.c file is from stsw-stm32054.zip, the folder: 2 | 3 | STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/CMSIS/CM3/DeviceSupport/ST/STM32F10x 4 | 5 | The vectors_stm32f10x.c was created to conform to the startup_stm32f10x_xx*.s. -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/cortexm/_initialize_hardware.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #include "cmsis_device.h" 9 | 10 | // ---------------------------------------------------------------------------- 11 | 12 | extern unsigned int __vectors_start; 13 | 14 | // Forward declarations. 15 | 16 | void 17 | __initialize_hardware_early(void); 18 | 19 | void 20 | __initialize_hardware(void); 21 | 22 | // ---------------------------------------------------------------------------- 23 | 24 | // This is the early hardware initialisation routine, it can be 25 | // redefined in the application for more complex cases that 26 | // require early inits (before BSS init). 27 | // 28 | // Called early from _start(), right before data & bss init. 29 | // 30 | // After Reset the Cortex-M processor is in Thread mode, 31 | // priority is Privileged, and the Stack is set to Main. 32 | 33 | void 34 | __attribute__((weak)) 35 | __initialize_hardware_early(void) 36 | { 37 | // Call the CSMSIS system initialisation routine. 38 | SystemInit(); 39 | 40 | #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 41 | // Set VTOR to the actual address, provided by the linker script. 42 | // Override the manual, possibly wrong, SystemInit() setting. 43 | SCB->VTOR = (uint32_t)(&__vectors_start); 44 | #endif 45 | 46 | // The current version of SystemInit() leaves the value of the clock 47 | // in a RAM variable (SystemCoreClock), which will be cleared shortly, 48 | // so it needs to be recomputed after the RAM initialisations 49 | // are completed. 50 | 51 | #if defined(OS_INCLUDE_STARTUP_INIT_FP) || (defined (__VFP_FP__) && !defined (__SOFTFP__)) 52 | 53 | // Normally FP init is done by SystemInit(). In case this is not done 54 | // there, it is possible to force its inclusion by defining 55 | // OS_INCLUDE_STARTUP_INIT_FP. 56 | 57 | // Enable the Cortex-M4 FPU only when -mfloat-abi=hard. 58 | // Code taken from Section 7.1, Cortex-M4 TRM (DDI0439C) 59 | 60 | // Set bits 20-23 to enable CP10 and CP11 coprocessor 61 | SCB->CPACR |= (0xF << 20); 62 | 63 | #endif // (__VFP_FP__) && !(__SOFTFP__) 64 | 65 | #if defined(OS_DEBUG_SEMIHOSTING_FAULTS) 66 | SCB->SHCSR |= SCB_SHCSR_USGFAULTENA_Msk; 67 | #endif 68 | } 69 | 70 | // This is the second hardware initialisation routine, it can be 71 | // redefined in the application for more complex cases that 72 | // require custom inits (before constructors), otherwise these can 73 | // be done in main(). 74 | // 75 | // Called from _start(), right after data & bss init, before 76 | // constructors. 77 | 78 | void 79 | __attribute__((weak)) 80 | __initialize_hardware(void) 81 | { 82 | // Call the CSMSIS system clock routine to store the clock frequency 83 | // in the SystemCoreClock global RAM location. 84 | SystemCoreClockUpdate(); 85 | } 86 | 87 | // ---------------------------------------------------------------------------- 88 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/cortexm/_reset_hardware.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #include "cmsis_device.h" 9 | 10 | // ---------------------------------------------------------------------------- 11 | 12 | extern void 13 | __attribute__((noreturn)) 14 | NVIC_SystemReset(void); 15 | 16 | // ---------------------------------------------------------------------------- 17 | 18 | // Forward declarations 19 | 20 | void 21 | __reset_hardware(void); 22 | 23 | // ---------------------------------------------------------------------------- 24 | 25 | // This is the default hardware reset routine; it can be 26 | // redefined in the application for more complex applications. 27 | // 28 | // Called from _exit(). 29 | 30 | void 31 | __attribute__((weak,noreturn)) 32 | __reset_hardware() 33 | { 34 | NVIC_SystemReset(); 35 | } 36 | 37 | // ---------------------------------------------------------------------------- 38 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/diag/Trace.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #if defined(TRACE) 9 | 10 | #include 11 | #include 12 | #include "diag/Trace.h" 13 | #include "string.h" 14 | 15 | #ifndef OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE 16 | #define OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE (128) 17 | #endif 18 | 19 | // ---------------------------------------------------------------------------- 20 | 21 | int 22 | trace_printf(const char* format, ...) 23 | { 24 | int ret; 25 | va_list ap; 26 | 27 | va_start (ap, format); 28 | 29 | // TODO: rewrite it to no longer use newlib, it is way too heavy 30 | 31 | static char buf[OS_INTEGER_TRACE_PRINTF_TMP_ARRAY_SIZE]; 32 | 33 | // Print to the local buffer 34 | ret = vsnprintf (buf, sizeof(buf), format, ap); 35 | if (ret > 0) 36 | { 37 | // Transfer the buffer to the device 38 | ret = trace_write (buf, (size_t)ret); 39 | } 40 | 41 | va_end (ap); 42 | return ret; 43 | } 44 | 45 | int 46 | trace_puts(const char *s) 47 | { 48 | trace_write(s, strlen(s)); 49 | return trace_write("\n", 1); 50 | } 51 | 52 | int 53 | trace_putchar(int c) 54 | { 55 | trace_write((const char*)&c, 1); 56 | return c; 57 | } 58 | 59 | void 60 | trace_dump_args(int argc, char* argv[]) 61 | { 62 | trace_printf("main(argc=%d, argv=[", argc); 63 | for (int i = 0; i < argc; ++i) 64 | { 65 | if (i != 0) 66 | { 67 | trace_printf(", "); 68 | } 69 | trace_printf("\"%s\"", argv[i]); 70 | } 71 | trace_printf("]);\n"); 72 | } 73 | 74 | // ---------------------------------------------------------------------------- 75 | 76 | #endif // TRACE 77 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/diag/trace_impl.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #if defined(TRACE) 9 | 10 | #include "cmsis_device.h" 11 | #include "diag/Trace.h" 12 | 13 | // ---------------------------------------------------------------------------- 14 | 15 | // One of these definitions must be passed via the compiler command line 16 | // Note: small Cortex-M0/M0+ might implement a simplified debug interface. 17 | 18 | //#define OS_USE_TRACE_ITM 19 | //#define OS_USE_TRACE_SEMIHOSTING_DEBUG 20 | //#define OS_USE_TRACE_SEMIHOSTING_STDOUT 21 | 22 | #if !(defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)) 23 | #if defined(OS_USE_TRACE_ITM) 24 | #undef OS_USE_TRACE_ITM 25 | #warning "ITM unavailable" 26 | #endif // defined(OS_USE_TRACE_ITM) 27 | #endif // !(defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__)) 28 | 29 | #if defined(OS_DEBUG_SEMIHOSTING_FAULTS) 30 | #if defined(OS_USE_TRACE_SEMIHOSTING_STDOUT) || defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) 31 | #error "Cannot debug semihosting using semihosting trace; use OS_USE_TRACE_ITM" 32 | #endif 33 | #endif 34 | 35 | // ---------------------------------------------------------------------------- 36 | 37 | // Forward definitions. 38 | 39 | #if defined(OS_USE_TRACE_ITM) 40 | static ssize_t 41 | _trace_write_itm (const char* buf, size_t nbyte); 42 | #endif 43 | 44 | #if defined(OS_USE_TRACE_SEMIHOSTING_STDOUT) 45 | static ssize_t 46 | _trace_write_semihosting_stdout(const char* buf, size_t nbyte); 47 | #endif 48 | 49 | #if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) 50 | static ssize_t 51 | _trace_write_semihosting_debug(const char* buf, size_t nbyte); 52 | #endif 53 | 54 | // ---------------------------------------------------------------------------- 55 | 56 | void 57 | trace_initialize(void) 58 | { 59 | // For regular ITM / semihosting, no inits required. 60 | } 61 | 62 | // ---------------------------------------------------------------------------- 63 | 64 | // This function is called from _write() for fd==1 or fd==2 and from some 65 | // of the trace_* functions. 66 | 67 | ssize_t 68 | trace_write (const char* buf __attribute__((unused)), 69 | size_t nbyte __attribute__((unused))) 70 | { 71 | #if defined(OS_USE_TRACE_ITM) 72 | return _trace_write_itm (buf, nbyte); 73 | #elif defined(OS_USE_TRACE_SEMIHOSTING_STDOUT) 74 | return _trace_write_semihosting_stdout(buf, nbyte); 75 | #elif defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) 76 | return _trace_write_semihosting_debug(buf, nbyte); 77 | #endif 78 | 79 | return -1; 80 | } 81 | 82 | // ---------------------------------------------------------------------------- 83 | 84 | #if defined(OS_USE_TRACE_ITM) 85 | 86 | #if defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 87 | 88 | // ITM is the ARM standard mechanism, running over SWD/SWO on Cortex-M3/M4 89 | // devices, and is the recommended setting, if available. 90 | // 91 | // The JLink probe and the GDB server fully support SWD/SWO 92 | // and the JLink Debugging plug-in enables it by default. 93 | // The current OpenOCD does not include support to parse the SWO stream, 94 | // so this configuration will not work on OpenOCD (will not crash, but 95 | // nothing will be displayed in the output console). 96 | 97 | #if !defined(OS_INTEGER_TRACE_ITM_STIMULUS_PORT) 98 | #define OS_INTEGER_TRACE_ITM_STIMULUS_PORT (0) 99 | #endif 100 | 101 | static ssize_t 102 | _trace_write_itm (const char* buf, size_t nbyte) 103 | { 104 | for (size_t i = 0; i < nbyte; i++) 105 | { 106 | // Check if ITM or the stimulus port are not enabled 107 | if (((ITM->TCR & ITM_TCR_ITMENA_Msk) == 0) 108 | || ((ITM->TER & (1UL << OS_INTEGER_TRACE_ITM_STIMULUS_PORT)) == 0)) 109 | { 110 | return (ssize_t)i; // return the number of sent characters (may be 0) 111 | } 112 | 113 | // Wait until STIMx is ready... 114 | while (ITM->PORT[OS_INTEGER_TRACE_ITM_STIMULUS_PORT].u32 == 0) 115 | ; 116 | // then send data, one byte at a time 117 | ITM->PORT[OS_INTEGER_TRACE_ITM_STIMULUS_PORT].u8 = (uint8_t) (*buf++); 118 | } 119 | 120 | return (ssize_t)nbyte; // all characters successfully sent 121 | } 122 | 123 | #endif // defined(__ARM_ARCH_7M__) || defined(__ARM_ARCH_7EM__) 124 | 125 | #endif // OS_USE_TRACE_ITM 126 | 127 | // ---------------------------------------------------------------------------- 128 | 129 | #if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) || defined(OS_USE_TRACE_SEMIHOSTING_STDOUT) 130 | 131 | #include "arm/semihosting.h" 132 | 133 | // Semihosting is the other output channel that can be used for the trace 134 | // messages. It comes in two flavours: STDOUT and DEBUG. The STDOUT channel 135 | // is the equivalent of the stdout in POSIX and in most cases it is forwarded 136 | // to the GDB server stdout stream. The debug channel is a separate 137 | // channel. STDOUT is buffered, so nothing is displayed until a \n; 138 | // DEBUG is not buffered, but can be slow. 139 | // 140 | // Choosing between semihosting stdout and debug depends on the capabilities 141 | // of your GDB server, and also on specific needs. It is recommended to test 142 | // DEBUG first, and if too slow, try STDOUT. 143 | // 144 | // The JLink GDB server fully support semihosting, and both configurations 145 | // are available; to activate it, use "monitor semihosting enable" or check 146 | // the corresponding button in the JLink Debugging plug-in. 147 | // In OpenOCD, support for semihosting can be enabled using 148 | // "monitor arm semihosting enable". 149 | // 150 | // Note: Applications built with semihosting output active normally cannot 151 | // be executed without the debugger connected and active, since they use 152 | // BKPT to communicate with the host. However, with a carefully written 153 | // HardFault_Handler, the semihosting BKPT calls can be processed, making 154 | // possible to run semihosting applications as standalone, without being 155 | // terminated with hardware faults. 156 | 157 | #endif // OS_USE_TRACE_SEMIHOSTING_DEBUG_* 158 | 159 | // ---------------------------------------------------------------------------- 160 | 161 | #if defined(OS_USE_TRACE_SEMIHOSTING_STDOUT) 162 | 163 | static ssize_t 164 | _trace_write_semihosting_stdout (const char* buf, size_t nbyte) 165 | { 166 | static int handle; 167 | void* block[3]; 168 | int ret; 169 | 170 | if (handle == 0) 171 | { 172 | // On the first call get the file handle from the host 173 | block[0] = ":tt"; // special filename to be used for stdin/out/err 174 | block[1] = (void*) 4; // mode "w" 175 | // length of ":tt", except null terminator 176 | block[2] = (void*) (sizeof(":tt") - 1); 177 | 178 | ret = call_host (SEMIHOSTING_SYS_OPEN, (void*) block); 179 | if (ret == -1) 180 | return -1; 181 | 182 | handle = ret; 183 | } 184 | 185 | block[0] = (void*) handle; 186 | block[1] = (void*) buf; 187 | block[2] = (void*) nbyte; 188 | // send character array to host file/device 189 | ret = call_host (SEMIHOSTING_SYS_WRITE, (void*) block); 190 | // this call returns the number of bytes NOT written (0 if all ok) 191 | 192 | // -1 is not a legal value, but SEGGER seems to return it 193 | if (ret == -1) 194 | return -1; 195 | 196 | // The compliant way of returning errors 197 | if (ret == (int) nbyte) 198 | return -1; 199 | 200 | // Return the number of bytes written 201 | return (ssize_t) (nbyte) - (ssize_t) ret; 202 | } 203 | 204 | #endif // OS_USE_TRACE_SEMIHOSTING_STDOUT 205 | 206 | // ---------------------------------------------------------------------------- 207 | 208 | #if defined(OS_USE_TRACE_SEMIHOSTING_DEBUG) 209 | 210 | #define OS_INTEGER_TRACE_TMP_ARRAY_SIZE (16) 211 | 212 | static ssize_t 213 | _trace_write_semihosting_debug (const char* buf, size_t nbyte) 214 | { 215 | // Since the single character debug channel is quite slow, try to 216 | // optimise and send a null terminated string, if possible. 217 | if (buf[nbyte] == '\0') 218 | { 219 | // send string 220 | call_host (SEMIHOSTING_SYS_WRITE0, (void*) buf); 221 | } 222 | else 223 | { 224 | // If not, use a local buffer to speed things up 225 | char tmp[OS_INTEGER_TRACE_TMP_ARRAY_SIZE]; 226 | size_t togo = nbyte; 227 | while (togo > 0) 228 | { 229 | unsigned int n = ((togo < sizeof(tmp)) ? togo : sizeof(tmp)); 230 | unsigned int i = 0; 231 | for (; i < n; ++i, ++buf) 232 | { 233 | tmp[i] = *buf; 234 | } 235 | tmp[i] = '\0'; 236 | 237 | call_host (SEMIHOSTING_SYS_WRITE0, (void*) tmp); 238 | 239 | togo -= n; 240 | } 241 | } 242 | 243 | // All bytes written 244 | return (ssize_t) nbyte; 245 | } 246 | 247 | #endif // OS_USE_TRACE_SEMIHOSTING_DEBUG 248 | 249 | #endif // TRACE 250 | 251 | // ---------------------------------------------------------------------------- 252 | 253 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/newlib/README.txt: -------------------------------------------------------------------------------- 1 | 2 | The following files extend or replace some of the the newlib functionality: 3 | 4 | _startup.c: a customised startup sequence, written in C 5 | 6 | _exit.c: a customised exit() implementation 7 | 8 | _syscalls.c: local versions of the libnosys/librdimon code 9 | 10 | _sbrk.c: a custom _sbrk() to match the actual linker scripts 11 | 12 | assert.c: implementation for the asserion macros 13 | 14 | _cxx.cpp: local versions of some C++ support, to avoid references to 15 | large functions. 16 | 17 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/newlib/_cxx.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | // These functions are redefined locally, to avoid references to some 9 | // heavy implementations in the standard C++ library. 10 | 11 | // ---------------------------------------------------------------------------- 12 | 13 | #include 14 | #include 15 | #include "diag/Trace.h" 16 | 17 | // ---------------------------------------------------------------------------- 18 | 19 | namespace __gnu_cxx 20 | { 21 | void 22 | __attribute__((noreturn)) 23 | __verbose_terminate_handler(); 24 | 25 | void 26 | __verbose_terminate_handler() 27 | { 28 | trace_puts(__func__); 29 | abort(); 30 | } 31 | } 32 | 33 | // ---------------------------------------------------------------------------- 34 | 35 | extern "C" 36 | { 37 | void 38 | __attribute__((noreturn)) 39 | __cxa_pure_virtual(); 40 | 41 | void 42 | __cxa_pure_virtual() 43 | { 44 | trace_puts(__func__); 45 | abort(); 46 | } 47 | } 48 | 49 | // ---------------------------------------------------------------------------- 50 | 51 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/newlib/_exit.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #include 9 | #include "diag/Trace.h" 10 | 11 | // ---------------------------------------------------------------------------- 12 | 13 | #if !defined(DEBUG) 14 | extern void 15 | __attribute__((noreturn)) 16 | __reset_hardware(void); 17 | #endif 18 | 19 | // ---------------------------------------------------------------------------- 20 | 21 | // Forward declaration 22 | 23 | void 24 | _exit(int code); 25 | 26 | // ---------------------------------------------------------------------------- 27 | 28 | // On Release, call the hardware reset procedure. 29 | // On Debug we just enter an infinite loop, to be used as landmark when halting 30 | // the debugger. 31 | // 32 | // It can be redefined in the application, if more functionality 33 | // is required. 34 | 35 | void 36 | __attribute__((weak)) 37 | _exit(int code __attribute__((unused))) 38 | { 39 | #if !defined(DEBUG) 40 | __reset_hardware(); 41 | #endif 42 | 43 | // TODO: write on trace 44 | while (1) 45 | ; 46 | } 47 | 48 | // ---------------------------------------------------------------------------- 49 | 50 | void 51 | __attribute__((weak,noreturn)) 52 | abort(void) 53 | { 54 | trace_puts("abort(), exiting..."); 55 | 56 | _exit(1); 57 | } 58 | 59 | // ---------------------------------------------------------------------------- 60 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/newlib/_sbrk.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | // ---------------------------------------------------------------------------- 7 | 8 | #include 9 | #include 10 | 11 | // ---------------------------------------------------------------------------- 12 | 13 | caddr_t 14 | _sbrk(int incr); 15 | 16 | // ---------------------------------------------------------------------------- 17 | 18 | // The definitions used here should be kept in sync with the 19 | // stack definitions in the linker script. 20 | 21 | caddr_t 22 | _sbrk(int incr) 23 | { 24 | extern char _Heap_Begin; // Defined by the linker. 25 | extern char _Heap_Limit; // Defined by the linker. 26 | 27 | static char* current_heap_end; 28 | char* current_block_address; 29 | 30 | if (current_heap_end == 0) 31 | { 32 | current_heap_end = &_Heap_Begin; 33 | } 34 | 35 | current_block_address = current_heap_end; 36 | 37 | // Need to align heap to word boundary, else will get 38 | // hard faults on Cortex-M0. So we assume that heap starts on 39 | // word boundary, hence make sure we always add a multiple of 40 | // 4 to it. 41 | incr = (incr + 3) & (~3); // align value to 4 42 | if (current_heap_end + incr > &_Heap_Limit) 43 | { 44 | // Some of the libstdc++-v3 tests rely upon detecting 45 | // out of memory errors, so do not abort here. 46 | #if 0 47 | extern void abort (void); 48 | 49 | _write (1, "_sbrk: Heap and stack collision\n", 32); 50 | 51 | abort (); 52 | #else 53 | // Heap has overflowed 54 | errno = ENOMEM; 55 | return (caddr_t) - 1; 56 | #endif 57 | } 58 | 59 | current_heap_end += incr; 60 | 61 | return (caddr_t) current_block_address; 62 | } 63 | 64 | // ---------------------------------------------------------------------------- 65 | 66 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/newlib/assert.c: -------------------------------------------------------------------------------- 1 | // 2 | // This file is part of the µOS++ III distribution. 3 | // Copyright (c) 2014 Liviu Ionescu. 4 | // 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include "diag/Trace.h" 11 | 12 | // ---------------------------------------------------------------------------- 13 | 14 | void 15 | __attribute__((noreturn)) 16 | __assert_func (const char *file, int line, const char *func, 17 | const char *failedexpr) 18 | { 19 | trace_printf ("assertion \"%s\" failed: file \"%s\", line %d%s%s\n", 20 | failedexpr, file, line, func ? ", function: " : "", 21 | func ? func : ""); 22 | abort (); 23 | /* NOTREACHED */ 24 | } 25 | 26 | // ---------------------------------------------------------------------------- 27 | 28 | // This is STM32 specific, but can be used on other platforms too. 29 | // If you need it, add the following to your application header: 30 | 31 | //#ifdef USE_FULL_ASSERT 32 | //#define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 33 | //void assert_failed(uint8_t* file, uint32_t line); 34 | //#else 35 | //#define assert_param(expr) ((void)0) 36 | //#endif // USE_FULL_ASSERT 37 | 38 | #if defined(USE_FULL_ASSERT) 39 | 40 | void 41 | assert_failed (uint8_t* file, uint32_t line); 42 | 43 | // Called from the assert_param() macro, usually defined in the stm32f*_conf.h 44 | void 45 | __attribute__((noreturn, weak)) 46 | assert_failed (uint8_t* file, uint32_t line) 47 | { 48 | trace_printf ("assert_param() failed: file \"%s\", line %d\n", file, line); 49 | abort (); 50 | /* NOTREACHED */ 51 | } 52 | 53 | #endif // defined(USE_FULL_ASSERT) 54 | 55 | // ---------------------------------------------------------------------------- 56 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/README_STDPERIPH.txt: -------------------------------------------------------------------------------- 1 | These files are from stsw-stm32054.zip, the folder: 2 | 3 | STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/src 4 | 5 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/misc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file misc.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the miscellaneous firmware functions (add-on 8 | * to CMSIS functions). 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Includes ------------------------------------------------------------------*/ 24 | #include "misc.h" 25 | 26 | /** @addtogroup STM32F10x_StdPeriph_Driver 27 | * @{ 28 | */ 29 | 30 | /** @defgroup MISC 31 | * @brief MISC driver modules 32 | * @{ 33 | */ 34 | 35 | /** @defgroup MISC_Private_TypesDefinitions 36 | * @{ 37 | */ 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | /** @defgroup MISC_Private_Defines 44 | * @{ 45 | */ 46 | 47 | #define AIRCR_VECTKEY_MASK ((uint32_t)0x05FA0000) 48 | /** 49 | * @} 50 | */ 51 | 52 | /** @defgroup MISC_Private_Macros 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @defgroup MISC_Private_Variables 61 | * @{ 62 | */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @defgroup MISC_Private_FunctionPrototypes 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @defgroup MISC_Private_Functions 77 | * @{ 78 | */ 79 | 80 | /** 81 | * @brief Configures the priority grouping: pre-emption priority and subpriority. 82 | * @param NVIC_PriorityGroup: specifies the priority grouping bits length. 83 | * This parameter can be one of the following values: 84 | * @arg NVIC_PriorityGroup_0: 0 bits for pre-emption priority 85 | * 4 bits for subpriority 86 | * @arg NVIC_PriorityGroup_1: 1 bits for pre-emption priority 87 | * 3 bits for subpriority 88 | * @arg NVIC_PriorityGroup_2: 2 bits for pre-emption priority 89 | * 2 bits for subpriority 90 | * @arg NVIC_PriorityGroup_3: 3 bits for pre-emption priority 91 | * 1 bits for subpriority 92 | * @arg NVIC_PriorityGroup_4: 4 bits for pre-emption priority 93 | * 0 bits for subpriority 94 | * @retval None 95 | */ 96 | void NVIC_PriorityGroupConfig(uint32_t NVIC_PriorityGroup) 97 | { 98 | /* Check the parameters */ 99 | assert_param(IS_NVIC_PRIORITY_GROUP(NVIC_PriorityGroup)); 100 | 101 | /* Set the PRIGROUP[10:8] bits according to NVIC_PriorityGroup value */ 102 | SCB->AIRCR = AIRCR_VECTKEY_MASK | NVIC_PriorityGroup; 103 | } 104 | 105 | /** 106 | * @brief Initializes the NVIC peripheral according to the specified 107 | * parameters in the NVIC_InitStruct. 108 | * @param NVIC_InitStruct: pointer to a NVIC_InitTypeDef structure that contains 109 | * the configuration information for the specified NVIC peripheral. 110 | * @retval None 111 | */ 112 | void NVIC_Init(NVIC_InitTypeDef* NVIC_InitStruct) 113 | { 114 | uint32_t tmppriority = 0x00, tmppre = 0x00, tmpsub = 0x0F; 115 | 116 | /* Check the parameters */ 117 | assert_param(IS_FUNCTIONAL_STATE(NVIC_InitStruct->NVIC_IRQChannelCmd)); 118 | assert_param(IS_NVIC_PREEMPTION_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority)); 119 | assert_param(IS_NVIC_SUB_PRIORITY(NVIC_InitStruct->NVIC_IRQChannelSubPriority)); 120 | 121 | if (NVIC_InitStruct->NVIC_IRQChannelCmd != DISABLE) 122 | { 123 | /* Compute the Corresponding IRQ Priority --------------------------------*/ 124 | tmppriority = (0x700 - ((SCB->AIRCR) & (uint32_t)0x700))>> 0x08; 125 | tmppre = (0x4 - tmppriority); 126 | tmpsub = tmpsub >> tmppriority; 127 | 128 | tmppriority = (uint32_t)NVIC_InitStruct->NVIC_IRQChannelPreemptionPriority << tmppre; 129 | tmppriority |= NVIC_InitStruct->NVIC_IRQChannelSubPriority & tmpsub; 130 | tmppriority = tmppriority << 0x04; 131 | 132 | // [ILG] 133 | #if defined ( __GNUC__ ) 134 | #pragma GCC diagnostic push 135 | #pragma GCC diagnostic ignored "-Wconversion" 136 | #endif 137 | 138 | NVIC->IP[NVIC_InitStruct->NVIC_IRQChannel] = tmppriority; 139 | 140 | // [ILG] 141 | #if defined ( __GNUC__ ) 142 | #pragma GCC diagnostic pop 143 | #endif 144 | 145 | /* Enable the Selected IRQ Channels --------------------------------------*/ 146 | NVIC->ISER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = 147 | (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); 148 | } 149 | else 150 | { 151 | /* Disable the Selected IRQ Channels -------------------------------------*/ 152 | NVIC->ICER[NVIC_InitStruct->NVIC_IRQChannel >> 0x05] = 153 | (uint32_t)0x01 << (NVIC_InitStruct->NVIC_IRQChannel & (uint8_t)0x1F); 154 | } 155 | } 156 | 157 | /** 158 | * @brief Sets the vector table location and Offset. 159 | * @param NVIC_VectTab: specifies if the vector table is in RAM or FLASH memory. 160 | * This parameter can be one of the following values: 161 | * @arg NVIC_VectTab_RAM 162 | * @arg NVIC_VectTab_FLASH 163 | * @param Offset: Vector Table base offset field. This value must be a multiple 164 | * of 0x200. 165 | * @retval None 166 | */ 167 | void NVIC_SetVectorTable(uint32_t NVIC_VectTab, uint32_t Offset) 168 | { 169 | /* Check the parameters */ 170 | assert_param(IS_NVIC_VECTTAB(NVIC_VectTab)); 171 | assert_param(IS_NVIC_OFFSET(Offset)); 172 | 173 | SCB->VTOR = NVIC_VectTab | (Offset & (uint32_t)0x1FFFFF80); 174 | } 175 | 176 | /** 177 | * @brief Selects the condition for the system to enter low power mode. 178 | * @param LowPowerMode: Specifies the new mode for the system to enter low power mode. 179 | * This parameter can be one of the following values: 180 | * @arg NVIC_LP_SEVONPEND 181 | * @arg NVIC_LP_SLEEPDEEP 182 | * @arg NVIC_LP_SLEEPONEXIT 183 | * @param NewState: new state of LP condition. This parameter can be: ENABLE or DISABLE. 184 | * @retval None 185 | */ 186 | void NVIC_SystemLPConfig(uint8_t LowPowerMode, FunctionalState NewState) 187 | { 188 | /* Check the parameters */ 189 | assert_param(IS_NVIC_LP(LowPowerMode)); 190 | assert_param(IS_FUNCTIONAL_STATE(NewState)); 191 | 192 | if (NewState != DISABLE) 193 | { 194 | SCB->SCR |= LowPowerMode; 195 | } 196 | else 197 | { 198 | SCB->SCR &= (uint32_t)(~(uint32_t)LowPowerMode); 199 | } 200 | } 201 | 202 | /** 203 | * @brief Configures the SysTick clock source. 204 | * @param SysTick_CLKSource: specifies the SysTick clock source. 205 | * This parameter can be one of the following values: 206 | * @arg SysTick_CLKSource_HCLK_Div8: AHB clock divided by 8 selected as SysTick clock source. 207 | * @arg SysTick_CLKSource_HCLK: AHB clock selected as SysTick clock source. 208 | * @retval None 209 | */ 210 | void SysTick_CLKSourceConfig(uint32_t SysTick_CLKSource) 211 | { 212 | /* Check the parameters */ 213 | assert_param(IS_SYSTICK_CLK_SOURCE(SysTick_CLKSource)); 214 | if (SysTick_CLKSource == SysTick_CLKSource_HCLK) 215 | { 216 | SysTick->CTRL |= SysTick_CLKSource_HCLK; 217 | } 218 | else 219 | { 220 | SysTick->CTRL &= SysTick_CLKSource_HCLK_Div8; 221 | } 222 | } 223 | 224 | /** 225 | * @} 226 | */ 227 | 228 | /** 229 | * @} 230 | */ 231 | 232 | /** 233 | * @} 234 | */ 235 | 236 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 237 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/stm32f10x_crc.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the CRC firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_crc.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup CRC 30 | * @brief CRC driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup CRC_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup CRC_Private_Defines 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Private_Macros 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Private_Variables 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Private_FunctionPrototypes 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @defgroup CRC_Private_Functions 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @brief Resets the CRC Data register (DR). 80 | * @param None 81 | * @retval None 82 | */ 83 | void CRC_ResetDR(void) 84 | { 85 | /* Reset CRC generator */ 86 | CRC->CR = CRC_CR_RESET; 87 | } 88 | 89 | /** 90 | * @brief Computes the 32-bit CRC of a given data word(32-bit). 91 | * @param Data: data word(32-bit) to compute its CRC 92 | * @retval 32-bit CRC 93 | */ 94 | uint32_t CRC_CalcCRC(uint32_t Data) 95 | { 96 | CRC->DR = Data; 97 | 98 | return (CRC->DR); 99 | } 100 | 101 | /** 102 | * @brief Computes the 32-bit CRC of a given buffer of data word(32-bit). 103 | * @param pBuffer: pointer to the buffer containing the data to be computed 104 | * @param BufferLength: length of the buffer to be computed 105 | * @retval 32-bit CRC 106 | */ 107 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength) 108 | { 109 | uint32_t index = 0; 110 | 111 | for(index = 0; index < BufferLength; index++) 112 | { 113 | CRC->DR = pBuffer[index]; 114 | } 115 | return (CRC->DR); 116 | } 117 | 118 | /** 119 | * @brief Returns the current CRC value. 120 | * @param None 121 | * @retval 32-bit CRC 122 | */ 123 | uint32_t CRC_GetCRC(void) 124 | { 125 | return (CRC->DR); 126 | } 127 | 128 | /** 129 | * @brief Stores a 8-bit data in the Independent Data(ID) register. 130 | * @param IDValue: 8-bit value to be stored in the ID register 131 | * @retval None 132 | */ 133 | void CRC_SetIDRegister(uint8_t IDValue) 134 | { 135 | CRC->IDR = IDValue; 136 | } 137 | 138 | /** 139 | * @brief Returns the 8-bit data stored in the Independent Data(ID) register 140 | * @param None 141 | * @retval 8-bit value of the ID register 142 | */ 143 | uint8_t CRC_GetIDRegister(void) 144 | { 145 | return (CRC->IDR); 146 | } 147 | 148 | /** 149 | * @} 150 | */ 151 | 152 | /** 153 | * @} 154 | */ 155 | 156 | /** 157 | * @} 158 | */ 159 | 160 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 161 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/stm32f10x_dbgmcu.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_dbgmcu.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the DBGMCU firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_dbgmcu.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup DBGMCU 30 | * @brief DBGMCU driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup DBGMCU_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup DBGMCU_Private_Defines 43 | * @{ 44 | */ 45 | 46 | #define IDCODE_DEVID_MASK ((uint32_t)0x00000FFF) 47 | /** 48 | * @} 49 | */ 50 | 51 | /** @defgroup DBGMCU_Private_Macros 52 | * @{ 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @defgroup DBGMCU_Private_Variables 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @defgroup DBGMCU_Private_FunctionPrototypes 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @defgroup DBGMCU_Private_Functions 76 | * @{ 77 | */ 78 | 79 | /** 80 | * @brief Returns the device revision identifier. 81 | * @param None 82 | * @retval Device revision identifier 83 | */ 84 | uint32_t DBGMCU_GetREVID(void) 85 | { 86 | return(DBGMCU->IDCODE >> 16); 87 | } 88 | 89 | /** 90 | * @brief Returns the device identifier. 91 | * @param None 92 | * @retval Device identifier 93 | */ 94 | uint32_t DBGMCU_GetDEVID(void) 95 | { 96 | return(DBGMCU->IDCODE & IDCODE_DEVID_MASK); 97 | } 98 | 99 | /** 100 | * @brief Configures the specified peripheral and low power mode behavior 101 | * when the MCU under Debug mode. 102 | * @param DBGMCU_Periph: specifies the peripheral and low power mode. 103 | * This parameter can be any combination of the following values: 104 | * @arg DBGMCU_SLEEP: Keep debugger connection during SLEEP mode 105 | * @arg DBGMCU_STOP: Keep debugger connection during STOP mode 106 | * @arg DBGMCU_STANDBY: Keep debugger connection during STANDBY mode 107 | * @arg DBGMCU_IWDG_STOP: Debug IWDG stopped when Core is halted 108 | * @arg DBGMCU_WWDG_STOP: Debug WWDG stopped when Core is halted 109 | * @arg DBGMCU_TIM1_STOP: TIM1 counter stopped when Core is halted 110 | * @arg DBGMCU_TIM2_STOP: TIM2 counter stopped when Core is halted 111 | * @arg DBGMCU_TIM3_STOP: TIM3 counter stopped when Core is halted 112 | * @arg DBGMCU_TIM4_STOP: TIM4 counter stopped when Core is halted 113 | * @arg DBGMCU_CAN1_STOP: Debug CAN2 stopped when Core is halted 114 | * @arg DBGMCU_I2C1_SMBUS_TIMEOUT: I2C1 SMBUS timeout mode stopped when Core is halted 115 | * @arg DBGMCU_I2C2_SMBUS_TIMEOUT: I2C2 SMBUS timeout mode stopped when Core is halted 116 | * @arg DBGMCU_TIM5_STOP: TIM5 counter stopped when Core is halted 117 | * @arg DBGMCU_TIM6_STOP: TIM6 counter stopped when Core is halted 118 | * @arg DBGMCU_TIM7_STOP: TIM7 counter stopped when Core is halted 119 | * @arg DBGMCU_TIM8_STOP: TIM8 counter stopped when Core is halted 120 | * @arg DBGMCU_CAN2_STOP: Debug CAN2 stopped when Core is halted 121 | * @arg DBGMCU_TIM15_STOP: TIM15 counter stopped when Core is halted 122 | * @arg DBGMCU_TIM16_STOP: TIM16 counter stopped when Core is halted 123 | * @arg DBGMCU_TIM17_STOP: TIM17 counter stopped when Core is halted 124 | * @arg DBGMCU_TIM9_STOP: TIM9 counter stopped when Core is halted 125 | * @arg DBGMCU_TIM10_STOP: TIM10 counter stopped when Core is halted 126 | * @arg DBGMCU_TIM11_STOP: TIM11 counter stopped when Core is halted 127 | * @arg DBGMCU_TIM12_STOP: TIM12 counter stopped when Core is halted 128 | * @arg DBGMCU_TIM13_STOP: TIM13 counter stopped when Core is halted 129 | * @arg DBGMCU_TIM14_STOP: TIM14 counter stopped when Core is halted 130 | * @param NewState: new state of the specified peripheral in Debug mode. 131 | * This parameter can be: ENABLE or DISABLE. 132 | * @retval None 133 | */ 134 | void DBGMCU_Config(uint32_t DBGMCU_Periph, FunctionalState NewState) 135 | { 136 | /* Check the parameters */ 137 | assert_param(IS_DBGMCU_PERIPH(DBGMCU_Periph)); 138 | assert_param(IS_FUNCTIONAL_STATE(NewState)); 139 | 140 | if (NewState != DISABLE) 141 | { 142 | DBGMCU->CR |= DBGMCU_Periph; 143 | } 144 | else 145 | { 146 | DBGMCU->CR &= ~DBGMCU_Periph; 147 | } 148 | } 149 | 150 | /** 151 | * @} 152 | */ 153 | 154 | /** 155 | * @} 156 | */ 157 | 158 | /** 159 | * @} 160 | */ 161 | 162 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 163 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/stm32f10x_exti.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_exti.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the EXTI firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_exti.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup EXTI 30 | * @brief EXTI driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup EXTI_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup EXTI_Private_Defines 43 | * @{ 44 | */ 45 | 46 | #define EXTI_LINENONE ((uint32_t)0x00000) /* No interrupt selected */ 47 | 48 | /** 49 | * @} 50 | */ 51 | 52 | /** @defgroup EXTI_Private_Macros 53 | * @{ 54 | */ 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @defgroup EXTI_Private_Variables 61 | * @{ 62 | */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @defgroup EXTI_Private_FunctionPrototypes 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @defgroup EXTI_Private_Functions 77 | * @{ 78 | */ 79 | 80 | /** 81 | * @brief Deinitializes the EXTI peripheral registers to their default reset values. 82 | * @param None 83 | * @retval None 84 | */ 85 | void EXTI_DeInit(void) 86 | { 87 | EXTI->IMR = 0x00000000; 88 | EXTI->EMR = 0x00000000; 89 | EXTI->RTSR = 0x00000000; 90 | EXTI->FTSR = 0x00000000; 91 | EXTI->PR = 0x000FFFFF; 92 | } 93 | 94 | /** 95 | * @brief Initializes the EXTI peripheral according to the specified 96 | * parameters in the EXTI_InitStruct. 97 | * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure 98 | * that contains the configuration information for the EXTI peripheral. 99 | * @retval None 100 | */ 101 | void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct) 102 | { 103 | uint32_t tmp = 0; 104 | 105 | /* Check the parameters */ 106 | assert_param(IS_EXTI_MODE(EXTI_InitStruct->EXTI_Mode)); 107 | assert_param(IS_EXTI_TRIGGER(EXTI_InitStruct->EXTI_Trigger)); 108 | assert_param(IS_EXTI_LINE(EXTI_InitStruct->EXTI_Line)); 109 | assert_param(IS_FUNCTIONAL_STATE(EXTI_InitStruct->EXTI_LineCmd)); 110 | 111 | tmp = (uint32_t)EXTI_BASE; 112 | 113 | if (EXTI_InitStruct->EXTI_LineCmd != DISABLE) 114 | { 115 | /* Clear EXTI line configuration */ 116 | EXTI->IMR &= ~EXTI_InitStruct->EXTI_Line; 117 | EXTI->EMR &= ~EXTI_InitStruct->EXTI_Line; 118 | 119 | tmp += EXTI_InitStruct->EXTI_Mode; 120 | 121 | *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; 122 | 123 | /* Clear Rising Falling edge configuration */ 124 | EXTI->RTSR &= ~EXTI_InitStruct->EXTI_Line; 125 | EXTI->FTSR &= ~EXTI_InitStruct->EXTI_Line; 126 | 127 | /* Select the trigger for the selected external interrupts */ 128 | if (EXTI_InitStruct->EXTI_Trigger == EXTI_Trigger_Rising_Falling) 129 | { 130 | /* Rising Falling edge */ 131 | EXTI->RTSR |= EXTI_InitStruct->EXTI_Line; 132 | EXTI->FTSR |= EXTI_InitStruct->EXTI_Line; 133 | } 134 | else 135 | { 136 | tmp = (uint32_t)EXTI_BASE; 137 | tmp += EXTI_InitStruct->EXTI_Trigger; 138 | 139 | *(__IO uint32_t *) tmp |= EXTI_InitStruct->EXTI_Line; 140 | } 141 | } 142 | else 143 | { 144 | tmp += EXTI_InitStruct->EXTI_Mode; 145 | 146 | /* Disable the selected external lines */ 147 | *(__IO uint32_t *) tmp &= ~EXTI_InitStruct->EXTI_Line; 148 | } 149 | } 150 | 151 | /** 152 | * @brief Fills each EXTI_InitStruct member with its reset value. 153 | * @param EXTI_InitStruct: pointer to a EXTI_InitTypeDef structure which will 154 | * be initialized. 155 | * @retval None 156 | */ 157 | void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct) 158 | { 159 | EXTI_InitStruct->EXTI_Line = EXTI_LINENONE; 160 | EXTI_InitStruct->EXTI_Mode = EXTI_Mode_Interrupt; 161 | EXTI_InitStruct->EXTI_Trigger = EXTI_Trigger_Falling; 162 | EXTI_InitStruct->EXTI_LineCmd = DISABLE; 163 | } 164 | 165 | /** 166 | * @brief Generates a Software interrupt. 167 | * @param EXTI_Line: specifies the EXTI lines to be enabled or disabled. 168 | * This parameter can be any combination of EXTI_Linex where x can be (0..19). 169 | * @retval None 170 | */ 171 | void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line) 172 | { 173 | /* Check the parameters */ 174 | assert_param(IS_EXTI_LINE(EXTI_Line)); 175 | 176 | EXTI->SWIER |= EXTI_Line; 177 | } 178 | 179 | /** 180 | * @brief Checks whether the specified EXTI line flag is set or not. 181 | * @param EXTI_Line: specifies the EXTI line flag to check. 182 | * This parameter can be: 183 | * @arg EXTI_Linex: External interrupt line x where x(0..19) 184 | * @retval The new state of EXTI_Line (SET or RESET). 185 | */ 186 | FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line) 187 | { 188 | FlagStatus bitstatus = RESET; 189 | /* Check the parameters */ 190 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); 191 | 192 | if ((EXTI->PR & EXTI_Line) != (uint32_t)RESET) 193 | { 194 | bitstatus = SET; 195 | } 196 | else 197 | { 198 | bitstatus = RESET; 199 | } 200 | return bitstatus; 201 | } 202 | 203 | /** 204 | * @brief Clears the EXTI's line pending flags. 205 | * @param EXTI_Line: specifies the EXTI lines flags to clear. 206 | * This parameter can be any combination of EXTI_Linex where x can be (0..19). 207 | * @retval None 208 | */ 209 | void EXTI_ClearFlag(uint32_t EXTI_Line) 210 | { 211 | /* Check the parameters */ 212 | assert_param(IS_EXTI_LINE(EXTI_Line)); 213 | 214 | EXTI->PR = EXTI_Line; 215 | } 216 | 217 | /** 218 | * @brief Checks whether the specified EXTI line is asserted or not. 219 | * @param EXTI_Line: specifies the EXTI line to check. 220 | * This parameter can be: 221 | * @arg EXTI_Linex: External interrupt line x where x(0..19) 222 | * @retval The new state of EXTI_Line (SET or RESET). 223 | */ 224 | ITStatus EXTI_GetITStatus(uint32_t EXTI_Line) 225 | { 226 | ITStatus bitstatus = RESET; 227 | uint32_t enablestatus = 0; 228 | /* Check the parameters */ 229 | assert_param(IS_GET_EXTI_LINE(EXTI_Line)); 230 | 231 | enablestatus = EXTI->IMR & EXTI_Line; 232 | if (((EXTI->PR & EXTI_Line) != (uint32_t)RESET) && (enablestatus != (uint32_t)RESET)) 233 | { 234 | bitstatus = SET; 235 | } 236 | else 237 | { 238 | bitstatus = RESET; 239 | } 240 | return bitstatus; 241 | } 242 | 243 | /** 244 | * @brief Clears the EXTI's line pending bits. 245 | * @param EXTI_Line: specifies the EXTI lines to clear. 246 | * This parameter can be any combination of EXTI_Linex where x can be (0..19). 247 | * @retval None 248 | */ 249 | void EXTI_ClearITPendingBit(uint32_t EXTI_Line) 250 | { 251 | /* Check the parameters */ 252 | assert_param(IS_EXTI_LINE(EXTI_Line)); 253 | 254 | EXTI->PR = EXTI_Line; 255 | } 256 | 257 | /** 258 | * @} 259 | */ 260 | 261 | /** 262 | * @} 263 | */ 264 | 265 | /** 266 | * @} 267 | */ 268 | 269 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 270 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/stm32f10x_iwdg.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_iwdg.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the IWDG firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_iwdg.h" 24 | 25 | /** @addtogroup STM32F10x_StdPeriph_Driver 26 | * @{ 27 | */ 28 | 29 | /** @defgroup IWDG 30 | * @brief IWDG driver modules 31 | * @{ 32 | */ 33 | 34 | /** @defgroup IWDG_Private_TypesDefinitions 35 | * @{ 36 | */ 37 | 38 | /** 39 | * @} 40 | */ 41 | 42 | /** @defgroup IWDG_Private_Defines 43 | * @{ 44 | */ 45 | 46 | /* ---------------------- IWDG registers bit mask ----------------------------*/ 47 | 48 | /* KR register bit mask */ 49 | #define KR_KEY_Reload ((uint16_t)0xAAAA) 50 | #define KR_KEY_Enable ((uint16_t)0xCCCC) 51 | 52 | /** 53 | * @} 54 | */ 55 | 56 | /** @defgroup IWDG_Private_Macros 57 | * @{ 58 | */ 59 | 60 | /** 61 | * @} 62 | */ 63 | 64 | /** @defgroup IWDG_Private_Variables 65 | * @{ 66 | */ 67 | 68 | /** 69 | * @} 70 | */ 71 | 72 | /** @defgroup IWDG_Private_FunctionPrototypes 73 | * @{ 74 | */ 75 | 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup IWDG_Private_Functions 81 | * @{ 82 | */ 83 | 84 | /** 85 | * @brief Enables or disables write access to IWDG_PR and IWDG_RLR registers. 86 | * @param IWDG_WriteAccess: new state of write access to IWDG_PR and IWDG_RLR registers. 87 | * This parameter can be one of the following values: 88 | * @arg IWDG_WriteAccess_Enable: Enable write access to IWDG_PR and IWDG_RLR registers 89 | * @arg IWDG_WriteAccess_Disable: Disable write access to IWDG_PR and IWDG_RLR registers 90 | * @retval None 91 | */ 92 | void IWDG_WriteAccessCmd(uint16_t IWDG_WriteAccess) 93 | { 94 | /* Check the parameters */ 95 | assert_param(IS_IWDG_WRITE_ACCESS(IWDG_WriteAccess)); 96 | IWDG->KR = IWDG_WriteAccess; 97 | } 98 | 99 | /** 100 | * @brief Sets IWDG Prescaler value. 101 | * @param IWDG_Prescaler: specifies the IWDG Prescaler value. 102 | * This parameter can be one of the following values: 103 | * @arg IWDG_Prescaler_4: IWDG prescaler set to 4 104 | * @arg IWDG_Prescaler_8: IWDG prescaler set to 8 105 | * @arg IWDG_Prescaler_16: IWDG prescaler set to 16 106 | * @arg IWDG_Prescaler_32: IWDG prescaler set to 32 107 | * @arg IWDG_Prescaler_64: IWDG prescaler set to 64 108 | * @arg IWDG_Prescaler_128: IWDG prescaler set to 128 109 | * @arg IWDG_Prescaler_256: IWDG prescaler set to 256 110 | * @retval None 111 | */ 112 | void IWDG_SetPrescaler(uint8_t IWDG_Prescaler) 113 | { 114 | /* Check the parameters */ 115 | assert_param(IS_IWDG_PRESCALER(IWDG_Prescaler)); 116 | IWDG->PR = IWDG_Prescaler; 117 | } 118 | 119 | /** 120 | * @brief Sets IWDG Reload value. 121 | * @param Reload: specifies the IWDG Reload value. 122 | * This parameter must be a number between 0 and 0x0FFF. 123 | * @retval None 124 | */ 125 | void IWDG_SetReload(uint16_t Reload) 126 | { 127 | /* Check the parameters */ 128 | assert_param(IS_IWDG_RELOAD(Reload)); 129 | IWDG->RLR = Reload; 130 | } 131 | 132 | /** 133 | * @brief Reloads IWDG counter with value defined in the reload register 134 | * (write access to IWDG_PR and IWDG_RLR registers disabled). 135 | * @param None 136 | * @retval None 137 | */ 138 | void IWDG_ReloadCounter(void) 139 | { 140 | IWDG->KR = KR_KEY_Reload; 141 | } 142 | 143 | /** 144 | * @brief Enables IWDG (write access to IWDG_PR and IWDG_RLR registers disabled). 145 | * @param None 146 | * @retval None 147 | */ 148 | void IWDG_Enable(void) 149 | { 150 | IWDG->KR = KR_KEY_Enable; 151 | } 152 | 153 | /** 154 | * @brief Checks whether the specified IWDG flag is set or not. 155 | * @param IWDG_FLAG: specifies the flag to check. 156 | * This parameter can be one of the following values: 157 | * @arg IWDG_FLAG_PVU: Prescaler Value Update on going 158 | * @arg IWDG_FLAG_RVU: Reload Value Update on going 159 | * @retval The new state of IWDG_FLAG (SET or RESET). 160 | */ 161 | FlagStatus IWDG_GetFlagStatus(uint16_t IWDG_FLAG) 162 | { 163 | FlagStatus bitstatus = RESET; 164 | /* Check the parameters */ 165 | assert_param(IS_IWDG_FLAG(IWDG_FLAG)); 166 | if ((IWDG->SR & IWDG_FLAG) != (uint32_t)RESET) 167 | { 168 | bitstatus = SET; 169 | } 170 | else 171 | { 172 | bitstatus = RESET; 173 | } 174 | /* Return the flag status */ 175 | return bitstatus; 176 | } 177 | 178 | /** 179 | * @} 180 | */ 181 | 182 | /** 183 | * @} 184 | */ 185 | 186 | /** 187 | * @} 188 | */ 189 | 190 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 191 | -------------------------------------------------------------------------------- /stm32F103_blinky_serial/system/src/stm32f1-stdperiph/stm32f10x_wwdg.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_wwdg.c 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file provides all the WWDG firmware functions. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /* Includes ------------------------------------------------------------------*/ 23 | #include "stm32f10x_wwdg.h" 24 | #include "stm32f10x_rcc.h" 25 | 26 | /** @addtogroup STM32F10x_StdPeriph_Driver 27 | * @{ 28 | */ 29 | 30 | /** @defgroup WWDG 31 | * @brief WWDG driver modules 32 | * @{ 33 | */ 34 | 35 | /** @defgroup WWDG_Private_TypesDefinitions 36 | * @{ 37 | */ 38 | 39 | /** 40 | * @} 41 | */ 42 | 43 | /** @defgroup WWDG_Private_Defines 44 | * @{ 45 | */ 46 | 47 | /* ----------- WWDG registers bit address in the alias region ----------- */ 48 | #define WWDG_OFFSET (WWDG_BASE - PERIPH_BASE) 49 | 50 | /* Alias word address of EWI bit */ 51 | #define CFR_OFFSET (WWDG_OFFSET + 0x04) 52 | #define EWI_BitNumber 0x09 53 | #define CFR_EWI_BB (PERIPH_BB_BASE + (CFR_OFFSET * 32) + (EWI_BitNumber * 4)) 54 | 55 | /* --------------------- WWDG registers bit mask ------------------------ */ 56 | 57 | /* CR register bit mask */ 58 | #define CR_WDGA_Set ((uint32_t)0x00000080) 59 | 60 | /* CFR register bit mask */ 61 | #define CFR_WDGTB_Mask ((uint32_t)0xFFFFFE7F) 62 | #define CFR_W_Mask ((uint32_t)0xFFFFFF80) 63 | #define BIT_Mask ((uint8_t)0x7F) 64 | 65 | /** 66 | * @} 67 | */ 68 | 69 | /** @defgroup WWDG_Private_Macros 70 | * @{ 71 | */ 72 | 73 | /** 74 | * @} 75 | */ 76 | 77 | /** @defgroup WWDG_Private_Variables 78 | * @{ 79 | */ 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | /** @defgroup WWDG_Private_FunctionPrototypes 86 | * @{ 87 | */ 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | /** @defgroup WWDG_Private_Functions 94 | * @{ 95 | */ 96 | 97 | /** 98 | * @brief Deinitializes the WWDG peripheral registers to their default reset values. 99 | * @param None 100 | * @retval None 101 | */ 102 | void WWDG_DeInit(void) 103 | { 104 | RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, ENABLE); 105 | RCC_APB1PeriphResetCmd(RCC_APB1Periph_WWDG, DISABLE); 106 | } 107 | 108 | /** 109 | * @brief Sets the WWDG Prescaler. 110 | * @param WWDG_Prescaler: specifies the WWDG Prescaler. 111 | * This parameter can be one of the following values: 112 | * @arg WWDG_Prescaler_1: WWDG counter clock = (PCLK1/4096)/1 113 | * @arg WWDG_Prescaler_2: WWDG counter clock = (PCLK1/4096)/2 114 | * @arg WWDG_Prescaler_4: WWDG counter clock = (PCLK1/4096)/4 115 | * @arg WWDG_Prescaler_8: WWDG counter clock = (PCLK1/4096)/8 116 | * @retval None 117 | */ 118 | void WWDG_SetPrescaler(uint32_t WWDG_Prescaler) 119 | { 120 | uint32_t tmpreg = 0; 121 | /* Check the parameters */ 122 | assert_param(IS_WWDG_PRESCALER(WWDG_Prescaler)); 123 | /* Clear WDGTB[1:0] bits */ 124 | tmpreg = WWDG->CFR & CFR_WDGTB_Mask; 125 | /* Set WDGTB[1:0] bits according to WWDG_Prescaler value */ 126 | tmpreg |= WWDG_Prescaler; 127 | /* Store the new value */ 128 | WWDG->CFR = tmpreg; 129 | } 130 | 131 | /** 132 | * @brief Sets the WWDG window value. 133 | * @param WindowValue: specifies the window value to be compared to the downcounter. 134 | * This parameter value must be lower than 0x80. 135 | * @retval None 136 | */ 137 | void WWDG_SetWindowValue(uint8_t WindowValue) 138 | { 139 | __IO uint32_t tmpreg = 0; 140 | 141 | /* Check the parameters */ 142 | assert_param(IS_WWDG_WINDOW_VALUE(WindowValue)); 143 | /* Clear W[6:0] bits */ 144 | 145 | tmpreg = WWDG->CFR & CFR_W_Mask; 146 | 147 | /* Set W[6:0] bits according to WindowValue value */ 148 | tmpreg |= WindowValue & (uint32_t) BIT_Mask; 149 | 150 | /* Store the new value */ 151 | WWDG->CFR = tmpreg; 152 | } 153 | 154 | /** 155 | * @brief Enables the WWDG Early Wakeup interrupt(EWI). 156 | * @param None 157 | * @retval None 158 | */ 159 | void WWDG_EnableIT(void) 160 | { 161 | *(__IO uint32_t *) CFR_EWI_BB = (uint32_t)ENABLE; 162 | } 163 | 164 | /** 165 | * @brief Sets the WWDG counter value. 166 | * @param Counter: specifies the watchdog counter value. 167 | * This parameter must be a number between 0x40 and 0x7F. 168 | * @retval None 169 | */ 170 | void WWDG_SetCounter(uint8_t Counter) 171 | { 172 | /* Check the parameters */ 173 | assert_param(IS_WWDG_COUNTER(Counter)); 174 | /* Write to T[6:0] bits to configure the counter value, no need to do 175 | a read-modify-write; writing a 0 to WDGA bit does nothing */ 176 | WWDG->CR = Counter & BIT_Mask; 177 | } 178 | 179 | /** 180 | * @brief Enables WWDG and load the counter value. 181 | * @param Counter: specifies the watchdog counter value. 182 | * This parameter must be a number between 0x40 and 0x7F. 183 | * @retval None 184 | */ 185 | void WWDG_Enable(uint8_t Counter) 186 | { 187 | /* Check the parameters */ 188 | assert_param(IS_WWDG_COUNTER(Counter)); 189 | WWDG->CR = CR_WDGA_Set | Counter; 190 | } 191 | 192 | /** 193 | * @brief Checks whether the Early Wakeup interrupt flag is set or not. 194 | * @param None 195 | * @retval The new state of the Early Wakeup interrupt flag (SET or RESET) 196 | */ 197 | FlagStatus WWDG_GetFlagStatus(void) 198 | { 199 | return (FlagStatus)(WWDG->SR); 200 | } 201 | 202 | /** 203 | * @brief Clears Early Wakeup interrupt flag. 204 | * @param None 205 | * @retval None 206 | */ 207 | void WWDG_ClearFlag(void) 208 | { 209 | WWDG->SR = (uint32_t)RESET; 210 | } 211 | 212 | /** 213 | * @} 214 | */ 215 | 216 | /** 217 | * @} 218 | */ 219 | 220 | /** 221 | * @} 222 | */ 223 | 224 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 225 | --------------------------------------------------------------------------------