├── .gitignore
├── .mxproject
├── ATFramework.ioc
├── Drivers
├── CMSIS
│ ├── Device
│ │ └── ST
│ │ │ └── STM32F1xx
│ │ │ └── Include
│ │ │ ├── stm32f103xe.h
│ │ │ ├── stm32f1xx.h
│ │ │ └── system_stm32f1xx.h
│ └── Include
│ │ ├── arm_common_tables.h
│ │ ├── arm_const_structs.h
│ │ ├── arm_math.h
│ │ ├── cmsis_armcc.h
│ │ ├── cmsis_armcc_V6.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
└── STM32F1xx_HAL_Driver
│ ├── Inc
│ ├── Legacy
│ │ └── stm32_hal_legacy.h
│ ├── stm32f1xx_hal.h
│ ├── stm32f1xx_hal_cortex.h
│ ├── stm32f1xx_hal_def.h
│ ├── stm32f1xx_hal_dma.h
│ ├── stm32f1xx_hal_dma_ex.h
│ ├── stm32f1xx_hal_flash.h
│ ├── stm32f1xx_hal_flash_ex.h
│ ├── stm32f1xx_hal_gpio.h
│ ├── stm32f1xx_hal_gpio_ex.h
│ ├── stm32f1xx_hal_pwr.h
│ ├── stm32f1xx_hal_rcc.h
│ ├── stm32f1xx_hal_rcc_ex.h
│ ├── stm32f1xx_hal_tim.h
│ ├── stm32f1xx_hal_tim_ex.h
│ └── stm32f1xx_hal_uart.h
│ └── Src
│ ├── stm32f1xx_hal.c
│ ├── stm32f1xx_hal_cortex.c
│ ├── stm32f1xx_hal_dma.c
│ ├── stm32f1xx_hal_flash.c
│ ├── stm32f1xx_hal_flash_ex.c
│ ├── stm32f1xx_hal_gpio.c
│ ├── stm32f1xx_hal_gpio_ex.c
│ ├── stm32f1xx_hal_pwr.c
│ ├── stm32f1xx_hal_rcc.c
│ ├── stm32f1xx_hal_rcc_ex.c
│ ├── stm32f1xx_hal_tim.c
│ ├── stm32f1xx_hal_tim_ex.c
│ └── stm32f1xx_hal_uart.c
├── Inc
├── FreeRTOSConfig.h
├── dma.h
├── gpio.h
├── main.h
├── stm32f1xx_hal_conf.h
├── stm32f1xx_it.h
└── usart.h
├── MDK-ARM
├── ATFramework.uvguix.Hobson
├── ATFramework.uvoptx
├── ATFramework.uvprojx
├── ATFramework
│ └── ExtDll.iex
├── DebugConfig
│ └── ATFramework_STM32F103ZE_1.0.0.dbgconf
├── EventRecorderStub.scvd
├── JLinkLog.txt
├── JLinkSettings.ini
├── RTE
│ └── _ATFramework
│ │ └── RTE_Components.h
├── cmb_fault.lst
├── startup_stm32f103xe.lst
└── startup_stm32f103xe.s
├── Middlewares
└── Third_Party
│ └── FreeRTOS
│ └── Source
│ ├── CMSIS_RTOS
│ ├── cmsis_os.c
│ └── cmsis_os.h
│ ├── croutine.c
│ ├── event_groups.c
│ ├── include
│ ├── FreeRTOS.h
│ ├── StackMacros.h
│ ├── croutine.h
│ ├── deprecated_definitions.h
│ ├── event_groups.h
│ ├── list.h
│ ├── mpu_prototypes.h
│ ├── mpu_wrappers.h
│ ├── portable.h
│ ├── projdefs.h
│ ├── queue.h
│ ├── semphr.h
│ ├── task.h
│ └── timers.h
│ ├── list.c
│ ├── portable
│ ├── MemMang
│ │ └── heap_4.c
│ └── RVDS
│ │ └── ARM_CM3
│ │ ├── port.c
│ │ └── portmacro.h
│ ├── queue.c
│ ├── tasks.c
│ └── timers.c
├── Src
├── dma.c
├── freertos.c
├── gpio.c
├── main.c
├── stm32f1xx_hal_msp.c
├── stm32f1xx_hal_timebase_tim.c
├── stm32f1xx_it.c
├── system_stm32f1xx.c
└── usart.c
├── User
├── AT.c
├── AT.h
├── ATCommand.c
├── ATCommand.h
├── ATtype.h
├── Hardware.c
├── Hardware.h
├── LOG
│ ├── cm_backtrace.c
│ ├── cm_backtrace.h
│ ├── cmb_cfg.h
│ ├── cmb_def.h
│ ├── cmb_fault.S
│ └── fault_test.c
├── log.c
├── log.h
├── socket.c
└── socket.h
└── readme.md
/.gitignore:
--------------------------------------------------------------------------------
1 | #压缩包
2 | *.pdf
3 | *.zip
4 | *.rar
5 | *.7z
6 |
7 | #编译文件
8 | *.d
9 | *.o
10 | *.axf
11 | *.htm
12 | *.html
13 | *.dep
14 | *.hex
15 | *.lnp
16 | *.map
17 | *.sct
18 | *.crf
19 |
20 | **/Listings
21 | **/Objects
22 | */USART
23 |
24 |
--------------------------------------------------------------------------------
/.mxproject:
--------------------------------------------------------------------------------
1 | [PreviousGenFiles]
2 | HeaderPath=E:/Documents/STM32/Socket/ATFramework/Inc
3 | HeaderFiles=gpio.h;dma.h;FreeRTOSConfig.h;usart.h;stm32f1xx_it.h;stm32f1xx_hal_conf.h;main.h;
4 | SourcePath=E:/Documents/STM32/Socket/ATFramework/Src
5 | SourceFiles=gpio.c;dma.c;freertos.c;usart.c;stm32f1xx_it.c;stm32f1xx_hal_msp.c;stm32f1xx_hal_timebase_tim.c;main.c;
6 |
7 | [PreviousLibFiles]
8 | LibFiles=Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;Middlewares/Third_Party/FreeRTOS/Source/croutine.c;Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;Middlewares/Third_Party/FreeRTOS/Source/list.c;Middlewares/Third_Party/FreeRTOS/Source/queue.c;Middlewares/Third_Party/FreeRTOS/Source/tasks.c;Middlewares/Third_Party/FreeRTOS/Source/timers.c;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_uart.h;Drivers/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h;Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h;Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h;Middlewares/Third_Party/FreeRTOS/Source/include/croutine.h;Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h;Middlewares/Third_Party/FreeRTOS/Source/include/event_groups.h;Middlewares/Third_Party/FreeRTOS/Source/include/FreeRTOS.h;Middlewares/Third_Party/FreeRTOS/Source/include/list.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_prototypes.h;Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h;Middlewares/Third_Party/FreeRTOS/Source/include/portable.h;Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h;Middlewares/Third_Party/FreeRTOS/Source/include/queue.h;Middlewares/Third_Party/FreeRTOS/Source/include/semphr.h;Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h;Middlewares/Third_Party/FreeRTOS/Source/include/task.h;Middlewares/Third_Party/FreeRTOS/Source/include/timers.h;Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h;Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h;Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;Drivers/CMSIS/Include/arm_common_tables.h;Drivers/CMSIS/Include/arm_const_structs.h;Drivers/CMSIS/Include/arm_math.h;Drivers/CMSIS/Include/cmsis_armcc.h;Drivers/CMSIS/Include/cmsis_armcc_V6.h;Drivers/CMSIS/Include/cmsis_gcc.h;Drivers/CMSIS/Include/core_cm0.h;Drivers/CMSIS/Include/core_cm0plus.h;Drivers/CMSIS/Include/core_cm3.h;Drivers/CMSIS/Include/core_cm4.h;Drivers/CMSIS/Include/core_cm7.h;Drivers/CMSIS/Include/core_cmFunc.h;Drivers/CMSIS/Include/core_cmInstr.h;Drivers/CMSIS/Include/core_cmSimd.h;Drivers/CMSIS/Include/core_sc000.h;Drivers/CMSIS/Include/core_sc300.h;
9 |
10 | [PreviousUsedKeilFiles]
11 | SourceFiles=..\Src\main.c;..\Src\gpio.c;..\Src\dma.c;..\Src\freertos.c;..\Src\usart.c;..\Src\stm32f1xx_it.c;..\Src\stm32f1xx_hal_msp.c;..\Src\stm32f1xx_hal_timebase_tim.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../\Src/system_stm32f1xx.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c;../Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c;../\Src/system_stm32f1xx.c;../Drivers/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.c;null;../Middlewares/Third_Party/FreeRTOS/Source/croutine.c;../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c;../Middlewares/Third_Party/FreeRTOS/Source/list.c;../Middlewares/Third_Party/FreeRTOS/Source/queue.c;../Middlewares/Third_Party/FreeRTOS/Source/tasks.c;../Middlewares/Third_Party/FreeRTOS/Source/timers.c;../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c;../Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c;
12 | HeaderPath=..\Drivers\STM32F1xx_HAL_Driver\Inc;..\Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;..\Middlewares\Third_Party\FreeRTOS\Source\include;..\Middlewares\Third_Party\FreeRTOS\Source\CMSIS_RTOS;..\Middlewares\Third_Party\FreeRTOS\Source\portable\RVDS\ARM_CM3;..\Drivers\CMSIS\Device\ST\STM32F1xx\Include;..\Drivers\CMSIS\Include;..\Inc;
13 | CDefines=USE_HAL_DRIVER;STM32F103xE;USE_HAL_DRIVER;STM32F103xE;
14 |
15 |
--------------------------------------------------------------------------------
/ATFramework.ioc:
--------------------------------------------------------------------------------
1 | #MicroXplorer Configuration settings - do not modify
2 | Dma.Request0=USART2_RX
3 | Dma.RequestsNb=1
4 | Dma.USART2_RX.0.Direction=DMA_PERIPH_TO_MEMORY
5 | Dma.USART2_RX.0.Instance=DMA1_Channel6
6 | Dma.USART2_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE
7 | Dma.USART2_RX.0.MemInc=DMA_MINC_ENABLE
8 | Dma.USART2_RX.0.Mode=DMA_NORMAL
9 | Dma.USART2_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
10 | Dma.USART2_RX.0.PeriphInc=DMA_PINC_DISABLE
11 | Dma.USART2_RX.0.Priority=DMA_PRIORITY_LOW
12 | Dma.USART2_RX.0.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
13 | FREERTOS.FootprintOK=true
14 | FREERTOS.IPParameters=Tasks01,FootprintOK
15 | FREERTOS.Tasks01=defaultTask,0,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL;LedTask,-2,128,LEDStartTask,Default,NULL,Dynamic,NULL,NULL;ATTask,0,128,ATStartTask,Default,NULL,Dynamic,NULL,NULL
16 | File.Version=6
17 | KeepUserPlacement=false
18 | Mcu.Family=STM32F1
19 | Mcu.IP0=DMA
20 | Mcu.IP1=FREERTOS
21 | Mcu.IP2=NVIC
22 | Mcu.IP3=RCC
23 | Mcu.IP4=SYS
24 | Mcu.IP5=USART1
25 | Mcu.IP6=USART2
26 | Mcu.IPNb=7
27 | Mcu.Name=STM32F103Z(C-D-E)Tx
28 | Mcu.Package=LQFP144
29 | Mcu.Pin0=PE5
30 | Mcu.Pin1=OSC_IN
31 | Mcu.Pin10=VP_FREERTOS_VS_CMSIS_V1
32 | Mcu.Pin11=VP_SYS_VS_tim2
33 | Mcu.Pin2=OSC_OUT
34 | Mcu.Pin3=PA2
35 | Mcu.Pin4=PA3
36 | Mcu.Pin5=PA9
37 | Mcu.Pin6=PA10
38 | Mcu.Pin7=PA13
39 | Mcu.Pin8=PA14
40 | Mcu.Pin9=PB5
41 | Mcu.PinsNb=12
42 | Mcu.ThirdPartyNb=0
43 | Mcu.UserConstants=
44 | Mcu.UserName=STM32F103ZETx
45 | MxCube.Version=5.2.1
46 | MxDb.Version=DB.5.0.21
47 | NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
48 | NVIC.DMA1_Channel6_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true
49 | NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
50 | NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
51 | NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
52 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
53 | NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:false
54 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
55 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:false\:false
56 | NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:false\:true\:false\:true
57 | NVIC.TIM2_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:true
58 | NVIC.TimeBase=TIM2_IRQn
59 | NVIC.TimeBaseIP=TIM2
60 | NVIC.USART2_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true
61 | NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
62 | OSC_IN.Mode=HSE-External-Oscillator
63 | OSC_IN.Signal=RCC_OSC_IN
64 | OSC_OUT.Mode=HSE-External-Oscillator
65 | OSC_OUT.Signal=RCC_OSC_OUT
66 | PA10.Mode=Asynchronous
67 | PA10.Signal=USART1_RX
68 | PA13.Mode=Serial_Wire
69 | PA13.Signal=SYS_JTMS-SWDIO
70 | PA14.Mode=Serial_Wire
71 | PA14.Signal=SYS_JTCK-SWCLK
72 | PA2.Mode=Asynchronous
73 | PA2.Signal=USART2_TX
74 | PA3.Mode=Asynchronous
75 | PA3.Signal=USART2_RX
76 | PA9.Mode=Asynchronous
77 | PA9.Signal=USART1_TX
78 | PB5.Locked=true
79 | PB5.Signal=GPIO_Output
80 | PCC.Checker=false
81 | PCC.Line=STM32F103
82 | PCC.MCU=STM32F103Z(C-D-E)Tx
83 | PCC.PartNumber=STM32F103ZETx
84 | PCC.Seq0=0
85 | PCC.Series=STM32F1
86 | PCC.Temperature=25
87 | PCC.Vdd=3.3
88 | PE5.Locked=true
89 | PE5.Signal=GPIO_Output
90 | PinOutPanel.RotationAngle=0
91 | ProjectManager.AskForMigrate=true
92 | ProjectManager.BackupPrevious=false
93 | ProjectManager.CompilerOptimize=6
94 | ProjectManager.ComputerToolchain=false
95 | ProjectManager.CoupleFile=true
96 | ProjectManager.CustomerFirmwarePackage=
97 | ProjectManager.DefaultFWLocation=true
98 | ProjectManager.DeletePrevious=true
99 | ProjectManager.DeviceId=STM32F103ZETx
100 | ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.7.0
101 | ProjectManager.FreePins=false
102 | ProjectManager.HalAssertFull=false
103 | ProjectManager.HeapSize=0x1000
104 | ProjectManager.KeepUserCode=true
105 | ProjectManager.LastFirmware=true
106 | ProjectManager.LibraryCopy=1
107 | ProjectManager.MainLocation=Src
108 | ProjectManager.NoMain=false
109 | ProjectManager.PreviousToolchain=
110 | ProjectManager.ProjectBuild=false
111 | ProjectManager.ProjectFileName=ATFramework.ioc
112 | ProjectManager.ProjectName=ATFramework
113 | ProjectManager.StackSize=0x1000
114 | ProjectManager.TargetToolchain=MDK-ARM V5
115 | ProjectManager.ToolChainLocation=
116 | ProjectManager.UnderRoot=false
117 | ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_USART1_UART_Init-USART1-false-HAL-true,5-MX_USART2_UART_Init-USART2-false-HAL-true
118 | RCC.ADCFreqValue=36000000
119 | RCC.AHBFreq_Value=72000000
120 | RCC.APB1CLKDivider=RCC_HCLK_DIV2
121 | RCC.APB1Freq_Value=36000000
122 | RCC.APB1TimFreq_Value=72000000
123 | RCC.APB2Freq_Value=72000000
124 | RCC.APB2TimFreq_Value=72000000
125 | RCC.FCLKCortexFreq_Value=72000000
126 | RCC.FSMCFreq_Value=72000000
127 | RCC.FamilyName=M
128 | RCC.HCLKFreq_Value=72000000
129 | RCC.I2S2Freq_Value=72000000
130 | RCC.I2S3Freq_Value=72000000
131 | RCC.IPParameters=ADCFreqValue,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FSMCFreq_Value,FamilyName,HCLKFreq_Value,I2S2Freq_Value,I2S3Freq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,SDIOFreq_Value,SDIOHCLKDiv2FreqValue,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value
132 | RCC.MCOFreq_Value=72000000
133 | RCC.PLLCLKFreq_Value=72000000
134 | RCC.PLLMCOFreq_Value=36000000
135 | RCC.PLLMUL=RCC_PLL_MUL9
136 | RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
137 | RCC.SDIOFreq_Value=72000000
138 | RCC.SDIOHCLKDiv2FreqValue=36000000
139 | RCC.SYSCLKFreq_VALUE=72000000
140 | RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
141 | RCC.TimSysFreq_Value=72000000
142 | RCC.USBFreq_Value=72000000
143 | RCC.VCOOutput2Freq_Value=8000000
144 | USART1.IPParameters=VirtualMode
145 | USART1.VirtualMode=VM_ASYNC
146 | USART2.BaudRate=9600
147 | USART2.IPParameters=VirtualMode,BaudRate
148 | USART2.VirtualMode=VM_ASYNC
149 | VP_FREERTOS_VS_CMSIS_V1.Mode=CMSIS_V1
150 | VP_FREERTOS_VS_CMSIS_V1.Signal=FREERTOS_VS_CMSIS_V1
151 | VP_SYS_VS_tim2.Mode=TIM2
152 | VP_SYS_VS_tim2.Signal=SYS_VS_tim2
153 | board=custom
154 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xe.h
--------------------------------------------------------------------------------
/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/Drivers/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h
--------------------------------------------------------------------------------
/Drivers/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file system_stm32f10x.h
4 | * @author MCD Application Team
5 | * @version V4.2.0
6 | * @date 31-March-2017
7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
8 | ******************************************************************************
9 | * @attention
10 | *
11 | *
© COPYRIGHT(c) 2017 STMicroelectronics
12 | *
13 | * Redistribution and use in source and binary forms, with or without modification,
14 | * are permitted provided that the following conditions are met:
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | * 2. Redistributions in binary form must reproduce the above copyright notice,
18 | * this list of conditions and the following disclaimer in the documentation
19 | * and/or other materials provided with the distribution.
20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 | * may be used to endorse or promote products derived from this software
22 | * without specific prior written permission.
23 | *
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 | *
35 | ******************************************************************************
36 | */
37 |
38 | /** @addtogroup CMSIS
39 | * @{
40 | */
41 |
42 | /** @addtogroup stm32f10x_system
43 | * @{
44 | */
45 |
46 | /**
47 | * @brief Define to prevent recursive inclusion
48 | */
49 | #ifndef __SYSTEM_STM32F10X_H
50 | #define __SYSTEM_STM32F10X_H
51 |
52 | #ifdef __cplusplus
53 | extern "C" {
54 | #endif
55 |
56 | /** @addtogroup STM32F10x_System_Includes
57 | * @{
58 | */
59 |
60 | /**
61 | * @}
62 | */
63 |
64 |
65 | /** @addtogroup STM32F10x_System_Exported_types
66 | * @{
67 | */
68 |
69 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
70 | extern const uint8_t AHBPrescTable[16U]; /*!< AHB prescalers table values */
71 | extern const uint8_t APBPrescTable[8U]; /*!< APB prescalers table values */
72 |
73 | /**
74 | * @}
75 | */
76 |
77 | /** @addtogroup STM32F10x_System_Exported_Constants
78 | * @{
79 | */
80 |
81 | /**
82 | * @}
83 | */
84 |
85 | /** @addtogroup STM32F10x_System_Exported_Macros
86 | * @{
87 | */
88 |
89 | /**
90 | * @}
91 | */
92 |
93 | /** @addtogroup STM32F10x_System_Exported_Functions
94 | * @{
95 | */
96 |
97 | extern void SystemInit(void);
98 | extern void SystemCoreClockUpdate(void);
99 | /**
100 | * @}
101 | */
102 |
103 | #ifdef __cplusplus
104 | }
105 | #endif
106 |
107 | #endif /*__SYSTEM_STM32F10X_H */
108 |
109 | /**
110 | * @}
111 | */
112 |
113 | /**
114 | * @}
115 | */
116 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
117 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Include/arm_common_tables.h:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 19. October 2015
5 | * $Revision: V.1.4.5 a
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_common_tables.h
9 | *
10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions
11 | *
12 | * Target Processor: Cortex-M4/Cortex-M3
13 | *
14 | * Redistribution and use in source and binary forms, with or without
15 | * modification, are permitted provided that the following conditions
16 | * are met:
17 | * - Redistributions of source code must retain the above copyright
18 | * notice, this list of conditions and the following disclaimer.
19 | * - Redistributions in binary form must reproduce the above copyright
20 | * notice, this list of conditions and the following disclaimer in
21 | * the documentation and/or other materials provided with the
22 | * distribution.
23 | * - Neither the name of ARM LIMITED nor the names of its contributors
24 | * may be used to endorse or promote products derived from this
25 | * software without specific prior written permission.
26 | *
27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | * -------------------------------------------------------------------- */
40 |
41 | #ifndef _ARM_COMMON_TABLES_H
42 | #define _ARM_COMMON_TABLES_H
43 |
44 | #include "arm_math.h"
45 |
46 | extern const uint16_t armBitRevTable[1024];
47 | extern const q15_t armRecipTableQ15[64];
48 | extern const q31_t armRecipTableQ31[64];
49 | /* extern const q31_t realCoefAQ31[1024]; */
50 | /* extern const q31_t realCoefBQ31[1024]; */
51 | extern const float32_t twiddleCoef_16[32];
52 | extern const float32_t twiddleCoef_32[64];
53 | extern const float32_t twiddleCoef_64[128];
54 | extern const float32_t twiddleCoef_128[256];
55 | extern const float32_t twiddleCoef_256[512];
56 | extern const float32_t twiddleCoef_512[1024];
57 | extern const float32_t twiddleCoef_1024[2048];
58 | extern const float32_t twiddleCoef_2048[4096];
59 | extern const float32_t twiddleCoef_4096[8192];
60 | #define twiddleCoef twiddleCoef_4096
61 | extern const q31_t twiddleCoef_16_q31[24];
62 | extern const q31_t twiddleCoef_32_q31[48];
63 | extern const q31_t twiddleCoef_64_q31[96];
64 | extern const q31_t twiddleCoef_128_q31[192];
65 | extern const q31_t twiddleCoef_256_q31[384];
66 | extern const q31_t twiddleCoef_512_q31[768];
67 | extern const q31_t twiddleCoef_1024_q31[1536];
68 | extern const q31_t twiddleCoef_2048_q31[3072];
69 | extern const q31_t twiddleCoef_4096_q31[6144];
70 | extern const q15_t twiddleCoef_16_q15[24];
71 | extern const q15_t twiddleCoef_32_q15[48];
72 | extern const q15_t twiddleCoef_64_q15[96];
73 | extern const q15_t twiddleCoef_128_q15[192];
74 | extern const q15_t twiddleCoef_256_q15[384];
75 | extern const q15_t twiddleCoef_512_q15[768];
76 | extern const q15_t twiddleCoef_1024_q15[1536];
77 | extern const q15_t twiddleCoef_2048_q15[3072];
78 | extern const q15_t twiddleCoef_4096_q15[6144];
79 | extern const float32_t twiddleCoef_rfft_32[32];
80 | extern const float32_t twiddleCoef_rfft_64[64];
81 | extern const float32_t twiddleCoef_rfft_128[128];
82 | extern const float32_t twiddleCoef_rfft_256[256];
83 | extern const float32_t twiddleCoef_rfft_512[512];
84 | extern const float32_t twiddleCoef_rfft_1024[1024];
85 | extern const float32_t twiddleCoef_rfft_2048[2048];
86 | extern const float32_t twiddleCoef_rfft_4096[4096];
87 |
88 |
89 | /* floating-point bit reversal tables */
90 | #define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 )
91 | #define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 )
92 | #define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 )
93 | #define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 )
94 | #define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 )
95 | #define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 )
96 | #define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800)
97 | #define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808)
98 | #define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032)
99 |
100 | extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH];
101 | extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH];
102 | extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH];
103 | extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH];
104 | extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH];
105 | extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH];
106 | extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH];
107 | extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH];
108 | extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH];
109 |
110 | /* fixed-point bit reversal tables */
111 | #define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 )
112 | #define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 )
113 | #define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 )
114 | #define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 )
115 | #define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 )
116 | #define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 )
117 | #define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 )
118 | #define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984)
119 | #define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032)
120 |
121 | extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH];
122 | extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH];
123 | extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH];
124 | extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH];
125 | extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH];
126 | extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH];
127 | extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH];
128 | extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH];
129 | extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH];
130 |
131 | /* Tables for Fast Math Sine and Cosine */
132 | extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1];
133 | extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1];
134 | extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1];
135 |
136 | #endif /* ARM_COMMON_TABLES_H */
137 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Include/arm_const_structs.h:
--------------------------------------------------------------------------------
1 | /* ----------------------------------------------------------------------
2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved.
3 | *
4 | * $Date: 19. March 2015
5 | * $Revision: V.1.4.5
6 | *
7 | * Project: CMSIS DSP Library
8 | * Title: arm_const_structs.h
9 | *
10 | * Description: This file has constant structs that are initialized for
11 | * user convenience. For example, some can be given as
12 | * arguments to the arm_cfft_f32() function.
13 | *
14 | * Target Processor: Cortex-M4/Cortex-M3
15 | *
16 | * Redistribution and use in source and binary forms, with or without
17 | * modification, are permitted provided that the following conditions
18 | * are met:
19 | * - Redistributions of source code must retain the above copyright
20 | * notice, this list of conditions and the following disclaimer.
21 | * - Redistributions in binary form must reproduce the above copyright
22 | * notice, this list of conditions and the following disclaimer in
23 | * the documentation and/or other materials provided with the
24 | * distribution.
25 | * - Neither the name of ARM LIMITED nor the names of its contributors
26 | * may be used to endorse or promote products derived from this
27 | * software without specific prior written permission.
28 | *
29 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
32 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
33 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
34 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
35 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
36 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
37 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
39 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 | * POSSIBILITY OF SUCH DAMAGE.
41 | * -------------------------------------------------------------------- */
42 |
43 | #ifndef _ARM_CONST_STRUCTS_H
44 | #define _ARM_CONST_STRUCTS_H
45 |
46 | #include "arm_math.h"
47 | #include "arm_common_tables.h"
48 |
49 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16;
50 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32;
51 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64;
52 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128;
53 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256;
54 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512;
55 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024;
56 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048;
57 | extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096;
58 |
59 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16;
60 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32;
61 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64;
62 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128;
63 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256;
64 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512;
65 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024;
66 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048;
67 | extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096;
68 |
69 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16;
70 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32;
71 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64;
72 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128;
73 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256;
74 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512;
75 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024;
76 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048;
77 | extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096;
78 |
79 | #endif
80 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Include/core_cmFunc.h:
--------------------------------------------------------------------------------
1 | /**************************************************************************//**
2 | * @file core_cmFunc.h
3 | * @brief CMSIS Cortex-M Core Function Access Header File
4 | * @version V4.30
5 | * @date 20. October 2015
6 | ******************************************************************************/
7 | /* Copyright (c) 2009 - 2015 ARM LIMITED
8 |
9 | All rights reserved.
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 | - Redistributions of source code must retain the above copyright
13 | notice, this list of conditions and the following disclaimer.
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 | - Neither the name of ARM nor the names of its contributors may be used
18 | to endorse or promote products derived from this software without
19 | specific prior written permission.
20 | *
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 | ---------------------------------------------------------------------------*/
33 |
34 |
35 | #if defined ( __ICCARM__ )
36 | #pragma system_include /* treat file as system include file for MISRA check */
37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
38 | #pragma clang system_header /* treat file as system include file */
39 | #endif
40 |
41 | #ifndef __CORE_CMFUNC_H
42 | #define __CORE_CMFUNC_H
43 |
44 |
45 | /* ########################### Core Function Access ########################### */
46 | /** \ingroup CMSIS_Core_FunctionInterface
47 | \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
48 | @{
49 | */
50 |
51 | /*------------------ RealView Compiler -----------------*/
52 | #if defined ( __CC_ARM )
53 | #include "cmsis_armcc.h"
54 |
55 | /*------------------ ARM Compiler V6 -------------------*/
56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
57 | #include "cmsis_armcc_V6.h"
58 |
59 | /*------------------ GNU Compiler ----------------------*/
60 | #elif defined ( __GNUC__ )
61 | #include "cmsis_gcc.h"
62 |
63 | /*------------------ ICC Compiler ----------------------*/
64 | #elif defined ( __ICCARM__ )
65 | #include
66 |
67 | /*------------------ TI CCS Compiler -------------------*/
68 | #elif defined ( __TMS470__ )
69 | #include
70 |
71 | /*------------------ TASKING Compiler ------------------*/
72 | #elif defined ( __TASKING__ )
73 | /*
74 | * The CMSIS functions have been implemented as intrinsics in the compiler.
75 | * Please use "carm -?i" to get an up to date list of all intrinsics,
76 | * Including the CMSIS ones.
77 | */
78 |
79 | /*------------------ COSMIC Compiler -------------------*/
80 | #elif defined ( __CSMC__ )
81 | #include
82 |
83 | #endif
84 |
85 | /*@} end of CMSIS_Core_RegAccFunctions */
86 |
87 | #endif /* __CORE_CMFUNC_H */
88 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Include/core_cmInstr.h:
--------------------------------------------------------------------------------
1 | /**************************************************************************//**
2 | * @file core_cmInstr.h
3 | * @brief CMSIS Cortex-M Core Instruction Access Header File
4 | * @version V4.30
5 | * @date 20. October 2015
6 | ******************************************************************************/
7 | /* Copyright (c) 2009 - 2015 ARM LIMITED
8 |
9 | All rights reserved.
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 | - Redistributions of source code must retain the above copyright
13 | notice, this list of conditions and the following disclaimer.
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 | - Neither the name of ARM nor the names of its contributors may be used
18 | to endorse or promote products derived from this software without
19 | specific prior written permission.
20 | *
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 | ---------------------------------------------------------------------------*/
33 |
34 |
35 | #if defined ( __ICCARM__ )
36 | #pragma system_include /* treat file as system include file for MISRA check */
37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
38 | #pragma clang system_header /* treat file as system include file */
39 | #endif
40 |
41 | #ifndef __CORE_CMINSTR_H
42 | #define __CORE_CMINSTR_H
43 |
44 |
45 | /* ########################## Core Instruction Access ######################### */
46 | /** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
47 | Access to dedicated instructions
48 | @{
49 | */
50 |
51 | /*------------------ RealView Compiler -----------------*/
52 | #if defined ( __CC_ARM )
53 | #include "cmsis_armcc.h"
54 |
55 | /*------------------ ARM Compiler V6 -------------------*/
56 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
57 | #include "cmsis_armcc_V6.h"
58 |
59 | /*------------------ GNU Compiler ----------------------*/
60 | #elif defined ( __GNUC__ )
61 | #include "cmsis_gcc.h"
62 |
63 | /*------------------ ICC Compiler ----------------------*/
64 | #elif defined ( __ICCARM__ )
65 | #include
66 |
67 | /*------------------ TI CCS Compiler -------------------*/
68 | #elif defined ( __TMS470__ )
69 | #include
70 |
71 | /*------------------ TASKING Compiler ------------------*/
72 | #elif defined ( __TASKING__ )
73 | /*
74 | * The CMSIS functions have been implemented as intrinsics in the compiler.
75 | * Please use "carm -?i" to get an up to date list of all intrinsics,
76 | * Including the CMSIS ones.
77 | */
78 |
79 | /*------------------ COSMIC Compiler -------------------*/
80 | #elif defined ( __CSMC__ )
81 | #include
82 |
83 | #endif
84 |
85 | /*@}*/ /* end of group CMSIS_Core_InstructionInterface */
86 |
87 | #endif /* __CORE_CMINSTR_H */
88 |
--------------------------------------------------------------------------------
/Drivers/CMSIS/Include/core_cmSimd.h:
--------------------------------------------------------------------------------
1 | /**************************************************************************//**
2 | * @file core_cmSimd.h
3 | * @brief CMSIS Cortex-M SIMD Header File
4 | * @version V4.30
5 | * @date 20. October 2015
6 | ******************************************************************************/
7 | /* Copyright (c) 2009 - 2015 ARM LIMITED
8 |
9 | All rights reserved.
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 | - Redistributions of source code must retain the above copyright
13 | notice, this list of conditions and the following disclaimer.
14 | - Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 | - Neither the name of ARM nor the names of its contributors may be used
18 | to endorse or promote products derived from this software without
19 | specific prior written permission.
20 | *
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
25 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 | POSSIBILITY OF SUCH DAMAGE.
32 | ---------------------------------------------------------------------------*/
33 |
34 |
35 | #if defined ( __ICCARM__ )
36 | #pragma system_include /* treat file as system include file for MISRA check */
37 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
38 | #pragma clang system_header /* treat file as system include file */
39 | #endif
40 |
41 | #ifndef __CORE_CMSIMD_H
42 | #define __CORE_CMSIMD_H
43 |
44 | #ifdef __cplusplus
45 | extern "C" {
46 | #endif
47 |
48 |
49 | /* ################### Compiler specific Intrinsics ########################### */
50 | /** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
51 | Access to dedicated SIMD instructions
52 | @{
53 | */
54 |
55 | /*------------------ RealView Compiler -----------------*/
56 | #if defined ( __CC_ARM )
57 | #include "cmsis_armcc.h"
58 |
59 | /*------------------ ARM Compiler V6 -------------------*/
60 | #elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
61 | #include "cmsis_armcc_V6.h"
62 |
63 | /*------------------ GNU Compiler ----------------------*/
64 | #elif defined ( __GNUC__ )
65 | #include "cmsis_gcc.h"
66 |
67 | /*------------------ ICC Compiler ----------------------*/
68 | #elif defined ( __ICCARM__ )
69 | #include
70 |
71 | /*------------------ TI CCS Compiler -------------------*/
72 | #elif defined ( __TMS470__ )
73 | #include
74 |
75 | /*------------------ TASKING Compiler ------------------*/
76 | #elif defined ( __TASKING__ )
77 | /*
78 | * The CMSIS functions have been implemented as intrinsics in the compiler.
79 | * Please use "carm -?i" to get an up to date list of all intrinsics,
80 | * Including the CMSIS ones.
81 | */
82 |
83 | /*------------------ COSMIC Compiler -------------------*/
84 | #elif defined ( __CSMC__ )
85 | #include
86 |
87 | #endif
88 |
89 | /*@} end of group CMSIS_SIMD_intrinsics */
90 |
91 |
92 | #ifdef __cplusplus
93 | }
94 | #endif
95 |
96 | #endif /* __CORE_CMSIMD_H */
97 |
--------------------------------------------------------------------------------
/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f1xx_hal_def.h
4 | * @author MCD Application Team
5 | * @brief This file contains HAL common defines, enumeration, macros and
6 | * structures definitions.
7 | ******************************************************************************
8 | * @attention
9 | *
10 | * © COPYRIGHT(c) 2017 STMicroelectronics
11 | *
12 | * Redistribution and use in source and binary forms, with or without modification,
13 | * are permitted provided that the following conditions are met:
14 | * 1. Redistributions of source code must retain the above copyright notice,
15 | * this list of conditions and the following disclaimer.
16 | * 2. Redistributions in binary form must reproduce the above copyright notice,
17 | * this list of conditions and the following disclaimer in the documentation
18 | * and/or other materials provided with the distribution.
19 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
20 | * may be used to endorse or promote products derived from this software
21 | * without specific prior written permission.
22 | *
23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 | *
34 | ******************************************************************************
35 | */
36 |
37 | /* Define to prevent recursive inclusion -------------------------------------*/
38 | #ifndef __STM32F1xx_HAL_DEF
39 | #define __STM32F1xx_HAL_DEF
40 |
41 | #ifdef __cplusplus
42 | extern "C" {
43 | #endif
44 |
45 | /* Includes ------------------------------------------------------------------*/
46 | #include "stm32f1xx.h"
47 | #if defined(USE_HAL_LEGACY)
48 | #include "Legacy/stm32_hal_legacy.h"
49 | #endif
50 | #include
51 |
52 | /* Exported types ------------------------------------------------------------*/
53 |
54 | /**
55 | * @brief HAL Status structures definition
56 | */
57 | typedef enum
58 | {
59 | HAL_OK = 0x00U,
60 | HAL_ERROR = 0x01U,
61 | HAL_BUSY = 0x02U,
62 | HAL_TIMEOUT = 0x03U
63 | } HAL_StatusTypeDef;
64 |
65 | /**
66 | * @brief HAL Lock structures definition
67 | */
68 | typedef enum
69 | {
70 | HAL_UNLOCKED = 0x00U,
71 | HAL_LOCKED = 0x01U
72 | } HAL_LockTypeDef;
73 |
74 | /* Exported macro ------------------------------------------------------------*/
75 | #define HAL_MAX_DELAY 0xFFFFFFFFU
76 |
77 | #define HAL_IS_BIT_SET(REG, BIT) (((REG) & (BIT)) != 0U)
78 | #define HAL_IS_BIT_CLR(REG, BIT) (((REG) & (BIT)) == 0U)
79 |
80 | #define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__) \
81 | do{ \
82 | (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
83 | (__DMA_HANDLE__).Parent = (__HANDLE__); \
84 | } while(0U)
85 |
86 | #define UNUSED(X) (void)X /* To avoid gcc/g++ warnings */
87 |
88 | /** @brief Reset the Handle's State field.
89 | * @param __HANDLE__: specifies the Peripheral Handle.
90 | * @note This macro can be used for the following purpose:
91 | * - When the Handle is declared as local variable; before passing it as parameter
92 | * to HAL_PPP_Init() for the first time, it is mandatory to use this macro
93 | * to set to 0 the Handle's "State" field.
94 | * Otherwise, "State" field may have any random value and the first time the function
95 | * HAL_PPP_Init() is called, the low level hardware initialization will be missed
96 | * (i.e. HAL_PPP_MspInit() will not be executed).
97 | * - When there is a need to reconfigure the low level hardware: instead of calling
98 | * HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().
99 | * In this later function, when the Handle's "State" field is set to 0, it will execute the function
100 | * HAL_PPP_MspInit() which will reconfigure the low level hardware.
101 | * @retval None
102 | */
103 | #define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
104 |
105 | #if (USE_RTOS == 1U)
106 | /* Reserved for future use */
107 | #error "USE_RTOS should be 0 in the current HAL release"
108 | #else
109 | #define __HAL_LOCK(__HANDLE__) \
110 | do{ \
111 | if((__HANDLE__)->Lock == HAL_LOCKED) \
112 | { \
113 | return HAL_BUSY; \
114 | } \
115 | else \
116 | { \
117 | (__HANDLE__)->Lock = HAL_LOCKED; \
118 | } \
119 | }while (0U)
120 |
121 | #define __HAL_UNLOCK(__HANDLE__) \
122 | do{ \
123 | (__HANDLE__)->Lock = HAL_UNLOCKED; \
124 | }while (0U)
125 | #endif /* USE_RTOS */
126 |
127 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
128 | #ifndef __weak
129 | #define __weak __attribute__((weak))
130 | #endif /* __weak */
131 | #ifndef __packed
132 | #define __packed __attribute__((__packed__))
133 | #endif /* __packed */
134 | #endif /* __GNUC__ */
135 |
136 |
137 | /* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
138 | #if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
139 | #ifndef __ALIGN_END
140 | #define __ALIGN_END __attribute__ ((aligned (4)))
141 | #endif /* __ALIGN_END */
142 | #ifndef __ALIGN_BEGIN
143 | #define __ALIGN_BEGIN
144 | #endif /* __ALIGN_BEGIN */
145 | #else
146 | #ifndef __ALIGN_END
147 | #define __ALIGN_END
148 | #endif /* __ALIGN_END */
149 | #ifndef __ALIGN_BEGIN
150 | #if defined (__CC_ARM) /* ARM Compiler */
151 | #define __ALIGN_BEGIN __align(4)
152 | #elif defined (__ICCARM__) /* IAR Compiler */
153 | #define __ALIGN_BEGIN
154 | #endif /* __CC_ARM */
155 | #endif /* __ALIGN_BEGIN */
156 | #endif /* __GNUC__ */
157 |
158 |
159 | /**
160 | * @brief __RAM_FUNC definition
161 | */
162 | #if defined ( __CC_ARM )
163 | /* ARM Compiler
164 | ------------
165 | RAM functions are defined using the toolchain options.
166 | Functions that are executed in RAM should reside in a separate source module.
167 | Using the 'Options for File' dialog you can simply change the 'Code / Const'
168 | area of a module to a memory space in physical RAM.
169 | Available memory areas are declared in the 'Target' tab of the 'Options for Target'
170 | dialog.
171 | */
172 | #define __RAM_FUNC
173 |
174 | #elif defined ( __ICCARM__ )
175 | /* ICCARM Compiler
176 | ---------------
177 | RAM functions are defined using a specific toolchain keyword "__ramfunc".
178 | */
179 | #define __RAM_FUNC __ramfunc
180 |
181 | #elif defined ( __GNUC__ )
182 | /* GNU Compiler
183 | ------------
184 | RAM functions are defined using a specific toolchain attribute
185 | "__attribute__((section(".RamFunc")))".
186 | */
187 | #define __RAM_FUNC __attribute__((section(".RamFunc")))
188 |
189 | #endif
190 |
191 | /**
192 | * @brief __NOINLINE definition
193 | */
194 | #if defined ( __CC_ARM ) || defined ( __GNUC__ )
195 | /* ARM & GNUCompiler
196 | ----------------
197 | */
198 | #define __NOINLINE __attribute__ ( (noinline) )
199 |
200 | #elif defined ( __ICCARM__ )
201 | /* ICCARM Compiler
202 | ---------------
203 | */
204 | #define __NOINLINE _Pragma("optimize = no_inline")
205 |
206 | #endif
207 |
208 | #ifdef __cplusplus
209 | }
210 | #endif
211 |
212 | #endif /* ___STM32F1xx_HAL_DEF */
213 |
214 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
215 |
--------------------------------------------------------------------------------
/Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f1xx_hal_flash.h
4 | * @author MCD Application Team
5 | * @brief Header file of Flash HAL module.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © COPYRIGHT(c) 2016 STMicroelectronics
10 | *
11 | * Redistribution and use in source and binary forms, with or without modification,
12 | * are permitted provided that the following conditions are met:
13 | * 1. Redistributions of source code must retain the above copyright notice,
14 | * this list of conditions and the following disclaimer.
15 | * 2. Redistributions in binary form must reproduce the above copyright notice,
16 | * this list of conditions and the following disclaimer in the documentation
17 | * and/or other materials provided with the distribution.
18 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
19 | * may be used to endorse or promote products derived from this software
20 | * without specific prior written permission.
21 | *
22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 | *
33 | ******************************************************************************
34 | */
35 |
36 | /* Define to prevent recursive inclusion -------------------------------------*/
37 | #ifndef __STM32F1xx_HAL_FLASH_H
38 | #define __STM32F1xx_HAL_FLASH_H
39 |
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | /* Includes ------------------------------------------------------------------*/
45 | #include "stm32f1xx_hal_def.h"
46 |
47 | /** @addtogroup STM32F1xx_HAL_Driver
48 | * @{
49 | */
50 |
51 | /** @addtogroup FLASH
52 | * @{
53 | */
54 |
55 | /** @addtogroup FLASH_Private_Constants
56 | * @{
57 | */
58 | #define FLASH_TIMEOUT_VALUE 50000U /* 50 s */
59 | /**
60 | * @}
61 | */
62 |
63 | /** @addtogroup FLASH_Private_Macros
64 | * @{
65 | */
66 |
67 | #define IS_FLASH_TYPEPROGRAM(VALUE) (((VALUE) == FLASH_TYPEPROGRAM_HALFWORD) || \
68 | ((VALUE) == FLASH_TYPEPROGRAM_WORD) || \
69 | ((VALUE) == FLASH_TYPEPROGRAM_DOUBLEWORD))
70 |
71 | #if defined(FLASH_ACR_LATENCY)
72 | #define IS_FLASH_LATENCY(__LATENCY__) (((__LATENCY__) == FLASH_LATENCY_0) || \
73 | ((__LATENCY__) == FLASH_LATENCY_1) || \
74 | ((__LATENCY__) == FLASH_LATENCY_2))
75 |
76 | #else
77 | #define IS_FLASH_LATENCY(__LATENCY__) ((__LATENCY__) == FLASH_LATENCY_0)
78 | #endif /* FLASH_ACR_LATENCY */
79 | /**
80 | * @}
81 | */
82 |
83 | /* Exported types ------------------------------------------------------------*/
84 | /** @defgroup FLASH_Exported_Types FLASH Exported Types
85 | * @{
86 | */
87 |
88 | /**
89 | * @brief FLASH Procedure structure definition
90 | */
91 | typedef enum
92 | {
93 | FLASH_PROC_NONE = 0U,
94 | FLASH_PROC_PAGEERASE = 1U,
95 | FLASH_PROC_MASSERASE = 2U,
96 | FLASH_PROC_PROGRAMHALFWORD = 3U,
97 | FLASH_PROC_PROGRAMWORD = 4U,
98 | FLASH_PROC_PROGRAMDOUBLEWORD = 5U
99 | } FLASH_ProcedureTypeDef;
100 |
101 | /**
102 | * @brief FLASH handle Structure definition
103 | */
104 | typedef struct
105 | {
106 | __IO FLASH_ProcedureTypeDef ProcedureOnGoing; /*!< Internal variable to indicate which procedure is ongoing or not in IT context */
107 |
108 | __IO uint32_t DataRemaining; /*!< Internal variable to save the remaining pages to erase or half-word to program in IT context */
109 |
110 | __IO uint32_t Address; /*!< Internal variable to save address selected for program or erase */
111 |
112 | __IO uint64_t Data; /*!< Internal variable to save data to be programmed */
113 |
114 | HAL_LockTypeDef Lock; /*!< FLASH locking object */
115 |
116 | __IO uint32_t ErrorCode; /*!< FLASH error code
117 | This parameter can be a value of @ref FLASH_Error_Codes */
118 | } FLASH_ProcessTypeDef;
119 |
120 | /**
121 | * @}
122 | */
123 |
124 | /* Exported constants --------------------------------------------------------*/
125 | /** @defgroup FLASH_Exported_Constants FLASH Exported Constants
126 | * @{
127 | */
128 |
129 | /** @defgroup FLASH_Error_Codes FLASH Error Codes
130 | * @{
131 | */
132 |
133 | #define HAL_FLASH_ERROR_NONE 0x00U /*!< No error */
134 | #define HAL_FLASH_ERROR_PROG 0x01U /*!< Programming error */
135 | #define HAL_FLASH_ERROR_WRP 0x02U /*!< Write protection error */
136 | #define HAL_FLASH_ERROR_OPTV 0x04U /*!< Option validity error */
137 |
138 | /**
139 | * @}
140 | */
141 |
142 | /** @defgroup FLASH_Type_Program FLASH Type Program
143 | * @{
144 | */
145 | #define FLASH_TYPEPROGRAM_HALFWORD 0x01U /*!ACR |= FLASH_ACR_HLFCYA)
199 |
200 | /**
201 | * @brief Disable the FLASH half cycle access.
202 | * @note half cycle access can only be used with a low-frequency clock of less than
203 | 8 MHz that can be obtained with the use of HSI or HSE but not of PLL.
204 | * @retval None
205 | */
206 | #define __HAL_FLASH_HALF_CYCLE_ACCESS_DISABLE() (FLASH->ACR &= (~FLASH_ACR_HLFCYA))
207 |
208 | /**
209 | * @}
210 | */
211 |
212 | #if defined(FLASH_ACR_LATENCY)
213 | /** @defgroup FLASH_EM_Latency FLASH Latency
214 | * @brief macros to handle FLASH Latency
215 | * @{
216 | */
217 |
218 | /**
219 | * @brief Set the FLASH Latency.
220 | * @param __LATENCY__ FLASH Latency
221 | * The value of this parameter depend on device used within the same series
222 | * @retval None
223 | */
224 | #define __HAL_FLASH_SET_LATENCY(__LATENCY__) (FLASH->ACR = (FLASH->ACR&(~FLASH_ACR_LATENCY)) | (__LATENCY__))
225 |
226 |
227 | /**
228 | * @brief Get the FLASH Latency.
229 | * @retval FLASH Latency
230 | * The value of this parameter depend on device used within the same series
231 | */
232 | #define __HAL_FLASH_GET_LATENCY() (READ_BIT((FLASH->ACR), FLASH_ACR_LATENCY))
233 |
234 | /**
235 | * @}
236 | */
237 |
238 | #endif /* FLASH_ACR_LATENCY */
239 | /** @defgroup FLASH_Prefetch FLASH Prefetch
240 | * @brief macros to handle FLASH Prefetch buffer
241 | * @{
242 | */
243 | /**
244 | * @brief Enable the FLASH prefetch buffer.
245 | * @retval None
246 | */
247 | #define __HAL_FLASH_PREFETCH_BUFFER_ENABLE() (FLASH->ACR |= FLASH_ACR_PRFTBE)
248 |
249 | /**
250 | * @brief Disable the FLASH prefetch buffer.
251 | * @retval None
252 | */
253 | #define __HAL_FLASH_PREFETCH_BUFFER_DISABLE() (FLASH->ACR &= (~FLASH_ACR_PRFTBE))
254 |
255 | /**
256 | * @}
257 | */
258 |
259 | /**
260 | * @}
261 | */
262 |
263 | /* Include FLASH HAL Extended module */
264 | #include "stm32f1xx_hal_flash_ex.h"
265 |
266 | /* Exported functions --------------------------------------------------------*/
267 | /** @addtogroup FLASH_Exported_Functions
268 | * @{
269 | */
270 |
271 | /** @addtogroup FLASH_Exported_Functions_Group1
272 | * @{
273 | */
274 | /* IO operation functions *****************************************************/
275 | HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
276 | HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
277 |
278 | /* FLASH IRQ handler function */
279 | void HAL_FLASH_IRQHandler(void);
280 | /* Callbacks in non blocking modes */
281 | void HAL_FLASH_EndOfOperationCallback(uint32_t ReturnValue);
282 | void HAL_FLASH_OperationErrorCallback(uint32_t ReturnValue);
283 |
284 | /**
285 | * @}
286 | */
287 |
288 | /** @addtogroup FLASH_Exported_Functions_Group2
289 | * @{
290 | */
291 | /* Peripheral Control functions ***********************************************/
292 | HAL_StatusTypeDef HAL_FLASH_Unlock(void);
293 | HAL_StatusTypeDef HAL_FLASH_Lock(void);
294 | HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
295 | HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);
296 | void HAL_FLASH_OB_Launch(void);
297 |
298 | /**
299 | * @}
300 | */
301 |
302 | /** @addtogroup FLASH_Exported_Functions_Group3
303 | * @{
304 | */
305 | /* Peripheral State and Error functions ***************************************/
306 | uint32_t HAL_FLASH_GetError(void);
307 |
308 | /**
309 | * @}
310 | */
311 |
312 | /**
313 | * @}
314 | */
315 |
316 | /* Private function -------------------------------------------------*/
317 | /** @addtogroup FLASH_Private_Functions
318 | * @{
319 | */
320 | HAL_StatusTypeDef FLASH_WaitForLastOperation(uint32_t Timeout);
321 | #if defined(FLASH_BANK2_END)
322 | HAL_StatusTypeDef FLASH_WaitForLastOperationBank2(uint32_t Timeout);
323 | #endif /* FLASH_BANK2_END */
324 |
325 | /**
326 | * @}
327 | */
328 |
329 | /**
330 | * @}
331 | */
332 |
333 | /**
334 | * @}
335 | */
336 |
337 | #ifdef __cplusplus
338 | }
339 | #endif
340 |
341 | #endif /* __STM32F1xx_HAL_FLASH_H */
342 |
343 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
344 |
345 |
--------------------------------------------------------------------------------
/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * @file stm32f1xx_hal_gpio_ex.c
4 | * @author MCD Application Team
5 | * @brief GPIO Extension HAL module driver.
6 | * This file provides firmware functions to manage the following
7 | * functionalities of the General Purpose Input/Output (GPIO) extension peripheral.
8 | * + Extended features functions
9 | *
10 | @verbatim
11 | ==============================================================================
12 | ##### GPIO Peripheral extension features #####
13 | ==============================================================================
14 | [..] GPIO module on STM32F1 family, manage also the AFIO register:
15 | (+) Possibility to use the EVENTOUT Cortex feature
16 |
17 | ##### How to use this driver #####
18 | ==============================================================================
19 | [..] This driver provides functions to use EVENTOUT Cortex feature
20 | (#) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout()
21 | (#) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout()
22 | (#) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout()
23 |
24 | @endverbatim
25 | ******************************************************************************
26 | * @attention
27 | *
28 | * © COPYRIGHT(c) 2016 STMicroelectronics
29 | *
30 | * Redistribution and use in source and binary forms, with or without modification,
31 | * are permitted provided that the following conditions are met:
32 | * 1. Redistributions of source code must retain the above copyright notice,
33 | * this list of conditions and the following disclaimer.
34 | * 2. Redistributions in binary form must reproduce the above copyright notice,
35 | * this list of conditions and the following disclaimer in the documentation
36 | * and/or other materials provided with the distribution.
37 | * 3. Neither the name of STMicroelectronics nor the names of its contributors
38 | * may be used to endorse or promote products derived from this software
39 | * without specific prior written permission.
40 | *
41 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
42 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
44 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
45 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
47 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
48 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51 | *
52 | ******************************************************************************
53 | */
54 |
55 | /* Includes ------------------------------------------------------------------*/
56 | #include "stm32f1xx_hal.h"
57 |
58 | /** @addtogroup STM32F1xx_HAL_Driver
59 | * @{
60 | */
61 |
62 | /** @defgroup GPIOEx GPIOEx
63 | * @brief GPIO HAL module driver
64 | * @{
65 | */
66 |
67 | #ifdef HAL_GPIO_MODULE_ENABLED
68 |
69 | /** @defgroup GPIOEx_Exported_Functions GPIOEx Exported Functions
70 | * @{
71 | */
72 |
73 | /** @defgroup GPIOEx_Exported_Functions_Group1 Extended features functions
74 | * @brief Extended features functions
75 | *
76 | @verbatim
77 | ==============================================================================
78 | ##### Extended features functions #####
79 | ==============================================================================
80 | [..] This section provides functions allowing to:
81 | (+) Configure EVENTOUT Cortex feature using the function HAL_GPIOEx_ConfigEventout()
82 | (+) Activate EVENTOUT Cortex feature using the HAL_GPIOEx_EnableEventout()
83 | (+) Deactivate EVENTOUT Cortex feature using the HAL_GPIOEx_DisableEventout()
84 |
85 | @endverbatim
86 | * @{
87 | */
88 |
89 | /**
90 | * @brief Configures the port and pin on which the EVENTOUT Cortex signal will be connected.
91 | * @param GPIO_PortSource Select the port used to output the Cortex EVENTOUT signal.
92 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PORT.
93 | * @param GPIO_PinSource Select the pin used to output the Cortex EVENTOUT signal.
94 | * This parameter can be a value of @ref GPIOEx_EVENTOUT_PIN.
95 | * @retval None
96 | */
97 | void HAL_GPIOEx_ConfigEventout(uint32_t GPIO_PortSource, uint32_t GPIO_PinSource)
98 | {
99 | /* Verify the parameters */
100 | assert_param(IS_AFIO_EVENTOUT_PORT(GPIO_PortSource));
101 | assert_param(IS_AFIO_EVENTOUT_PIN(GPIO_PinSource));
102 |
103 | /* Apply the new configuration */
104 | MODIFY_REG(AFIO->EVCR, (AFIO_EVCR_PORT) | (AFIO_EVCR_PIN), (GPIO_PortSource) | (GPIO_PinSource));
105 | }
106 |
107 | /**
108 | * @brief Enables the Event Output.
109 | * @retval None
110 | */
111 | void HAL_GPIOEx_EnableEventout(void)
112 | {
113 | SET_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);
114 | }
115 |
116 | /**
117 | * @brief Disables the Event Output.
118 | * @retval None
119 | */
120 | void HAL_GPIOEx_DisableEventout(void)
121 | {
122 | CLEAR_BIT(AFIO->EVCR, AFIO_EVCR_EVOE);
123 | }
124 |
125 | /**
126 | * @}
127 | */
128 |
129 | /**
130 | * @}
131 | */
132 |
133 | #endif /* HAL_GPIO_MODULE_ENABLED */
134 |
135 | /**
136 | * @}
137 | */
138 |
139 | /**
140 | * @}
141 | */
142 |
143 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
144 |
--------------------------------------------------------------------------------
/Inc/FreeRTOSConfig.h:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /*
3 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
4 | All rights reserved
5 |
6 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
7 |
8 | This file is part of the FreeRTOS distribution.
9 |
10 | FreeRTOS is free software; you can redistribute it and/or modify it under
11 | the terms of the GNU General Public License (version 2) as published by the
12 | Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.
13 |
14 | ***************************************************************************
15 | >>! NOTE: The modification to the GPL is included to allow you to !<<
16 | >>! distribute a combined work that includes FreeRTOS without being !<<
17 | >>! obliged to provide the source code for proprietary components !<<
18 | >>! outside of the FreeRTOS kernel. !<<
19 | ***************************************************************************
20 |
21 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
22 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
23 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
24 | link: http://www.freertos.org/a00114.html
25 |
26 | ***************************************************************************
27 | * *
28 | * FreeRTOS provides completely free yet professionally developed, *
29 | * robust, strictly quality controlled, supported, and cross *
30 | * platform software that is more than just the market leader, it *
31 | * is the industry's de facto standard. *
32 | * *
33 | * Help yourself get started quickly while simultaneously helping *
34 | * to support the FreeRTOS project by purchasing a FreeRTOS *
35 | * tutorial book, reference manual, or both: *
36 | * http://www.FreeRTOS.org/Documentation *
37 | * *
38 | ***************************************************************************
39 |
40 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
41 | the FAQ page "My application does not run, what could be wrong?". Have you
42 | defined configASSERT()?
43 |
44 | http://www.FreeRTOS.org/support - In return for receiving this top quality
45 | embedded software for free we request you assist our global community by
46 | participating in the support forum.
47 |
48 | http://www.FreeRTOS.org/training - Investing in training allows your team to
49 | be as productive as possible as early as possible. Now you can receive
50 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
51 | Ltd, and the world's leading authority on the world's leading RTOS.
52 |
53 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
54 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
55 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
56 |
57 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
58 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
59 |
60 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
61 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
62 | licenses offer ticketed support, indemnification and commercial middleware.
63 |
64 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
65 | engineered and independently SIL3 certified version for use in safety and
66 | mission critical applications that require provable dependability.
67 |
68 | 1 tab == 4 spaces!
69 | */
70 | /* USER CODE END Header */
71 |
72 | #ifndef FREERTOS_CONFIG_H
73 | #define FREERTOS_CONFIG_H
74 |
75 | /*-----------------------------------------------------------
76 | * Application specific definitions.
77 | *
78 | * These definitions should be adjusted for your particular hardware and
79 | * application requirements.
80 | *
81 | * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
82 | * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
83 | *
84 | * See http://www.freertos.org/a00110.html.
85 | *----------------------------------------------------------*/
86 |
87 | /* USER CODE BEGIN Includes */
88 | /* Section where include file can be added */
89 | /* USER CODE END Includes */
90 |
91 | /* Ensure stdint is only used by the compiler, and not the assembler. */
92 | #if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
93 | #include
94 | extern uint32_t SystemCoreClock;
95 | #endif
96 |
97 | #define configUSE_PREEMPTION 1
98 | #define configSUPPORT_STATIC_ALLOCATION 0
99 | #define configSUPPORT_DYNAMIC_ALLOCATION 1
100 | #define configUSE_IDLE_HOOK 0
101 | #define configUSE_TICK_HOOK 0
102 | #define configCPU_CLOCK_HZ ( SystemCoreClock )
103 | #define configTICK_RATE_HZ ((TickType_t)1000)
104 | #define configMAX_PRIORITIES ( 7 )
105 | #define configMINIMAL_STACK_SIZE ((uint16_t)128)
106 | #define configTOTAL_HEAP_SIZE ((size_t)3072)
107 | #define configMAX_TASK_NAME_LEN ( 16 )
108 | #define configUSE_16_BIT_TICKS 0
109 | #define configUSE_MUTEXES 1
110 | #define configQUEUE_REGISTRY_SIZE 8
111 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
112 |
113 | /* Co-routine definitions. */
114 | #define configUSE_CO_ROUTINES 0
115 | #define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
116 |
117 | /* Set the following definitions to 1 to include the API function, or zero
118 | to exclude the API function. */
119 | #define INCLUDE_vTaskPrioritySet 1
120 | #define INCLUDE_uxTaskPriorityGet 1
121 | #define INCLUDE_vTaskDelete 1
122 | #define INCLUDE_vTaskCleanUpResources 0
123 | #define INCLUDE_vTaskSuspend 1
124 | #define INCLUDE_vTaskDelayUntil 0
125 | #define INCLUDE_vTaskDelay 1
126 | #define INCLUDE_xTaskGetSchedulerState 1
127 |
128 | /* Cortex-M specific definitions. */
129 | #ifdef __NVIC_PRIO_BITS
130 | /* __BVIC_PRIO_BITS will be specified when CMSIS is being used. */
131 | #define configPRIO_BITS __NVIC_PRIO_BITS
132 | #else
133 | #define configPRIO_BITS 4
134 | #endif
135 |
136 | /* The lowest interrupt priority that can be used in a call to a "set priority"
137 | function. */
138 | #define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
139 |
140 | /* The highest interrupt priority that can be used by any interrupt service
141 | routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
142 | INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
143 | PRIORITY THAN THIS! (higher priorities are lower numeric values. */
144 | #define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
145 |
146 | /* Interrupt priorities used by the kernel port layer itself. These are generic
147 | to all Cortex-M ports, and do not rely on any particular library functions. */
148 | #define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
149 | /* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
150 | See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
151 | #define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
152 |
153 | /* Normal assert() semantics without relying on the provision of an assert.h
154 | header file. */
155 | /* USER CODE BEGIN 1 */
156 | #define configASSERT( x ) if ((x) == 0) {taskDISABLE_INTERRUPTS(); for( ;; );}
157 | /* USER CODE END 1 */
158 |
159 | /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
160 | standard names. */
161 | #define vPortSVCHandler SVC_Handler
162 | #define xPortPendSVHandler PendSV_Handler
163 |
164 | /* IMPORTANT: This define is commented when used with STM32Cube firmware, when timebase is systick,
165 | to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
166 | #define xPortSysTickHandler SysTick_Handler
167 |
168 | /* USER CODE BEGIN Defines */
169 | /* Section where parameter definitions can be added (for instance, to override default ones in FreeRTOS.h) */
170 | /* USER CODE END Defines */
171 |
172 | #endif /* FREERTOS_CONFIG_H */
173 |
--------------------------------------------------------------------------------
/Inc/dma.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : dma.h
4 | * Description : This file contains all the function prototypes for
5 | * the dma.c file
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __dma_H
21 | #define __dma_H
22 |
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "main.h"
29 |
30 | /* DMA memory to memory transfer handles -------------------------------------*/
31 |
32 | /* USER CODE BEGIN Includes */
33 |
34 | /* USER CODE END Includes */
35 |
36 | /* USER CODE BEGIN Private defines */
37 |
38 | /* USER CODE END Private defines */
39 |
40 | void MX_DMA_Init(void);
41 |
42 | /* USER CODE BEGIN Prototypes */
43 |
44 | /* USER CODE END Prototypes */
45 |
46 | #ifdef __cplusplus
47 | }
48 | #endif
49 |
50 | #endif /* __dma_H */
51 |
52 | /**
53 | * @}
54 | */
55 |
56 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
57 |
--------------------------------------------------------------------------------
/Inc/gpio.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : gpio.h
4 | * Description : This file contains all the functions prototypes for
5 | * the gpio
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 |
20 | /* Define to prevent recursive inclusion -------------------------------------*/
21 | #ifndef __gpio_H
22 | #define __gpio_H
23 | #ifdef __cplusplus
24 | extern "C" {
25 | #endif
26 |
27 | /* Includes ------------------------------------------------------------------*/
28 | #include "main.h"
29 |
30 | /* USER CODE BEGIN Includes */
31 |
32 | /* USER CODE END Includes */
33 |
34 | /* USER CODE BEGIN Private defines */
35 |
36 | /* USER CODE END Private defines */
37 |
38 | void MX_GPIO_Init(void);
39 |
40 | /* USER CODE BEGIN Prototypes */
41 |
42 | /* USER CODE END Prototypes */
43 |
44 | #ifdef __cplusplus
45 | }
46 | #endif
47 | #endif /*__ pinoutConfig_H */
48 |
49 | /**
50 | * @}
51 | */
52 |
53 | /**
54 | * @}
55 | */
56 |
57 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
58 |
--------------------------------------------------------------------------------
/Inc/main.h:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * @file : main.h
5 | * @brief : Header for main.c file.
6 | * This file contains the common defines of the application.
7 | ******************************************************************************
8 | * @attention
9 | *
10 | * © Copyright (c) 2019 STMicroelectronics.
11 | * All rights reserved.
12 | *
13 | * This software component is licensed by ST under Ultimate Liberty license
14 | * SLA0044, the "License"; You may not use this file except in compliance with
15 | * the License. You may obtain a copy of the License at:
16 | * www.st.com/SLA0044
17 | *
18 | ******************************************************************************
19 | */
20 | /* USER CODE END Header */
21 |
22 | /* Define to prevent recursive inclusion -------------------------------------*/
23 | #ifndef __MAIN_H
24 | #define __MAIN_H
25 |
26 | #ifdef __cplusplus
27 | extern "C" {
28 | #endif
29 |
30 | /* Includes ------------------------------------------------------------------*/
31 | #include "stm32f1xx_hal.h"
32 |
33 | /* Private includes ----------------------------------------------------------*/
34 | /* USER CODE BEGIN Includes */
35 | #include "cmsis_os.h"
36 | #include "dma.h"
37 | #include "usart.h"
38 | #include "gpio.h"
39 |
40 | /* USER CODE END Includes */
41 |
42 | /* Exported types ------------------------------------------------------------*/
43 | /* USER CODE BEGIN ET */
44 |
45 | /* USER CODE END ET */
46 |
47 | /* Exported constants --------------------------------------------------------*/
48 | /* USER CODE BEGIN EC */
49 |
50 | /* USER CODE END EC */
51 |
52 | /* Exported macro ------------------------------------------------------------*/
53 | /* USER CODE BEGIN EM */
54 |
55 | /* USER CODE END EM */
56 |
57 | /* Exported functions prototypes ---------------------------------------------*/
58 | void Error_Handler(void);
59 |
60 | /* USER CODE BEGIN EFP */
61 |
62 | /* USER CODE END EFP */
63 |
64 | /* Private defines -----------------------------------------------------------*/
65 | /* USER CODE BEGIN Private defines */
66 |
67 | /* USER CODE END Private defines */
68 |
69 | #ifdef __cplusplus
70 | }
71 | #endif
72 |
73 | #endif /* __MAIN_H */
74 |
75 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
76 |
--------------------------------------------------------------------------------
/Inc/stm32f1xx_it.h:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * @file stm32f1xx_it.h
5 | * @brief This file contains the headers of the interrupt handlers.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* USER CODE END Header */
20 |
21 | /* Define to prevent recursive inclusion -------------------------------------*/
22 | #ifndef __STM32F1xx_IT_H
23 | #define __STM32F1xx_IT_H
24 |
25 | #ifdef __cplusplus
26 | extern "C" {
27 | #endif
28 |
29 | /* Private includes ----------------------------------------------------------*/
30 | /* USER CODE BEGIN Includes */
31 |
32 | /* USER CODE END Includes */
33 |
34 | /* Exported types ------------------------------------------------------------*/
35 | /* USER CODE BEGIN ET */
36 |
37 | /* USER CODE END ET */
38 |
39 | /* Exported constants --------------------------------------------------------*/
40 | /* USER CODE BEGIN EC */
41 |
42 | /* USER CODE END EC */
43 |
44 | /* Exported macro ------------------------------------------------------------*/
45 | /* USER CODE BEGIN EM */
46 |
47 | /* USER CODE END EM */
48 |
49 | /* Exported functions prototypes ---------------------------------------------*/
50 | void NMI_Handler(void);
51 | void HardFault_Handler(void);
52 | void MemManage_Handler(void);
53 | void BusFault_Handler(void);
54 | void UsageFault_Handler(void);
55 | void DebugMon_Handler(void);
56 | void DMA1_Channel6_IRQHandler(void);
57 | void TIM2_IRQHandler(void);
58 | void USART2_IRQHandler(void);
59 | /* USER CODE BEGIN EFP */
60 |
61 | /* USER CODE END EFP */
62 |
63 | #ifdef __cplusplus
64 | }
65 | #endif
66 |
67 | #endif /* __STM32F1xx_IT_H */
68 |
69 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
70 |
--------------------------------------------------------------------------------
/Inc/usart.h:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : USART.h
4 | * Description : This file provides code for the configuration
5 | * of the USART instances.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* Define to prevent recursive inclusion -------------------------------------*/
20 | #ifndef __usart_H
21 | #define __usart_H
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | /* Includes ------------------------------------------------------------------*/
27 | #include "main.h"
28 |
29 | /* USER CODE BEGIN Includes */
30 |
31 | /* USER CODE END Includes */
32 |
33 | extern UART_HandleTypeDef huart1;
34 | extern UART_HandleTypeDef huart2;
35 |
36 | /* USER CODE BEGIN Private defines */
37 |
38 | /* USER CODE END Private defines */
39 |
40 | void MX_USART1_UART_Init(void);
41 | void MX_USART2_UART_Init(void);
42 |
43 | /* USER CODE BEGIN Prototypes */
44 |
45 | /* USER CODE END Prototypes */
46 |
47 | #ifdef __cplusplus
48 | }
49 | #endif
50 | #endif /*__ usart_H */
51 |
52 | /**
53 | * @}
54 | */
55 |
56 | /**
57 | * @}
58 | */
59 |
60 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
61 |
--------------------------------------------------------------------------------
/MDK-ARM/ATFramework/ExtDll.iex:
--------------------------------------------------------------------------------
1 | [EXTDLL]
2 | Count=0
3 |
--------------------------------------------------------------------------------
/MDK-ARM/DebugConfig/ATFramework_STM32F103ZE_1.0.0.dbgconf:
--------------------------------------------------------------------------------
1 | // File: STM32F101_102_103_105_107.dbgconf
2 | // Version: 1.0.0
3 | // Note: refer to STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx Reference manual (RM0008)
4 | // STM32F101xx STM32F102xx STM32F103xx STM32F105xx STM32F107xx datasheets
5 |
6 | // <<< Use Configuration Wizard in Context Menu >>>
7 |
8 | // Debug MCU configuration register (DBGMCU_CR)
9 | // Reserved bits must be kept at reset value
10 | // DBG_TIM11_STOP TIM11 counter stopped when core is halted
11 | // DBG_TIM10_STOP TIM10 counter stopped when core is halted
12 | // DBG_TIM9_STOP TIM9 counter stopped when core is halted
13 | // DBG_TIM14_STOP TIM14 counter stopped when core is halted
14 | // DBG_TIM13_STOP TIM13 counter stopped when core is halted
15 | // DBG_TIM12_STOP TIM12 counter stopped when core is halted
16 | // DBG_CAN2_STOP Debug CAN2 stopped when core is halted
17 | // DBG_TIM7_STOP TIM7 counter stopped when core is halted
18 | // DBG_TIM6_STOP TIM6 counter stopped when core is halted
19 | // DBG_TIM5_STOP TIM5 counter stopped when core is halted
20 | // DBG_TIM8_STOP TIM8 counter stopped when core is halted
21 | // DBG_I2C2_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
22 | // DBG_I2C1_SMBUS_TIMEOUT SMBUS timeout mode stopped when core is halted
23 | // DBG_CAN1_STOP Debug CAN1 stopped when Core is halted
24 | // DBG_TIM4_STOP TIM4 counter stopped when core is halted
25 | // DBG_TIM3_STOP TIM3 counter stopped when core is halted
26 | // DBG_TIM2_STOP TIM2 counter stopped when core is halted
27 | // DBG_TIM1_STOP TIM1 counter stopped when core is halted
28 | // DBG_WWDG_STOP Debug window watchdog stopped when core is halted
29 | // DBG_IWDG_STOP Debug independent watchdog stopped when core is halted
30 | // DBG_STANDBY Debug standby mode
31 | // DBG_STOP Debug stop mode
32 | // DBG_SLEEP Debug sleep mode
33 | //
34 | DbgMCU_CR = 0x00000007;
35 |
36 | // <<< end of configuration section >>>
37 |
--------------------------------------------------------------------------------
/MDK-ARM/EventRecorderStub.scvd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/MDK-ARM/JLinkLog.txt:
--------------------------------------------------------------------------------
1 |
2 | T0E9C 000:377 SEGGER J-Link V6.46 Log File (0013ms, 0173ms total)
3 | T0E9C 000:377 DLL Compiled: May 23 2019 17:49:56 (0013ms, 0173ms total)
4 | T0E9C 000:377 Logging started @ 2019-11-14 12:22 (0013ms, 0173ms total)
5 | T0E9C 000:390 JLINK_SetWarnOutHandler(...) (0004ms, 0177ms total)
6 | T0E9C 000:394 JLINK_OpenEx(...)
7 | Firmware: J-Link STLink V21 compiled May 4 2016 21:32:32
8 | Hardware: V1.00
9 | S/N: 770708918
10 | TELNET listener socket opened on port 19021WEBSRV
11 | Starting webserver (4915ms, 5092ms total)
12 | T0E9C 000:394 WEBSRV Webserver running on local port 19080 (4915ms, 5092ms total)
13 | T0E9C 000:394 returns O.K. (4915ms, 5092ms total)
14 | T0E9C 005:309 JLINK_GetEmuCaps() returns 0x98EA5A33 (0001ms, 5093ms total)
15 | T0E9C 005:310 JLINK_TIF_GetAvailable(...) (0019ms, 5112ms total)
16 | T0E9C 005:331 JLINK_SetErrorOutHandler(...) (0000ms, 5112ms total)
17 | T0E9C 005:331 JLINK_ExecCommand("ProjectFile = "E:\Documents\STM32\Socket\ATFramework\MDK-ARM\JLinkSettings.ini"", ...). returns 0x00 (0011ms, 5123ms total)
18 | T0E9C 005:342 JLINK_ExecCommand("Device = STM32F103ZE", ...). Device "STM32F103ZE" selected. returns 0x00 (0003ms, 5126ms total)
19 | T0E9C 005:345 JLINK_ExecCommand("DisableConnectionTimeout", ...). returns 0x01 (0000ms, 5126ms total)
20 | T0E9C 005:345 JLINK_GetHardwareVersion() returns 0x2710 (0000ms, 5126ms total)
21 | T0E9C 005:345 JLINK_GetDLLVersion() returns 64600 (0000ms, 5126ms total)
22 | T0E9C 005:345 JLINK_GetFirmwareString(...) (0000ms, 5126ms total)
23 | T0E9C 005:345 JLINK_GetDLLVersion() returns 64600 (0000ms, 5126ms total)
24 | T0E9C 005:345 JLINK_GetCompileDateTime() (0000ms, 5126ms total)
25 | T0E9C 005:345 JLINK_GetFirmwareString(...) (0000ms, 5126ms total)
26 | T0E9C 005:345 JLINK_GetHardwareVersion() returns 0x2710 (0000ms, 5126ms total)
27 | T0E9C 009:055 JLINK_TIF_Select(JLINKARM_TIF_JTAG)
28 | ***** Error: Debugger tries to select target interface JTAG.
29 | This interface is not supported by the connected emulator.
30 | Selection will be ignored by the DLL. returns 0x01 (0001ms, 5127ms total)
31 | T0E9C 009:056 JLINK_SetSpeed(5000) (0000ms, 5127ms total)
32 | T0E9C 009:056 JLINK_SetResetType(JLINKARM_RESET_TYPE_NORMAL) returns JLINKARM_RESET_TYPE_NORMAL (0000ms, 5127ms total)
33 | T0E9C 009:056 JLINK_Reset() >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>
34 | ***** Error: STM32: Connecting to CPU via connect under reset failed. >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF>
35 | >0x0D TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>
36 | ***** Error: STM32: Connecting to CPU via connect under reset failed.JLINK_GetId() >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>
37 | ***** Error: STM32: Connecting to CPU via connect under reset failed. >0x0D TIF>
38 | >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>
39 | ***** Error: STM32: Connecting to CPU via connect under reset failed. returns 0x00000000 (0708ms, 6874ms total)
40 | T0E9C 010:804 JLINK_GetId() >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>
41 | ***** Error: STM32: Connecting to CPU via connect under reset failed. >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x0D TIF> >0x10B TIF> >0x10F TIF> >0x10B TIF> >0x10F TIF>STM32 (connect): Can not attach to CPU. Trying connect under reset. >0x10B TIF>
42 | >0x10F TIF> >0x10B TIF> >0x10F TIF>
43 | ***** Error: STM32: Connecting to CPU via connect under reset failed. returns 0x00000000 (0708ms, 7582ms total)
44 | T0E9C 011:517 JLINK_GetFirmwareString(...) (0000ms, 7582ms total)
45 | T0E9C 013:223 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7583ms total)
46 | T0E9C 013:224 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7584ms total)
47 | T0E9C 013:225 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0002ms, 7586ms total)
48 | T0E9C 013:227 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7587ms total)
49 | T0E9C 013:228 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7588ms total)
50 | T0E9C 013:229 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7589ms total)
51 | T0E9C 013:230 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7590ms total)
52 | T0E9C 013:231 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7591ms total)
53 | T0E9C 013:232 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7592ms total)
54 | T0E9C 013:233 JLINK_SWO_Control(JLINKARM_SWO_CMD_GET_SPEED_INFO, ...) returns 0x00 (0001ms, 7593ms total)
55 | T0E9C 025:142 JLINK_Close() (0004ms, 7597ms total)
56 | T0E9C 025:142 (0004ms, 7597ms total)
57 | T0E9C 025:142 Closed (0004ms, 7597ms total)
58 |
--------------------------------------------------------------------------------
/MDK-ARM/JLinkSettings.ini:
--------------------------------------------------------------------------------
1 | [BREAKPOINTS]
2 | ForceImpTypeAny = 0
3 | ShowInfoWin = 1
4 | EnableFlashBP = 2
5 | BPDuringExecution = 0
6 | [CFI]
7 | CFISize = 0x00
8 | CFIAddr = 0x00
9 | [CPU]
10 | MonModeVTableAddr = 0xFFFFFFFF
11 | MonModeDebug = 0
12 | MaxNumAPs = 0
13 | LowPowerHandlingMode = 0
14 | OverrideMemMap = 0
15 | AllowSimulation = 1
16 | ScriptFile=""
17 | [FLASH]
18 | CacheExcludeSize = 0x00
19 | CacheExcludeAddr = 0x00
20 | MinNumBytesFlashDL = 0
21 | SkipProgOnCRCMatch = 1
22 | VerifyDownload = 1
23 | AllowCaching = 1
24 | EnableFlashDL = 2
25 | Override = 0
26 | Device="ARM7"
27 | [GENERAL]
28 | WorkRAMSize = 0x00
29 | WorkRAMAddr = 0x00
30 | RAMUsageLimit = 0x00
31 | [SWO]
32 | SWOLogFile=""
33 | [MEM]
34 | RdOverrideOrMask = 0x00
35 | RdOverrideAndMask = 0xFFFFFFFF
36 | RdOverrideAddr = 0xFFFFFFFF
37 | WrOverrideOrMask = 0x00
38 | WrOverrideAndMask = 0xFFFFFFFF
39 | WrOverrideAddr = 0xFFFFFFFF
40 |
--------------------------------------------------------------------------------
/MDK-ARM/RTE/_ATFramework/RTE_Components.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * Auto generated Run-Time-Environment Configuration File
4 | * *** Do not modify ! ***
5 | *
6 | * Project: 'ATFramework'
7 | * Target: 'ATFramework'
8 | */
9 |
10 | #ifndef RTE_COMPONENTS_H
11 | #define RTE_COMPONENTS_H
12 |
13 |
14 | /*
15 | * Define the Device Header File:
16 | */
17 | #define CMSIS_device_header "stm32f10x.h"
18 |
19 |
20 |
21 | #endif /* RTE_COMPONENTS_H */
22 |
--------------------------------------------------------------------------------
/MDK-ARM/cmb_fault.lst:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | ARM Macro Assembler Page 1
5 |
6 |
7 | 1 00000000 ;/*
8 | 2 00000000 ; * This file is part of the CmBacktrace Library.
9 | 3 00000000 ; *
10 | 4 00000000 ; * Copyright (c) 2016, Armink,
11 | 5 00000000 ; *
12 | 6 00000000 ; * Permission is hereby granted, free of charge, to any
13 | person obtaining
14 | 7 00000000 ; * a copy of this software and associated documentation
15 | files (the
16 | 8 00000000 ; * 'Software'), to deal in the Software without restric
17 | tion, including
18 | 9 00000000 ; * without limitation the rights to use, copy, modify,
19 | merge, publish,
20 | 10 00000000 ; * distribute, sublicense, and/or sell copies of the So
21 | ftware, and to
22 | 11 00000000 ; * permit persons to whom the Software is furnished to
23 | do so, subject to
24 | 12 00000000 ; * the following conditions:
25 | 13 00000000 ; *
26 | 14 00000000 ; * The above copyright notice and this permission notic
27 | e shall be
28 | 15 00000000 ; * included in all copies or substantial portions of th
29 | e Software.
30 | 16 00000000 ; *
31 | 17 00000000 ; * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY O
32 | F ANY KIND,
33 | 18 00000000 ; * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
34 | WARRANTIES OF
35 | 19 00000000 ; * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AN
36 | D NONINFRINGEMENT.
37 | 20 00000000 ; * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS B
38 | E LIABLE FOR ANY
39 | 21 00000000 ; * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACT
40 | ION OF CONTRACT,
41 | 22 00000000 ; * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC
42 | TION WITH THE
43 | 23 00000000 ; * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWAR
44 | E.
45 | 24 00000000 ; *
46 | 25 00000000 ; * Function: Fault handler by MDK-ARM assembly code
47 | 26 00000000 ; * Created on: 2016-12-16
48 | 27 00000000 ; */
49 | 28 00000000
50 | 29 00000000 AREA |.text|, CODE, READONLY, ALIGN=
51 | 2
52 | 30 00000000 THUMB
53 | 31 00000000 REQUIRE8
54 | 32 00000000 PRESERVE8
55 | 33 00000000
56 | 34 00000000 ; NOTE: If use this file's HardFault_Handler, please com
57 | ments the HardFault_Handler code on other file.
58 | 35 00000000 IMPORT cm_backtrace_fault
59 | 36 00000000 EXPORT HardFault_Handler
60 | 37 00000000
61 | 38 00000000 HardFault_Handler
62 | PROC
63 | 39 00000000 4670 MOV r0, lr ; get lr
64 | 40 00000002 4669 MOV r1, sp ; get stack pointer
65 | (current is MSP)
66 |
67 |
68 |
69 | ARM Macro Assembler Page 2
70 |
71 |
72 | 41 00000004 F7FF FFFE BL cm_backtrace_fault
73 | 42 00000008
74 | 43 00000008 Fault_Loop
75 | 44 00000008 F7FF FFFE BL Fault_Loop ;while(1)
76 | 45 0000000C ENDP
77 | 46 0000000C
78 | 47 0000000C END
79 | Command Line: --debug --xref --diag_suppress=9931 --cpu=Cortex-M3 --apcs=interw
80 | ork --depend=atframework\cmb_fault.d -oatframework\cmb_fault.o -I..\\Inc -I.\RT
81 | E\_ATFramework -I"E:\Program Files\keil_V5\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Inc
82 | lude" -I"E:\Program Files\keil_V5\Packs\Keil\STM32F1xx_DFP\2.3.0\Device\Include
83 | " --predefine="__MICROLIB SETA 1" --predefine="__UVISION_VERSION SETA 528" --pr
84 | edefine="_RTE_ SETA 1" --predefine="STM32F10X_HD SETA 1" --list=cmb_fault.lst .
85 | .\User\LOG\cmb_fault.S
86 |
87 |
88 |
89 | ARM Macro Assembler Page 1 Alphabetic symbol ordering
90 | Relocatable symbols
91 |
92 | .text 00000000
93 |
94 | Symbol: .text
95 | Definitions
96 | At line 29 in file ..\User\LOG\cmb_fault.S
97 | Uses
98 | None
99 | Comment: .text unused
100 | Fault_Loop 00000008
101 |
102 | Symbol: Fault_Loop
103 | Definitions
104 | At line 43 in file ..\User\LOG\cmb_fault.S
105 | Uses
106 | At line 44 in file ..\User\LOG\cmb_fault.S
107 | Comment: Fault_Loop used once
108 | HardFault_Handler 00000000
109 |
110 | Symbol: HardFault_Handler
111 | Definitions
112 | At line 38 in file ..\User\LOG\cmb_fault.S
113 | Uses
114 | At line 36 in file ..\User\LOG\cmb_fault.S
115 | Comment: HardFault_Handler used once
116 | 3 symbols
117 |
118 |
119 |
120 | ARM Macro Assembler Page 1 Alphabetic symbol ordering
121 | External symbols
122 |
123 | cm_backtrace_fault 00000000
124 |
125 | Symbol: cm_backtrace_fault
126 | Definitions
127 | At line 35 in file ..\User\LOG\cmb_fault.S
128 | Uses
129 | At line 41 in file ..\User\LOG\cmb_fault.S
130 | Comment: cm_backtrace_fault used once
131 | 1 symbol
132 | 338 symbols in table
133 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 | #ifndef STACK_MACROS_H
71 | #define STACK_MACROS_H
72 |
73 | /*
74 | * Call the stack overflow hook function if the stack of the task being swapped
75 | * out is currently overflowed, or looks like it might have overflowed in the
76 | * past.
77 | *
78 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check
79 | * the current stack state only - comparing the current top of stack value to
80 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1
81 | * will also cause the last few stack bytes to be checked to ensure the value
82 | * to which the bytes were set when the task was created have not been
83 | * overwritten. Note this second test does not guarantee that an overflowed
84 | * stack will always be recognised.
85 | */
86 |
87 | /*-----------------------------------------------------------*/
88 |
89 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) )
90 |
91 | /* Only the current stack state is to be checked. */
92 | #define taskCHECK_FOR_STACK_OVERFLOW() \
93 | { \
94 | /* Is the currently saved stack pointer within the stack limit? */ \
95 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \
96 | { \
97 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
98 | } \
99 | }
100 |
101 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
102 | /*-----------------------------------------------------------*/
103 |
104 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) )
105 |
106 | /* Only the current stack state is to be checked. */
107 | #define taskCHECK_FOR_STACK_OVERFLOW() \
108 | { \
109 | \
110 | /* Is the currently saved stack pointer within the stack limit? */ \
111 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \
112 | { \
113 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
114 | } \
115 | }
116 |
117 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */
118 | /*-----------------------------------------------------------*/
119 |
120 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) )
121 |
122 | #define taskCHECK_FOR_STACK_OVERFLOW() \
123 | { \
124 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \
125 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \
126 | \
127 | if( ( pulStack[ 0 ] != ulCheckValue ) || \
128 | ( pulStack[ 1 ] != ulCheckValue ) || \
129 | ( pulStack[ 2 ] != ulCheckValue ) || \
130 | ( pulStack[ 3 ] != ulCheckValue ) ) \
131 | { \
132 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
133 | } \
134 | }
135 |
136 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
137 | /*-----------------------------------------------------------*/
138 |
139 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) )
140 |
141 | #define taskCHECK_FOR_STACK_OVERFLOW() \
142 | { \
143 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \
144 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
145 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
146 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
147 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \
148 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \
149 | \
150 | \
151 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \
152 | \
153 | /* Has the extremity of the task stack ever been written over? */ \
154 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \
155 | { \
156 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \
157 | } \
158 | }
159 |
160 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */
161 | /*-----------------------------------------------------------*/
162 |
163 | /* Remove stack overflow macro if not being used. */
164 | #ifndef taskCHECK_FOR_STACK_OVERFLOW
165 | #define taskCHECK_FOR_STACK_OVERFLOW()
166 | #endif
167 |
168 |
169 |
170 | #endif /* STACK_MACROS_H */
171 |
172 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/include/deprecated_definitions.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 | #ifndef DEPRECATED_DEFINITIONS_H
71 | #define DEPRECATED_DEFINITIONS_H
72 |
73 |
74 | /* Each FreeRTOS port has a unique portmacro.h header file. Originally a
75 | pre-processor definition was used to ensure the pre-processor found the correct
76 | portmacro.h file for the port being used. That scheme was deprecated in favour
77 | of setting the compiler's include path such that it found the correct
78 | portmacro.h file - removing the need for the constant and allowing the
79 | portmacro.h file to be located anywhere in relation to the port being used. The
80 | definitions below remain in the code for backward compatibility only. New
81 | projects should not use them. */
82 |
83 | #ifdef OPEN_WATCOM_INDUSTRIAL_PC_PORT
84 | #include "..\..\Source\portable\owatcom\16bitdos\pc\portmacro.h"
85 | typedef void ( __interrupt __far *pxISR )();
86 | #endif
87 |
88 | #ifdef OPEN_WATCOM_FLASH_LITE_186_PORT
89 | #include "..\..\Source\portable\owatcom\16bitdos\flsh186\portmacro.h"
90 | typedef void ( __interrupt __far *pxISR )();
91 | #endif
92 |
93 | #ifdef GCC_MEGA_AVR
94 | #include "../portable/GCC/ATMega323/portmacro.h"
95 | #endif
96 |
97 | #ifdef IAR_MEGA_AVR
98 | #include "../portable/IAR/ATMega323/portmacro.h"
99 | #endif
100 |
101 | #ifdef MPLAB_PIC24_PORT
102 | #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
103 | #endif
104 |
105 | #ifdef MPLAB_DSPIC_PORT
106 | #include "../../Source/portable/MPLAB/PIC24_dsPIC/portmacro.h"
107 | #endif
108 |
109 | #ifdef MPLAB_PIC18F_PORT
110 | #include "../../Source/portable/MPLAB/PIC18F/portmacro.h"
111 | #endif
112 |
113 | #ifdef MPLAB_PIC32MX_PORT
114 | #include "../../Source/portable/MPLAB/PIC32MX/portmacro.h"
115 | #endif
116 |
117 | #ifdef _FEDPICC
118 | #include "libFreeRTOS/Include/portmacro.h"
119 | #endif
120 |
121 | #ifdef SDCC_CYGNAL
122 | #include "../../Source/portable/SDCC/Cygnal/portmacro.h"
123 | #endif
124 |
125 | #ifdef GCC_ARM7
126 | #include "../../Source/portable/GCC/ARM7_LPC2000/portmacro.h"
127 | #endif
128 |
129 | #ifdef GCC_ARM7_ECLIPSE
130 | #include "portmacro.h"
131 | #endif
132 |
133 | #ifdef ROWLEY_LPC23xx
134 | #include "../../Source/portable/GCC/ARM7_LPC23xx/portmacro.h"
135 | #endif
136 |
137 | #ifdef IAR_MSP430
138 | #include "..\..\Source\portable\IAR\MSP430\portmacro.h"
139 | #endif
140 |
141 | #ifdef GCC_MSP430
142 | #include "../../Source/portable/GCC/MSP430F449/portmacro.h"
143 | #endif
144 |
145 | #ifdef ROWLEY_MSP430
146 | #include "../../Source/portable/Rowley/MSP430F449/portmacro.h"
147 | #endif
148 |
149 | #ifdef ARM7_LPC21xx_KEIL_RVDS
150 | #include "..\..\Source\portable\RVDS\ARM7_LPC21xx\portmacro.h"
151 | #endif
152 |
153 | #ifdef SAM7_GCC
154 | #include "../../Source/portable/GCC/ARM7_AT91SAM7S/portmacro.h"
155 | #endif
156 |
157 | #ifdef SAM7_IAR
158 | #include "..\..\Source\portable\IAR\AtmelSAM7S64\portmacro.h"
159 | #endif
160 |
161 | #ifdef SAM9XE_IAR
162 | #include "..\..\Source\portable\IAR\AtmelSAM9XE\portmacro.h"
163 | #endif
164 |
165 | #ifdef LPC2000_IAR
166 | #include "..\..\Source\portable\IAR\LPC2000\portmacro.h"
167 | #endif
168 |
169 | #ifdef STR71X_IAR
170 | #include "..\..\Source\portable\IAR\STR71x\portmacro.h"
171 | #endif
172 |
173 | #ifdef STR75X_IAR
174 | #include "..\..\Source\portable\IAR\STR75x\portmacro.h"
175 | #endif
176 |
177 | #ifdef STR75X_GCC
178 | #include "..\..\Source\portable\GCC\STR75x\portmacro.h"
179 | #endif
180 |
181 | #ifdef STR91X_IAR
182 | #include "..\..\Source\portable\IAR\STR91x\portmacro.h"
183 | #endif
184 |
185 | #ifdef GCC_H8S
186 | #include "../../Source/portable/GCC/H8S2329/portmacro.h"
187 | #endif
188 |
189 | #ifdef GCC_AT91FR40008
190 | #include "../../Source/portable/GCC/ARM7_AT91FR40008/portmacro.h"
191 | #endif
192 |
193 | #ifdef RVDS_ARMCM3_LM3S102
194 | #include "../../Source/portable/RVDS/ARM_CM3/portmacro.h"
195 | #endif
196 |
197 | #ifdef GCC_ARMCM3_LM3S102
198 | #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
199 | #endif
200 |
201 | #ifdef GCC_ARMCM3
202 | #include "../../Source/portable/GCC/ARM_CM3/portmacro.h"
203 | #endif
204 |
205 | #ifdef IAR_ARM_CM3
206 | #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
207 | #endif
208 |
209 | #ifdef IAR_ARMCM3_LM
210 | #include "../../Source/portable/IAR/ARM_CM3/portmacro.h"
211 | #endif
212 |
213 | #ifdef HCS12_CODE_WARRIOR
214 | #include "../../Source/portable/CodeWarrior/HCS12/portmacro.h"
215 | #endif
216 |
217 | #ifdef MICROBLAZE_GCC
218 | #include "../../Source/portable/GCC/MicroBlaze/portmacro.h"
219 | #endif
220 |
221 | #ifdef TERN_EE
222 | #include "..\..\Source\portable\Paradigm\Tern_EE\small\portmacro.h"
223 | #endif
224 |
225 | #ifdef GCC_HCS12
226 | #include "../../Source/portable/GCC/HCS12/portmacro.h"
227 | #endif
228 |
229 | #ifdef GCC_MCF5235
230 | #include "../../Source/portable/GCC/MCF5235/portmacro.h"
231 | #endif
232 |
233 | #ifdef COLDFIRE_V2_GCC
234 | #include "../../../Source/portable/GCC/ColdFire_V2/portmacro.h"
235 | #endif
236 |
237 | #ifdef COLDFIRE_V2_CODEWARRIOR
238 | #include "../../Source/portable/CodeWarrior/ColdFire_V2/portmacro.h"
239 | #endif
240 |
241 | #ifdef GCC_PPC405
242 | #include "../../Source/portable/GCC/PPC405_Xilinx/portmacro.h"
243 | #endif
244 |
245 | #ifdef GCC_PPC440
246 | #include "../../Source/portable/GCC/PPC440_Xilinx/portmacro.h"
247 | #endif
248 |
249 | #ifdef _16FX_SOFTUNE
250 | #include "..\..\Source\portable\Softune\MB96340\portmacro.h"
251 | #endif
252 |
253 | #ifdef BCC_INDUSTRIAL_PC_PORT
254 | /* A short file name has to be used in place of the normal
255 | FreeRTOSConfig.h when using the Borland compiler. */
256 | #include "frconfig.h"
257 | #include "..\portable\BCC\16BitDOS\PC\prtmacro.h"
258 | typedef void ( __interrupt __far *pxISR )();
259 | #endif
260 |
261 | #ifdef BCC_FLASH_LITE_186_PORT
262 | /* A short file name has to be used in place of the normal
263 | FreeRTOSConfig.h when using the Borland compiler. */
264 | #include "frconfig.h"
265 | #include "..\portable\BCC\16BitDOS\flsh186\prtmacro.h"
266 | typedef void ( __interrupt __far *pxISR )();
267 | #endif
268 |
269 | #ifdef __GNUC__
270 | #ifdef __AVR32_AVR32A__
271 | #include "portmacro.h"
272 | #endif
273 | #endif
274 |
275 | #ifdef __ICCAVR32__
276 | #ifdef __CORE__
277 | #if __CORE__ == __AVR32A__
278 | #include "portmacro.h"
279 | #endif
280 | #endif
281 | #endif
282 |
283 | #ifdef __91467D
284 | #include "portmacro.h"
285 | #endif
286 |
287 | #ifdef __96340
288 | #include "portmacro.h"
289 | #endif
290 |
291 |
292 | #ifdef __IAR_V850ES_Fx3__
293 | #include "../../Source/portable/IAR/V850ES/portmacro.h"
294 | #endif
295 |
296 | #ifdef __IAR_V850ES_Jx3__
297 | #include "../../Source/portable/IAR/V850ES/portmacro.h"
298 | #endif
299 |
300 | #ifdef __IAR_V850ES_Jx3_L__
301 | #include "../../Source/portable/IAR/V850ES/portmacro.h"
302 | #endif
303 |
304 | #ifdef __IAR_V850ES_Jx2__
305 | #include "../../Source/portable/IAR/V850ES/portmacro.h"
306 | #endif
307 |
308 | #ifdef __IAR_V850ES_Hx2__
309 | #include "../../Source/portable/IAR/V850ES/portmacro.h"
310 | #endif
311 |
312 | #ifdef __IAR_78K0R_Kx3__
313 | #include "../../Source/portable/IAR/78K0R/portmacro.h"
314 | #endif
315 |
316 | #ifdef __IAR_78K0R_Kx3L__
317 | #include "../../Source/portable/IAR/78K0R/portmacro.h"
318 | #endif
319 |
320 | #endif /* DEPRECATED_DEFINITIONS_H */
321 |
322 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/include/mpu_wrappers.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 | #ifndef MPU_WRAPPERS_H
71 | #define MPU_WRAPPERS_H
72 |
73 | /* This file redefines API functions to be called through a wrapper macro, but
74 | only for ports that are using the MPU. */
75 | #ifdef portUSING_MPU_WRAPPERS
76 |
77 | /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE will be defined when this file is
78 | included from queue.c or task.c to prevent it from having an effect within
79 | those files. */
80 | #ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
81 |
82 | /*
83 | * Map standard (non MPU) API functions to equivalents that start
84 | * "MPU_". This will cause the application code to call the MPU_
85 | * version, which wraps the non-MPU version with privilege promoting
86 | * then demoting code, so the kernel code always runs will full
87 | * privileges.
88 | */
89 |
90 | /* Map standard tasks.h API functions to the MPU equivalents. */
91 | #define xTaskCreate MPU_xTaskCreate
92 | #define xTaskCreateStatic MPU_xTaskCreateStatic
93 | #define xTaskCreateRestricted MPU_xTaskCreateRestricted
94 | #define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
95 | #define vTaskDelete MPU_vTaskDelete
96 | #define vTaskDelay MPU_vTaskDelay
97 | #define vTaskDelayUntil MPU_vTaskDelayUntil
98 | #define xTaskAbortDelay MPU_xTaskAbortDelay
99 | #define uxTaskPriorityGet MPU_uxTaskPriorityGet
100 | #define eTaskGetState MPU_eTaskGetState
101 | #define vTaskGetInfo MPU_vTaskGetInfo
102 | #define vTaskPrioritySet MPU_vTaskPrioritySet
103 | #define vTaskSuspend MPU_vTaskSuspend
104 | #define vTaskResume MPU_vTaskResume
105 | #define vTaskSuspendAll MPU_vTaskSuspendAll
106 | #define xTaskResumeAll MPU_xTaskResumeAll
107 | #define xTaskGetTickCount MPU_xTaskGetTickCount
108 | #define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
109 | #define pcTaskGetName MPU_pcTaskGetName
110 | #define xTaskGetHandle MPU_xTaskGetHandle
111 | #define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
112 | #define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
113 | #define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
114 | #define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
115 | #define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
116 | #define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
117 | #define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
118 | #define uxTaskGetSystemState MPU_uxTaskGetSystemState
119 | #define vTaskList MPU_vTaskList
120 | #define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
121 | #define xTaskGenericNotify MPU_xTaskGenericNotify
122 | #define xTaskNotifyWait MPU_xTaskNotifyWait
123 | #define ulTaskNotifyTake MPU_ulTaskNotifyTake
124 | #define xTaskNotifyStateClear MPU_xTaskNotifyStateClear
125 |
126 | #define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
127 | #define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
128 | #define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
129 | #define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
130 |
131 | /* Map standard queue.h API functions to the MPU equivalents. */
132 | #define xQueueGenericSend MPU_xQueueGenericSend
133 | #define xQueueGenericReceive MPU_xQueueGenericReceive
134 | #define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
135 | #define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
136 | #define vQueueDelete MPU_vQueueDelete
137 | #define xQueueCreateMutex MPU_xQueueCreateMutex
138 | #define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
139 | #define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
140 | #define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
141 | #define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
142 | #define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
143 | #define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
144 | #define xQueueGenericCreate MPU_xQueueGenericCreate
145 | #define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
146 | #define xQueueCreateSet MPU_xQueueCreateSet
147 | #define xQueueAddToSet MPU_xQueueAddToSet
148 | #define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
149 | #define xQueueSelectFromSet MPU_xQueueSelectFromSet
150 | #define xQueueGenericReset MPU_xQueueGenericReset
151 |
152 | #if( configQUEUE_REGISTRY_SIZE > 0 )
153 | #define vQueueAddToRegistry MPU_vQueueAddToRegistry
154 | #define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
155 | #define pcQueueGetName MPU_pcQueueGetName
156 | #endif
157 |
158 | /* Map standard timer.h API functions to the MPU equivalents. */
159 | #define xTimerCreate MPU_xTimerCreate
160 | #define xTimerCreateStatic MPU_xTimerCreateStatic
161 | #define pvTimerGetTimerID MPU_pvTimerGetTimerID
162 | #define vTimerSetTimerID MPU_vTimerSetTimerID
163 | #define xTimerIsTimerActive MPU_xTimerIsTimerActive
164 | #define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
165 | #define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
166 | #define pcTimerGetName MPU_pcTimerGetName
167 | #define xTimerGetPeriod MPU_xTimerGetPeriod
168 | #define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
169 | #define xTimerGenericCommand MPU_xTimerGenericCommand
170 |
171 | /* Map standard event_group.h API functions to the MPU equivalents. */
172 | #define xEventGroupCreate MPU_xEventGroupCreate
173 | #define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
174 | #define xEventGroupWaitBits MPU_xEventGroupWaitBits
175 | #define xEventGroupClearBits MPU_xEventGroupClearBits
176 | #define xEventGroupSetBits MPU_xEventGroupSetBits
177 | #define xEventGroupSync MPU_xEventGroupSync
178 | #define vEventGroupDelete MPU_vEventGroupDelete
179 |
180 | /* Remove the privileged function macro. */
181 | #define PRIVILEGED_FUNCTION
182 |
183 | #else /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
184 |
185 | /* Ensure API functions go in the privileged execution section. */
186 | #define PRIVILEGED_FUNCTION __attribute__((section("privileged_functions")))
187 | #define PRIVILEGED_DATA __attribute__((section("privileged_data")))
188 |
189 | #endif /* MPU_WRAPPERS_INCLUDED_FROM_API_FILE */
190 |
191 | #else /* portUSING_MPU_WRAPPERS */
192 |
193 | #define PRIVILEGED_FUNCTION
194 | #define PRIVILEGED_DATA
195 | #define portUSING_MPU_WRAPPERS 0
196 |
197 | #endif /* portUSING_MPU_WRAPPERS */
198 |
199 |
200 | #endif /* MPU_WRAPPERS_H */
201 |
202 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/include/portable.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 | /*-----------------------------------------------------------
71 | * Portable layer API. Each function must be defined for each port.
72 | *----------------------------------------------------------*/
73 |
74 | #ifndef PORTABLE_H
75 | #define PORTABLE_H
76 |
77 | /* Each FreeRTOS port has a unique portmacro.h header file. Originally a
78 | pre-processor definition was used to ensure the pre-processor found the correct
79 | portmacro.h file for the port being used. That scheme was deprecated in favour
80 | of setting the compiler's include path such that it found the correct
81 | portmacro.h file - removing the need for the constant and allowing the
82 | portmacro.h file to be located anywhere in relation to the port being used.
83 | Purely for reasons of backward compatibility the old method is still valid, but
84 | to make it clear that new projects should not use it, support for the port
85 | specific constants has been moved into the deprecated_definitions.h header
86 | file. */
87 | #include "deprecated_definitions.h"
88 |
89 | /* If portENTER_CRITICAL is not defined then including deprecated_definitions.h
90 | did not result in a portmacro.h header file being included - and it should be
91 | included here. In this case the path to the correct portmacro.h header file
92 | must be set in the compiler's include path. */
93 | #ifndef portENTER_CRITICAL
94 | #include "portmacro.h"
95 | #endif
96 |
97 | #if portBYTE_ALIGNMENT == 32
98 | #define portBYTE_ALIGNMENT_MASK ( 0x001f )
99 | #endif
100 |
101 | #if portBYTE_ALIGNMENT == 16
102 | #define portBYTE_ALIGNMENT_MASK ( 0x000f )
103 | #endif
104 |
105 | #if portBYTE_ALIGNMENT == 8
106 | #define portBYTE_ALIGNMENT_MASK ( 0x0007 )
107 | #endif
108 |
109 | #if portBYTE_ALIGNMENT == 4
110 | #define portBYTE_ALIGNMENT_MASK ( 0x0003 )
111 | #endif
112 |
113 | #if portBYTE_ALIGNMENT == 2
114 | #define portBYTE_ALIGNMENT_MASK ( 0x0001 )
115 | #endif
116 |
117 | #if portBYTE_ALIGNMENT == 1
118 | #define portBYTE_ALIGNMENT_MASK ( 0x0000 )
119 | #endif
120 |
121 | #ifndef portBYTE_ALIGNMENT_MASK
122 | #error "Invalid portBYTE_ALIGNMENT definition"
123 | #endif
124 |
125 | #ifndef portNUM_CONFIGURABLE_REGIONS
126 | #define portNUM_CONFIGURABLE_REGIONS 1
127 | #endif
128 |
129 | #ifdef __cplusplus
130 | extern "C" {
131 | #endif
132 |
133 | #include "mpu_wrappers.h"
134 |
135 | /*
136 | * Setup the stack of a new task so it is ready to be placed under the
137 | * scheduler control. The registers have to be placed on the stack in
138 | * the order that the port expects to find them.
139 | *
140 | */
141 | #if( portUSING_MPU_WRAPPERS == 1 )
142 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters, BaseType_t xRunPrivileged ) PRIVILEGED_FUNCTION;
143 | #else
144 | StackType_t *pxPortInitialiseStack( StackType_t *pxTopOfStack, TaskFunction_t pxCode, void *pvParameters ) PRIVILEGED_FUNCTION;
145 | #endif
146 |
147 | /* Used by heap_5.c. */
148 | typedef struct HeapRegion
149 | {
150 | uint8_t *pucStartAddress;
151 | size_t xSizeInBytes;
152 | } HeapRegion_t;
153 |
154 | /*
155 | * Used to define multiple heap regions for use by heap_5.c. This function
156 | * must be called before any calls to pvPortMalloc() - not creating a task,
157 | * queue, semaphore, mutex, software timer, event group, etc. will result in
158 | * pvPortMalloc being called.
159 | *
160 | * pxHeapRegions passes in an array of HeapRegion_t structures - each of which
161 | * defines a region of memory that can be used as the heap. The array is
162 | * terminated by a HeapRegions_t structure that has a size of 0. The region
163 | * with the lowest start address must appear first in the array.
164 | */
165 | void vPortDefineHeapRegions( const HeapRegion_t * const pxHeapRegions ) PRIVILEGED_FUNCTION;
166 |
167 |
168 | /*
169 | * Map to the memory management routines required for the port.
170 | */
171 | void *pvPortMalloc( size_t xSize ) PRIVILEGED_FUNCTION;
172 | void vPortFree( void *pv ) PRIVILEGED_FUNCTION;
173 | void vPortInitialiseBlocks( void ) PRIVILEGED_FUNCTION;
174 | size_t xPortGetFreeHeapSize( void ) PRIVILEGED_FUNCTION;
175 | size_t xPortGetMinimumEverFreeHeapSize( void ) PRIVILEGED_FUNCTION;
176 |
177 | /*
178 | * Setup the hardware ready for the scheduler to take control. This generally
179 | * sets up a tick interrupt and sets timers for the correct tick frequency.
180 | */
181 | BaseType_t xPortStartScheduler( void ) PRIVILEGED_FUNCTION;
182 |
183 | /*
184 | * Undo any hardware/ISR setup that was performed by xPortStartScheduler() so
185 | * the hardware is left in its original condition after the scheduler stops
186 | * executing.
187 | */
188 | void vPortEndScheduler( void ) PRIVILEGED_FUNCTION;
189 |
190 | /*
191 | * The structures and methods of manipulating the MPU are contained within the
192 | * port layer.
193 | *
194 | * Fills the xMPUSettings structure with the memory region information
195 | * contained in xRegions.
196 | */
197 | #if( portUSING_MPU_WRAPPERS == 1 )
198 | struct xMEMORY_REGION;
199 | void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint32_t ulStackDepth ) PRIVILEGED_FUNCTION;
200 | #endif
201 |
202 | #ifdef __cplusplus
203 | }
204 | #endif
205 |
206 | #endif /* PORTABLE_H */
207 |
208 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 | #ifndef PROJDEFS_H
71 | #define PROJDEFS_H
72 |
73 | /*
74 | * Defines the prototype to which task functions must conform. Defined in this
75 | * file to ensure the type is known before portable.h is included.
76 | */
77 | typedef void (*TaskFunction_t)( void * );
78 |
79 | /* Converts a time in milliseconds to a time in ticks. This macro can be
80 | overridden by a macro of the same name defined in FreeRTOSConfig.h in case the
81 | definition here is not suitable for your application. */
82 | #ifndef pdMS_TO_TICKS
83 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) )
84 | #endif
85 |
86 | #define pdFALSE ( ( BaseType_t ) 0 )
87 | #define pdTRUE ( ( BaseType_t ) 1 )
88 |
89 | #define pdPASS ( pdTRUE )
90 | #define pdFAIL ( pdFALSE )
91 | #define errQUEUE_EMPTY ( ( BaseType_t ) 0 )
92 | #define errQUEUE_FULL ( ( BaseType_t ) 0 )
93 |
94 | /* FreeRTOS error definitions. */
95 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 )
96 | #define errQUEUE_BLOCKED ( -4 )
97 | #define errQUEUE_YIELD ( -5 )
98 |
99 | /* Macros used for basic data corruption checks. */
100 | #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES
101 | #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0
102 | #endif
103 |
104 | #if( configUSE_16_BIT_TICKS == 1 )
105 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a
106 | #else
107 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL
108 | #endif
109 |
110 | /* The following errno values are used by FreeRTOS+ components, not FreeRTOS
111 | itself. */
112 | #define pdFREERTOS_ERRNO_NONE 0 /* No errors */
113 | #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */
114 | #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */
115 | #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */
116 | #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */
117 | #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */
118 | #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */
119 | #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */
120 | #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */
121 | #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */
122 | #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */
123 | #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */
124 | #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */
125 | #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */
126 | #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */
127 | #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */
128 | #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */
129 | #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */
130 | #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */
131 | #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */
132 | #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */
133 | #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */
134 | #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */
135 | #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */
136 | #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */
137 | #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */
138 | #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */
139 | #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
140 | #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */
141 | #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */
142 | #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */
143 | #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */
144 | #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */
145 | #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */
146 | #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */
147 | #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */
148 | #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */
149 | #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */
150 | #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */
151 | #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */
152 |
153 | /* The following endian values are used by FreeRTOS+ components, not FreeRTOS
154 | itself. */
155 | #define pdFREERTOS_LITTLE_ENDIAN 0
156 | #define pdFREERTOS_BIG_ENDIAN 1
157 |
158 | #endif /* PROJDEFS_H */
159 |
160 |
161 |
162 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/list.c:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 |
71 | #include
72 | #include "FreeRTOS.h"
73 | #include "list.h"
74 |
75 | /*-----------------------------------------------------------
76 | * PUBLIC LIST API documented in list.h
77 | *----------------------------------------------------------*/
78 |
79 | void vListInitialise( List_t * const pxList )
80 | {
81 | /* The list structure contains a list item which is used to mark the
82 | end of the list. To initialise the list the list end is inserted
83 | as the only list entry. */
84 | pxList->pxIndex = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
85 |
86 | /* The list end value is the highest possible value in the list to
87 | ensure it remains at the end of the list. */
88 | pxList->xListEnd.xItemValue = portMAX_DELAY;
89 |
90 | /* The list end next and previous pointers point to itself so we know
91 | when the list is empty. */
92 | pxList->xListEnd.pxNext = ( ListItem_t * ) &( pxList->xListEnd ); /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
93 | pxList->xListEnd.pxPrevious = ( ListItem_t * ) &( pxList->xListEnd );/*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
94 |
95 | pxList->uxNumberOfItems = ( UBaseType_t ) 0U;
96 |
97 | /* Write known values into the list if
98 | configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
99 | listSET_LIST_INTEGRITY_CHECK_1_VALUE( pxList );
100 | listSET_LIST_INTEGRITY_CHECK_2_VALUE( pxList );
101 | }
102 | /*-----------------------------------------------------------*/
103 |
104 | void vListInitialiseItem( ListItem_t * const pxItem )
105 | {
106 | /* Make sure the list item is not recorded as being on a list. */
107 | pxItem->pvContainer = NULL;
108 |
109 | /* Write known values into the list item if
110 | configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES is set to 1. */
111 | listSET_FIRST_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
112 | listSET_SECOND_LIST_ITEM_INTEGRITY_CHECK_VALUE( pxItem );
113 | }
114 | /*-----------------------------------------------------------*/
115 |
116 | void vListInsertEnd( List_t * const pxList, ListItem_t * const pxNewListItem )
117 | {
118 | ListItem_t * const pxIndex = pxList->pxIndex;
119 |
120 | /* Only effective when configASSERT() is also defined, these tests may catch
121 | the list data structures being overwritten in memory. They will not catch
122 | data errors caused by incorrect configuration or use of FreeRTOS. */
123 | listTEST_LIST_INTEGRITY( pxList );
124 | listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
125 |
126 | /* Insert a new list item into pxList, but rather than sort the list,
127 | makes the new list item the last item to be removed by a call to
128 | listGET_OWNER_OF_NEXT_ENTRY(). */
129 | pxNewListItem->pxNext = pxIndex;
130 | pxNewListItem->pxPrevious = pxIndex->pxPrevious;
131 |
132 | /* Only used during decision coverage testing. */
133 | mtCOVERAGE_TEST_DELAY();
134 |
135 | pxIndex->pxPrevious->pxNext = pxNewListItem;
136 | pxIndex->pxPrevious = pxNewListItem;
137 |
138 | /* Remember which list the item is in. */
139 | pxNewListItem->pvContainer = ( void * ) pxList;
140 |
141 | ( pxList->uxNumberOfItems )++;
142 | }
143 | /*-----------------------------------------------------------*/
144 |
145 | void vListInsert( List_t * const pxList, ListItem_t * const pxNewListItem )
146 | {
147 | ListItem_t *pxIterator;
148 | const TickType_t xValueOfInsertion = pxNewListItem->xItemValue;
149 |
150 | /* Only effective when configASSERT() is also defined, these tests may catch
151 | the list data structures being overwritten in memory. They will not catch
152 | data errors caused by incorrect configuration or use of FreeRTOS. */
153 | listTEST_LIST_INTEGRITY( pxList );
154 | listTEST_LIST_ITEM_INTEGRITY( pxNewListItem );
155 |
156 | /* Insert the new list item into the list, sorted in xItemValue order.
157 |
158 | If the list already contains a list item with the same item value then the
159 | new list item should be placed after it. This ensures that TCB's which are
160 | stored in ready lists (all of which have the same xItemValue value) get a
161 | share of the CPU. However, if the xItemValue is the same as the back marker
162 | the iteration loop below will not end. Therefore the value is checked
163 | first, and the algorithm slightly modified if necessary. */
164 | if( xValueOfInsertion == portMAX_DELAY )
165 | {
166 | pxIterator = pxList->xListEnd.pxPrevious;
167 | }
168 | else
169 | {
170 | /* *** NOTE ***********************************************************
171 | If you find your application is crashing here then likely causes are
172 | listed below. In addition see http://www.freertos.org/FAQHelp.html for
173 | more tips, and ensure configASSERT() is defined!
174 | http://www.freertos.org/a00110.html#configASSERT
175 |
176 | 1) Stack overflow -
177 | see http://www.freertos.org/Stacks-and-stack-overflow-checking.html
178 | 2) Incorrect interrupt priority assignment, especially on Cortex-M
179 | parts where numerically high priority values denote low actual
180 | interrupt priorities, which can seem counter intuitive. See
181 | http://www.freertos.org/RTOS-Cortex-M3-M4.html and the definition
182 | of configMAX_SYSCALL_INTERRUPT_PRIORITY on
183 | http://www.freertos.org/a00110.html
184 | 3) Calling an API function from within a critical section or when
185 | the scheduler is suspended, or calling an API function that does
186 | not end in "FromISR" from an interrupt.
187 | 4) Using a queue or semaphore before it has been initialised or
188 | before the scheduler has been started (are interrupts firing
189 | before vTaskStartScheduler() has been called?).
190 | **********************************************************************/
191 |
192 | for( pxIterator = ( ListItem_t * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM. This is checked and valid. */
193 | {
194 | /* There is nothing to do here, just iterating to the wanted
195 | insertion position. */
196 | }
197 | }
198 |
199 | pxNewListItem->pxNext = pxIterator->pxNext;
200 | pxNewListItem->pxNext->pxPrevious = pxNewListItem;
201 | pxNewListItem->pxPrevious = pxIterator;
202 | pxIterator->pxNext = pxNewListItem;
203 |
204 | /* Remember which list the item is in. This allows fast removal of the
205 | item later. */
206 | pxNewListItem->pvContainer = ( void * ) pxList;
207 |
208 | ( pxList->uxNumberOfItems )++;
209 | }
210 | /*-----------------------------------------------------------*/
211 |
212 | UBaseType_t uxListRemove( ListItem_t * const pxItemToRemove )
213 | {
214 | /* The list item knows which list it is in. Obtain the list from the list
215 | item. */
216 | List_t * const pxList = ( List_t * ) pxItemToRemove->pvContainer;
217 |
218 | pxItemToRemove->pxNext->pxPrevious = pxItemToRemove->pxPrevious;
219 | pxItemToRemove->pxPrevious->pxNext = pxItemToRemove->pxNext;
220 |
221 | /* Only used during decision coverage testing. */
222 | mtCOVERAGE_TEST_DELAY();
223 |
224 | /* Make sure the index is left pointing to a valid item. */
225 | if( pxList->pxIndex == pxItemToRemove )
226 | {
227 | pxList->pxIndex = pxItemToRemove->pxPrevious;
228 | }
229 | else
230 | {
231 | mtCOVERAGE_TEST_MARKER();
232 | }
233 |
234 | pxItemToRemove->pvContainer = NULL;
235 | ( pxList->uxNumberOfItems )--;
236 |
237 | return pxList->uxNumberOfItems;
238 | }
239 | /*-----------------------------------------------------------*/
240 |
241 |
--------------------------------------------------------------------------------
/Middlewares/Third_Party/FreeRTOS/Source/portable/RVDS/ARM_CM3/portmacro.h:
--------------------------------------------------------------------------------
1 | /*
2 | FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
3 | All rights reserved
4 |
5 | VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
6 |
7 | This file is part of the FreeRTOS distribution.
8 |
9 | FreeRTOS is free software; you can redistribute it and/or modify it under
10 | the terms of the GNU General Public License (version 2) as published by the
11 | Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
12 |
13 | ***************************************************************************
14 | >>! NOTE: The modification to the GPL is included to allow you to !<<
15 | >>! distribute a combined work that includes FreeRTOS without being !<<
16 | >>! obliged to provide the source code for proprietary components !<<
17 | >>! outside of the FreeRTOS kernel. !<<
18 | ***************************************************************************
19 |
20 | FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
21 | WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22 | FOR A PARTICULAR PURPOSE. Full license text is available on the following
23 | link: http://www.freertos.org/a00114.html
24 |
25 | ***************************************************************************
26 | * *
27 | * FreeRTOS provides completely free yet professionally developed, *
28 | * robust, strictly quality controlled, supported, and cross *
29 | * platform software that is more than just the market leader, it *
30 | * is the industry's de facto standard. *
31 | * *
32 | * Help yourself get started quickly while simultaneously helping *
33 | * to support the FreeRTOS project by purchasing a FreeRTOS *
34 | * tutorial book, reference manual, or both: *
35 | * http://www.FreeRTOS.org/Documentation *
36 | * *
37 | ***************************************************************************
38 |
39 | http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
40 | the FAQ page "My application does not run, what could be wrong?". Have you
41 | defined configASSERT()?
42 |
43 | http://www.FreeRTOS.org/support - In return for receiving this top quality
44 | embedded software for free we request you assist our global community by
45 | participating in the support forum.
46 |
47 | http://www.FreeRTOS.org/training - Investing in training allows your team to
48 | be as productive as possible as early as possible. Now you can receive
49 | FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
50 | Ltd, and the world's leading authority on the world's leading RTOS.
51 |
52 | http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
53 | including FreeRTOS+Trace - an indispensable productivity tool, a DOS
54 | compatible FAT file system, and our tiny thread aware UDP/IP stack.
55 |
56 | http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
57 | Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
58 |
59 | http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
60 | Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
61 | licenses offer ticketed support, indemnification and commercial middleware.
62 |
63 | http://www.SafeRTOS.com - High Integrity Systems also provide a safety
64 | engineered and independently SIL3 certified version for use in safety and
65 | mission critical applications that require provable dependability.
66 |
67 | 1 tab == 4 spaces!
68 | */
69 |
70 |
71 | #ifndef PORTMACRO_H
72 | #define PORTMACRO_H
73 |
74 | #ifdef __cplusplus
75 | extern "C" {
76 | #endif
77 |
78 | /*-----------------------------------------------------------
79 | * Port specific definitions.
80 | *
81 | * The settings in this file configure FreeRTOS correctly for the
82 | * given hardware and compiler.
83 | *
84 | * These settings should not be altered.
85 | *-----------------------------------------------------------
86 | */
87 |
88 | /* Type definitions. */
89 | #define portCHAR char
90 | #define portFLOAT float
91 | #define portDOUBLE double
92 | #define portLONG long
93 | #define portSHORT short
94 | #define portSTACK_TYPE uint32_t
95 | #define portBASE_TYPE long
96 |
97 | typedef portSTACK_TYPE StackType_t;
98 | typedef long BaseType_t;
99 | typedef unsigned long UBaseType_t;
100 |
101 | #if( configUSE_16_BIT_TICKS == 1 )
102 | typedef uint16_t TickType_t;
103 | #define portMAX_DELAY ( TickType_t ) 0xffff
104 | #else
105 | typedef uint32_t TickType_t;
106 | #define portMAX_DELAY ( TickType_t ) 0xffffffffUL
107 |
108 | /* 32-bit tick type on a 32-bit architecture, so reads of the tick count do
109 | not need to be guarded with a critical section. */
110 | #define portTICK_TYPE_IS_ATOMIC 1
111 | #endif
112 | /*-----------------------------------------------------------*/
113 |
114 | /* Architecture specifics. */
115 | #define portSTACK_GROWTH ( -1 )
116 | #define portTICK_PERIOD_MS ( ( TickType_t ) 1000 / configTICK_RATE_HZ )
117 | #define portBYTE_ALIGNMENT 8
118 |
119 | /* Constants used with memory barrier intrinsics. */
120 | #define portSY_FULL_READ_WRITE ( 15 )
121 |
122 | /*-----------------------------------------------------------*/
123 |
124 | /* Scheduler utilities. */
125 | #define portYIELD() \
126 | { \
127 | /* Set a PendSV to request a context switch. */ \
128 | portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT; \
129 | \
130 | /* Barriers are normally not required but do ensure the code is completely \
131 | within the specified behaviour for the architecture. */ \
132 | __dsb( portSY_FULL_READ_WRITE ); \
133 | __isb( portSY_FULL_READ_WRITE ); \
134 | }
135 | /*-----------------------------------------------------------*/
136 |
137 | #define portNVIC_INT_CTRL_REG ( * ( ( volatile uint32_t * ) 0xe000ed04 ) )
138 | #define portNVIC_PENDSVSET_BIT ( 1UL << 28UL )
139 | #define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired != pdFALSE ) portYIELD()
140 | #define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
141 | /*-----------------------------------------------------------*/
142 |
143 | /* Critical section management. */
144 | extern void vPortEnterCritical( void );
145 | extern void vPortExitCritical( void );
146 |
147 | #define portDISABLE_INTERRUPTS() vPortRaiseBASEPRI()
148 | #define portENABLE_INTERRUPTS() vPortSetBASEPRI( 0 )
149 | #define portENTER_CRITICAL() vPortEnterCritical()
150 | #define portEXIT_CRITICAL() vPortExitCritical()
151 | #define portSET_INTERRUPT_MASK_FROM_ISR() ulPortRaiseBASEPRI()
152 | #define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortSetBASEPRI(x)
153 |
154 | /*-----------------------------------------------------------*/
155 |
156 | /* Tickless idle/low power functionality. */
157 | #ifndef portSUPPRESS_TICKS_AND_SLEEP
158 | extern void vPortSuppressTicksAndSleep( TickType_t xExpectedIdleTime );
159 | #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )
160 | #endif
161 | /*-----------------------------------------------------------*/
162 |
163 | /* Port specific optimisations. */
164 | #ifndef configUSE_PORT_OPTIMISED_TASK_SELECTION
165 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
166 | #endif
167 |
168 | #if configUSE_PORT_OPTIMISED_TASK_SELECTION == 1
169 |
170 | /* Check the configuration. */
171 | #if( configMAX_PRIORITIES > 32 )
172 | #error configUSE_PORT_OPTIMISED_TASK_SELECTION can only be set to 1 when configMAX_PRIORITIES is less than or equal to 32. It is very rare that a system requires more than 10 to 15 difference priorities as tasks that share a priority will time slice.
173 | #endif
174 |
175 | /* Store/clear the ready priorities in a bit map. */
176 | #define portRECORD_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) |= ( 1UL << ( uxPriority ) )
177 | #define portRESET_READY_PRIORITY( uxPriority, uxReadyPriorities ) ( uxReadyPriorities ) &= ~( 1UL << ( uxPriority ) )
178 |
179 | /*-----------------------------------------------------------*/
180 |
181 | #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) __clz( ( uxReadyPriorities ) ) )
182 |
183 | #endif /* taskRECORD_READY_PRIORITY */
184 | /*-----------------------------------------------------------*/
185 |
186 | /* Task function macros as described on the FreeRTOS.org WEB site. These are
187 | not necessary for to use this port. They are defined so the common demo files
188 | (which build with all the ports) will build. */
189 | #define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
190 | #define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
191 | /*-----------------------------------------------------------*/
192 |
193 | #ifdef configASSERT
194 | void vPortValidateInterruptPriority( void );
195 | #define portASSERT_IF_INTERRUPT_PRIORITY_INVALID() vPortValidateInterruptPriority()
196 | #endif
197 |
198 | /* portNOP() is not required by this port. */
199 | #define portNOP()
200 |
201 | #define portINLINE __inline
202 |
203 | #ifndef portFORCE_INLINE
204 | #define portFORCE_INLINE __forceinline
205 | #endif
206 |
207 | /*-----------------------------------------------------------*/
208 |
209 | static portFORCE_INLINE void vPortSetBASEPRI( uint32_t ulBASEPRI )
210 | {
211 | __asm
212 | {
213 | /* Barrier instructions are not used as this function is only used to
214 | lower the BASEPRI value. */
215 | msr basepri, ulBASEPRI
216 | }
217 | }
218 | /*-----------------------------------------------------------*/
219 |
220 | static portFORCE_INLINE void vPortRaiseBASEPRI( void )
221 | {
222 | uint32_t ulNewBASEPRI = configMAX_SYSCALL_INTERRUPT_PRIORITY;
223 |
224 | __asm
225 | {
226 | /* Set BASEPRI to the max syscall priority to effect a critical
227 | section. */
228 | msr basepri, ulNewBASEPRI
229 | dsb
230 | isb
231 | }
232 | }
233 | /*-----------------------------------------------------------*/
234 |
235 | static portFORCE_INLINE void vPortClearBASEPRIFromISR( void )
236 | {
237 | __asm
238 | {
239 | /* Set BASEPRI to 0 so no interrupts are masked. This function is only
240 | used to lower the mask in an interrupt, so memory barriers are not
241 | used. */
242 | msr basepri, #0
243 | }
244 | }
245 | /*-----------------------------------------------------------*/
246 |
247 | static portFORCE_INLINE uint32_t ulPortRaiseBASEPRI( void )
248 | {
249 | uint32_t ulReturn, ulNewBASEPRI = configMAX_SYSCALL_INTERRUPT_PRIORITY;
250 |
251 | __asm
252 | {
253 | /* Set BASEPRI to the max syscall priority to effect a critical
254 | section. */
255 | mrs ulReturn, basepri
256 | msr basepri, ulNewBASEPRI
257 | dsb
258 | isb
259 | }
260 |
261 | return ulReturn;
262 | }
263 | /*-----------------------------------------------------------*/
264 |
265 | static portFORCE_INLINE BaseType_t xPortIsInsideInterrupt( void )
266 | {
267 | uint32_t ulCurrentInterrupt;
268 | BaseType_t xReturn;
269 |
270 | /* Obtain the number of the currently executing interrupt. */
271 | __asm
272 | {
273 | mrs ulCurrentInterrupt, ipsr
274 | }
275 |
276 | if( ulCurrentInterrupt == 0 )
277 | {
278 | xReturn = pdFALSE;
279 | }
280 | else
281 | {
282 | xReturn = pdTRUE;
283 | }
284 |
285 | return xReturn;
286 | }
287 |
288 |
289 | #ifdef __cplusplus
290 | }
291 | #endif
292 |
293 | #endif /* PORTMACRO_H */
294 |
295 |
--------------------------------------------------------------------------------
/Src/dma.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : dma.c
4 | * Description : This file provides code for the configuration
5 | * of all the requested memory to memory DMA transfers.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* Includes ------------------------------------------------------------------*/
20 | #include "dma.h"
21 |
22 | /* USER CODE BEGIN 0 */
23 |
24 | /* USER CODE END 0 */
25 |
26 | /*----------------------------------------------------------------------------*/
27 | /* Configure DMA */
28 | /*----------------------------------------------------------------------------*/
29 |
30 | /* USER CODE BEGIN 1 */
31 |
32 | /* USER CODE END 1 */
33 |
34 | /**
35 | * Enable DMA controller clock
36 | */
37 | void MX_DMA_Init(void)
38 | {
39 | /* DMA controller clock enable */
40 | __HAL_RCC_DMA1_CLK_ENABLE();
41 |
42 | /* DMA interrupt init */
43 | /* DMA1_Channel6_IRQn interrupt configuration */
44 | HAL_NVIC_SetPriority(DMA1_Channel6_IRQn, 5, 0);
45 | HAL_NVIC_EnableIRQ(DMA1_Channel6_IRQn);
46 |
47 | }
48 |
49 | /* USER CODE BEGIN 2 */
50 |
51 | /* USER CODE END 2 */
52 |
53 | /**
54 | * @}
55 | */
56 |
57 | /**
58 | * @}
59 | */
60 |
61 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
62 |
--------------------------------------------------------------------------------
/Src/freertos.c:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * File Name : freertos.c
5 | * Description : Code for freertos applications
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* USER CODE END Header */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "FreeRTOS.h"
23 | #include "task.h"
24 | #include "main.h"
25 | #include "cmsis_os.h"
26 |
27 | /* Private includes ----------------------------------------------------------*/
28 | /* USER CODE BEGIN Includes */
29 | #include
30 | #include "main.h"
31 | #include "AT.h"
32 |
33 | /* USER CODE END Includes */
34 |
35 | /* Private typedef -----------------------------------------------------------*/
36 | /* USER CODE BEGIN PTD */
37 |
38 | /* USER CODE END PTD */
39 |
40 | /* Private define ------------------------------------------------------------*/
41 | /* USER CODE BEGIN PD */
42 |
43 | /* USER CODE END PD */
44 |
45 | /* Private macro -------------------------------------------------------------*/
46 | /* USER CODE BEGIN PM */
47 |
48 | /* USER CODE END PM */
49 |
50 | /* Private variables ---------------------------------------------------------*/
51 | /* USER CODE BEGIN Variables */
52 |
53 |
54 | /* USER CODE END Variables */
55 | osThreadId defaultTaskHandle;
56 | osThreadId LedTaskHandle;
57 | osThreadId ATTaskHandle;
58 |
59 | /* Private function prototypes -----------------------------------------------*/
60 | /* USER CODE BEGIN FunctionPrototypes */
61 |
62 |
63 | /* USER CODE END FunctionPrototypes */
64 |
65 | void StartDefaultTask(void const * argument);
66 | void LEDStartTask(void const * argument);
67 | void ATStartTask(void const * argument);
68 |
69 | void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */
70 |
71 | /**
72 | * @brief FreeRTOS initialization
73 | * @param None
74 | * @retval None
75 | */
76 | void MX_FREERTOS_Init(void) {
77 | /* USER CODE BEGIN Init */
78 |
79 | /* USER CODE END Init */
80 |
81 | /* USER CODE BEGIN RTOS_MUTEX */
82 | /* add mutexes, ... */
83 | /* USER CODE END RTOS_MUTEX */
84 |
85 | /* USER CODE BEGIN RTOS_SEMAPHORES */
86 | /* add semaphores, ... */
87 | /* USER CODE END RTOS_SEMAPHORES */
88 |
89 | /* USER CODE BEGIN RTOS_TIMERS */
90 | /* start timers, add new ones, ... */
91 | /* USER CODE END RTOS_TIMERS */
92 |
93 | /* USER CODE BEGIN RTOS_QUEUES */
94 | /* add queues, ... */
95 |
96 |
97 | /* USER CODE END RTOS_QUEUES */
98 |
99 | /* Create the thread(s) */
100 | /* definition and creation of defaultTask */
101 | osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128);
102 | defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
103 |
104 | /* definition and creation of LedTask */
105 | osThreadDef(LedTask, LEDStartTask, osPriorityLow, 0, 128);
106 | LedTaskHandle = osThreadCreate(osThread(LedTask), NULL);
107 |
108 | /* definition and creation of ATTask */
109 | osThreadDef(ATTask, ATStartTask, osPriorityNormal, 0, 128);
110 | ATTaskHandle = osThreadCreate(osThread(ATTask), NULL);
111 |
112 | /* USER CODE BEGIN RTOS_THREADS */
113 | /* add threads, ... */
114 |
115 | /* USER CODE END RTOS_THREADS */
116 |
117 | }
118 |
119 | /* USER CODE BEGIN Header_StartDefaultTask */
120 | /**
121 | * @brief Function implementing the defaultTask thread.
122 | * @param argument: Not used
123 | * @retval None
124 | */
125 | /* USER CODE END Header_StartDefaultTask */
126 | void StartDefaultTask(void const * argument)
127 | {
128 |
129 | /* USER CODE BEGIN StartDefaultTask */
130 | /* Infinite loop */
131 | for(;;)
132 | {
133 | HAL_GPIO_TogglePin(GPIOE,GPIO_PIN_5);
134 | osDelay(200);
135 |
136 | }
137 | /* USER CODE END StartDefaultTask */
138 | }
139 |
140 | /* USER CODE BEGIN Header_LEDStartTask */
141 | /**
142 | * @brief Function implementing the LedyTask thread.
143 | * @param argument: Not used
144 | * @retval None
145 | */
146 | /* USER CODE END Header_LEDStartTask */
147 | void LEDStartTask(void const * argument)
148 | {
149 | /* USER CODE BEGIN LEDStartTask */
150 |
151 | ATCommandRegister(AT,EXEXCMD,NULL);
152 | ATCommandRegister(CSQ,EXEXCMD,NULL);
153 | ATCommandRegister(CGATT,WRITECMD,"1");
154 | ATCommandRegister(NSOCR,WRITECMD,"STREAM,6,4587,1,AF_INET");
155 | ATCommandRegister(NSOCO,WRITECMD,"1,180.97.81.180,58152");
156 | /* Infinite loop */
157 | for(;;)
158 | {
159 |
160 | ATCommandRegister(NSOSD,WRITECMD,"1,4,31323334");
161 | osDelay(5000);
162 | }
163 | /* USER CODE END LEDStartTask */
164 | }
165 |
166 | /* USER CODE BEGIN Header_ATStartTask */
167 | /**
168 | * @brief Function implementing the ATTask thread.
169 | * @param argument: Not used
170 | * @retval None
171 | */
172 | /* USER CODE END Header_ATStartTask */
173 | void ATStartTask(void const * argument)
174 | {
175 | /* USER CODE BEGIN ATStartTask */
176 | /* Infinite loop */
177 | for(;;)
178 | {
179 | ATCommandSendScheduler();
180 | // uint8_t ch[2];
181 | // ring_buffer *rb;
182 | // rb_init(rb,128,ch);
183 | }
184 | /* USER CODE END ATStartTask */
185 | }
186 |
187 | /* Private application code --------------------------------------------------*/
188 | /* USER CODE BEGIN Application */
189 |
190 | /* USER CODE END Application */
191 |
192 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
193 |
--------------------------------------------------------------------------------
/Src/gpio.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : gpio.c
4 | * Description : This file provides code for the configuration
5 | * of all used GPIO pins.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 |
20 | /* Includes ------------------------------------------------------------------*/
21 | #include "gpio.h"
22 | /* USER CODE BEGIN 0 */
23 |
24 | /* USER CODE END 0 */
25 |
26 | /*----------------------------------------------------------------------------*/
27 | /* Configure GPIO */
28 | /*----------------------------------------------------------------------------*/
29 | /* USER CODE BEGIN 1 */
30 |
31 | /* USER CODE END 1 */
32 |
33 | /** Configure pins as
34 | * Analog
35 | * Input
36 | * Output
37 | * EVENT_OUT
38 | * EXTI
39 | */
40 | void MX_GPIO_Init(void)
41 | {
42 |
43 | GPIO_InitTypeDef GPIO_InitStruct = {0};
44 |
45 | /* GPIO Ports Clock Enable */
46 | __HAL_RCC_GPIOE_CLK_ENABLE();
47 | __HAL_RCC_GPIOA_CLK_ENABLE();
48 | __HAL_RCC_GPIOB_CLK_ENABLE();
49 |
50 | /*Configure GPIO pin Output Level */
51 | HAL_GPIO_WritePin(GPIOE, GPIO_PIN_5, GPIO_PIN_RESET);
52 |
53 | /*Configure GPIO pin Output Level */
54 | HAL_GPIO_WritePin(GPIOB, GPIO_PIN_5, GPIO_PIN_RESET);
55 |
56 | /*Configure GPIO pin : PE5 */
57 | GPIO_InitStruct.Pin = GPIO_PIN_5;
58 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
59 | GPIO_InitStruct.Pull = GPIO_NOPULL;
60 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
61 | HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
62 |
63 | /*Configure GPIO pin : PB5 */
64 | GPIO_InitStruct.Pin = GPIO_PIN_5;
65 | GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
66 | GPIO_InitStruct.Pull = GPIO_NOPULL;
67 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
68 | HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
69 |
70 | }
71 |
72 | /* USER CODE BEGIN 2 */
73 |
74 | /* USER CODE END 2 */
75 |
76 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
77 |
--------------------------------------------------------------------------------
/Src/main.c:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * @file : main.c
5 | * @brief : Main program body
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* USER CODE END Header */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "main.h"
23 | #include "cmsis_os.h"
24 | #include "dma.h"
25 | #include "usart.h"
26 | #include "gpio.h"
27 |
28 | /* Private includes ----------------------------------------------------------*/
29 | /* USER CODE BEGIN Includes */
30 | #include "Hardware.h"
31 | #include
32 |
33 | #define HARDWARE_VERSION "V1.0.0"
34 | #define SOFTWARE_VERSION "V0.1.0"
35 |
36 | /* USER CODE END Includes */
37 |
38 | /* Private typedef -----------------------------------------------------------*/
39 | /* USER CODE BEGIN PTD */
40 |
41 | /* USER CODE END PTD */
42 |
43 | /* Private define ------------------------------------------------------------*/
44 | /* USER CODE BEGIN PD */
45 |
46 | /* USER CODE END PD */
47 |
48 | /* Private macro -------------------------------------------------------------*/
49 | /* USER CODE BEGIN PM */
50 |
51 | /* USER CODE END PM */
52 |
53 | /* Private variables ---------------------------------------------------------*/
54 |
55 | /* USER CODE BEGIN PV */
56 |
57 | /* USER CODE END PV */
58 |
59 | /* Private function prototypes -----------------------------------------------*/
60 | void SystemClock_Config(void);
61 | void MX_FREERTOS_Init(void);
62 | /* USER CODE BEGIN PFP */
63 |
64 | /* USER CODE END PFP */
65 |
66 | /* Private user code ---------------------------------------------------------*/
67 | /* USER CODE BEGIN 0 */
68 |
69 | /* USER CODE END 0 */
70 |
71 | /**
72 | * @brief The application entry point.
73 | * @retval int
74 | */
75 | int main(void)
76 | {
77 | /* USER CODE BEGIN 1 */
78 |
79 | /* USER CODE END 1 */
80 |
81 |
82 | /* MCU Configuration--------------------------------------------------------*/
83 |
84 | /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
85 | HAL_Init();
86 |
87 | /* USER CODE BEGIN Init */
88 |
89 | /* USER CODE END Init */
90 |
91 | /* Configure the system clock */
92 | SystemClock_Config();
93 |
94 | /* USER CODE BEGIN SysInit */
95 |
96 | /* USER CODE END SysInit */
97 |
98 | /* Initialize all configured peripherals */
99 | MX_GPIO_Init();
100 | MX_DMA_Init();
101 | MX_USART1_UART_Init();
102 | MX_USART2_UART_Init();
103 | /* USER CODE BEGIN 2 */
104 | // cm_backtrace_init("ATFramework", HARDWARE_VERSION, SOFTWARE_VERSION);
105 | printf("System initialize finish. Starting..\r\n");
106 | ATFormInit();
107 |
108 | /* USER CODE END 2 */
109 |
110 | /* Call init function for freertos objects (in freertos.c) */
111 | MX_FREERTOS_Init();
112 |
113 | /* Start scheduler */
114 | osKernelStart();
115 |
116 | /* We should never get here as control is now taken by the scheduler */
117 |
118 | /* Infinite loop */
119 | /* USER CODE BEGIN WHILE */
120 | while (1)
121 | {
122 | /* USER CODE END WHILE */
123 |
124 | /* USER CODE BEGIN 3 */
125 | }
126 | /* USER CODE END 3 */
127 | }
128 |
129 | /**
130 | * @brief System Clock Configuration
131 | * @retval None
132 | */
133 | void SystemClock_Config(void)
134 | {
135 | RCC_OscInitTypeDef RCC_OscInitStruct = {0};
136 | RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
137 |
138 | /** Initializes the CPU, AHB and APB busses clocks
139 | */
140 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
141 | RCC_OscInitStruct.HSEState = RCC_HSE_ON;
142 | RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
143 | RCC_OscInitStruct.HSIState = RCC_HSI_ON;
144 | RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
145 | RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
146 | RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
147 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
148 | {
149 | Error_Handler();
150 | }
151 | /** Initializes the CPU, AHB and APB busses clocks
152 | */
153 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
154 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
155 | RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
156 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
157 | RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
158 | RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
159 |
160 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
161 | {
162 | Error_Handler();
163 | }
164 | }
165 |
166 | /* USER CODE BEGIN 4 */
167 |
168 | /* USER CODE END 4 */
169 |
170 | /**
171 | * @brief Period elapsed callback in non blocking mode
172 | * @note This function is called when TIM2 interrupt took place, inside
173 | * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
174 | * a global variable "uwTick" used as application time base.
175 | * @param htim : TIM handle
176 | * @retval None
177 | */
178 | void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
179 | {
180 | /* USER CODE BEGIN Callback 0 */
181 |
182 | /* USER CODE END Callback 0 */
183 | if (htim->Instance == TIM2) {
184 | HAL_IncTick();
185 | }
186 | /* USER CODE BEGIN Callback 1 */
187 |
188 | /* USER CODE END Callback 1 */
189 | }
190 |
191 | /**
192 | * @brief This function is executed in case of error occurrence.
193 | * @retval None
194 | */
195 | void Error_Handler(void)
196 | {
197 | /* USER CODE BEGIN Error_Handler_Debug */
198 | /* User can add his own implementation to report the HAL error return state */
199 |
200 | /* USER CODE END Error_Handler_Debug */
201 | }
202 |
203 | #ifdef USE_FULL_ASSERT
204 | /**
205 | * @brief Reports the name of the source file and the source line number
206 | * where the assert_param error has occurred.
207 | * @param file: pointer to the source file name
208 | * @param line: assert_param error line source number
209 | * @retval None
210 | */
211 | void assert_failed(uint8_t *file, uint32_t line)
212 | {
213 | /* USER CODE BEGIN 6 */
214 | /* User can add his own implementation to report the file name and line number,
215 | tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
216 | /* USER CODE END 6 */
217 | }
218 | #endif /* USE_FULL_ASSERT */
219 |
220 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
221 |
--------------------------------------------------------------------------------
/Src/stm32f1xx_hal_msp.c:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * File Name : stm32f1xx_hal_msp.c
5 | * Description : This file provides code for the MSP Initialization
6 | * and de-Initialization codes.
7 | ******************************************************************************
8 | * @attention
9 | *
10 | * © Copyright (c) 2019 STMicroelectronics.
11 | * All rights reserved.
12 | *
13 | * This software component is licensed by ST under Ultimate Liberty license
14 | * SLA0044, the "License"; You may not use this file except in compliance with
15 | * the License. You may obtain a copy of the License at:
16 | * www.st.com/SLA0044
17 | *
18 | ******************************************************************************
19 | */
20 | /* USER CODE END Header */
21 |
22 | /* Includes ------------------------------------------------------------------*/
23 | #include "main.h"
24 | /* USER CODE BEGIN Includes */
25 |
26 | /* USER CODE END Includes */
27 |
28 | /* Private typedef -----------------------------------------------------------*/
29 | /* USER CODE BEGIN TD */
30 |
31 | /* USER CODE END TD */
32 |
33 | /* Private define ------------------------------------------------------------*/
34 | /* USER CODE BEGIN Define */
35 |
36 | /* USER CODE END Define */
37 |
38 | /* Private macro -------------------------------------------------------------*/
39 | /* USER CODE BEGIN Macro */
40 |
41 | /* USER CODE END Macro */
42 |
43 | /* Private variables ---------------------------------------------------------*/
44 | /* USER CODE BEGIN PV */
45 |
46 | /* USER CODE END PV */
47 |
48 | /* Private function prototypes -----------------------------------------------*/
49 | /* USER CODE BEGIN PFP */
50 |
51 | /* USER CODE END PFP */
52 |
53 | /* External functions --------------------------------------------------------*/
54 | /* USER CODE BEGIN ExternalFunctions */
55 |
56 | /* USER CODE END ExternalFunctions */
57 |
58 | /* USER CODE BEGIN 0 */
59 |
60 | /* USER CODE END 0 */
61 | /**
62 | * Initializes the Global MSP.
63 | */
64 | void HAL_MspInit(void)
65 | {
66 | /* USER CODE BEGIN MspInit 0 */
67 |
68 | /* USER CODE END MspInit 0 */
69 |
70 | __HAL_RCC_AFIO_CLK_ENABLE();
71 | __HAL_RCC_PWR_CLK_ENABLE();
72 |
73 | /* System interrupt init*/
74 | /* PendSV_IRQn interrupt configuration */
75 | HAL_NVIC_SetPriority(PendSV_IRQn, 15, 0);
76 |
77 | /** NOJTAG: JTAG-DP Disabled and SW-DP Enabled
78 | */
79 | __HAL_AFIO_REMAP_SWJ_NOJTAG();
80 |
81 | /* USER CODE BEGIN MspInit 1 */
82 |
83 | /* USER CODE END MspInit 1 */
84 | }
85 |
86 | /* USER CODE BEGIN 1 */
87 |
88 | /* USER CODE END 1 */
89 |
90 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
91 |
--------------------------------------------------------------------------------
/Src/stm32f1xx_hal_timebase_tim.c:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * @file stm32f1xx_hal_timebase_TIM.c
5 | * @brief HAL time base based on the hardware TIM.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* USER CODE END Header */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "stm32f1xx_hal.h"
23 | #include "stm32f1xx_hal_tim.h"
24 |
25 | /* Private typedef -----------------------------------------------------------*/
26 | /* Private define ------------------------------------------------------------*/
27 | /* Private macro -------------------------------------------------------------*/
28 | /* Private variables ---------------------------------------------------------*/
29 | TIM_HandleTypeDef htim2;
30 | /* Private function prototypes -----------------------------------------------*/
31 | /* Private functions ---------------------------------------------------------*/
32 |
33 | /**
34 | * @brief This function configures the TIM2 as a time base source.
35 | * The time source is configured to have 1ms time base with a dedicated
36 | * Tick interrupt priority.
37 | * @note This function is called automatically at the beginning of program after
38 | * reset by HAL_Init() or at any time when clock is configured, by HAL_RCC_ClockConfig().
39 | * @param TickPriority: Tick interrupt priority.
40 | * @retval HAL status
41 | */
42 | HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
43 | {
44 | RCC_ClkInitTypeDef clkconfig;
45 | uint32_t uwTimclock = 0;
46 | uint32_t uwPrescalerValue = 0;
47 | uint32_t pFLatency;
48 |
49 | /*Configure the TIM2 IRQ priority */
50 | HAL_NVIC_SetPriority(TIM2_IRQn, TickPriority ,0);
51 |
52 | /* Enable the TIM2 global Interrupt */
53 | HAL_NVIC_EnableIRQ(TIM2_IRQn);
54 |
55 | /* Enable TIM2 clock */
56 | __HAL_RCC_TIM2_CLK_ENABLE();
57 |
58 | /* Get clock configuration */
59 | HAL_RCC_GetClockConfig(&clkconfig, &pFLatency);
60 |
61 | /* Compute TIM2 clock */
62 | uwTimclock = 2*HAL_RCC_GetPCLK1Freq();
63 |
64 | /* Compute the prescaler value to have TIM2 counter clock equal to 1MHz */
65 | uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1);
66 |
67 | /* Initialize TIM2 */
68 | htim2.Instance = TIM2;
69 |
70 | /* Initialize TIMx peripheral as follow:
71 | + Period = [(TIM2CLK/1000) - 1]. to have a (1/1000) s time base.
72 | + Prescaler = (uwTimclock/1000000 - 1) to have a 1MHz counter clock.
73 | + ClockDivision = 0
74 | + Counter direction = Up
75 | */
76 | htim2.Init.Period = (1000000 / 1000) - 1;
77 | htim2.Init.Prescaler = uwPrescalerValue;
78 | htim2.Init.ClockDivision = 0;
79 | htim2.Init.CounterMode = TIM_COUNTERMODE_UP;
80 | if(HAL_TIM_Base_Init(&htim2) == HAL_OK)
81 | {
82 | /* Start the TIM time Base generation in interrupt mode */
83 | return HAL_TIM_Base_Start_IT(&htim2);
84 | }
85 |
86 | /* Return function status */
87 | return HAL_ERROR;
88 | }
89 |
90 | /**
91 | * @brief Suspend Tick increment.
92 | * @note Disable the tick increment by disabling TIM2 update interrupt.
93 | * @param None
94 | * @retval None
95 | */
96 | void HAL_SuspendTick(void)
97 | {
98 | /* Disable TIM2 update Interrupt */
99 | __HAL_TIM_DISABLE_IT(&htim2, TIM_IT_UPDATE);
100 | }
101 |
102 | /**
103 | * @brief Resume Tick increment.
104 | * @note Enable the tick increment by Enabling TIM2 update interrupt.
105 | * @param None
106 | * @retval None
107 | */
108 | void HAL_ResumeTick(void)
109 | {
110 | /* Enable TIM2 Update interrupt */
111 | __HAL_TIM_ENABLE_IT(&htim2, TIM_IT_UPDATE);
112 | }
113 |
114 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
115 |
--------------------------------------------------------------------------------
/Src/stm32f1xx_it.c:
--------------------------------------------------------------------------------
1 | /* USER CODE BEGIN Header */
2 | /**
3 | ******************************************************************************
4 | * @file stm32f1xx_it.c
5 | * @brief Interrupt Service Routines.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 | /* USER CODE END Header */
20 |
21 | /* Includes ------------------------------------------------------------------*/
22 | #include "main.h"
23 | #include "stm32f1xx_it.h"
24 | #include "cmsis_os.h"
25 | /* Private includes ----------------------------------------------------------*/
26 | /* USER CODE BEGIN Includes */
27 | #include "Hardware.h"
28 | /* USER CODE END Includes */
29 |
30 | /* Private typedef -----------------------------------------------------------*/
31 | /* USER CODE BEGIN TD */
32 |
33 | /* USER CODE END TD */
34 |
35 | /* Private define ------------------------------------------------------------*/
36 | /* USER CODE BEGIN PD */
37 |
38 | /* USER CODE END PD */
39 |
40 | /* Private macro -------------------------------------------------------------*/
41 | /* USER CODE BEGIN PM */
42 |
43 | /* USER CODE END PM */
44 |
45 | /* Private variables ---------------------------------------------------------*/
46 | /* USER CODE BEGIN PV */
47 |
48 | /* USER CODE END PV */
49 |
50 | /* Private function prototypes -----------------------------------------------*/
51 | /* USER CODE BEGIN PFP */
52 |
53 | /* USER CODE END PFP */
54 |
55 | /* Private user code ---------------------------------------------------------*/
56 | /* USER CODE BEGIN 0 */
57 |
58 | /* USER CODE END 0 */
59 |
60 | /* External variables --------------------------------------------------------*/
61 | extern DMA_HandleTypeDef hdma_usart2_rx;
62 | extern UART_HandleTypeDef huart2;
63 | extern TIM_HandleTypeDef htim2;
64 |
65 | /* USER CODE BEGIN EV */
66 |
67 | /* USER CODE END EV */
68 |
69 | /******************************************************************************/
70 | /* Cortex-M3 Processor Interruption and Exception Handlers */
71 | /******************************************************************************/
72 | /**
73 | * @brief This function handles Non maskable interrupt.
74 | */
75 | void NMI_Handler(void)
76 | {
77 | /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
78 |
79 | /* USER CODE END NonMaskableInt_IRQn 0 */
80 | /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
81 |
82 | /* USER CODE END NonMaskableInt_IRQn 1 */
83 | }
84 |
85 | /**
86 | * @brief This function handles Hard fault interrupt.
87 | */
88 | void HardFault_Handler(void)
89 | {
90 | /* USER CODE BEGIN HardFault_IRQn 0 */
91 |
92 | /* USER CODE END HardFault_IRQn 0 */
93 | while (1)
94 | {
95 | /* USER CODE BEGIN W1_HardFault_IRQn 0 */
96 | /* USER CODE END W1_HardFault_IRQn 0 */
97 | }
98 | }
99 |
100 | /**
101 | * @brief This function handles Memory management fault.
102 | */
103 | void MemManage_Handler(void)
104 | {
105 | /* USER CODE BEGIN MemoryManagement_IRQn 0 */
106 |
107 | /* USER CODE END MemoryManagement_IRQn 0 */
108 | while (1)
109 | {
110 | /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
111 | /* USER CODE END W1_MemoryManagement_IRQn 0 */
112 | }
113 | }
114 |
115 | /**
116 | * @brief This function handles Prefetch fault, memory access fault.
117 | */
118 | void BusFault_Handler(void)
119 | {
120 | /* USER CODE BEGIN BusFault_IRQn 0 */
121 |
122 | /* USER CODE END BusFault_IRQn 0 */
123 | while (1)
124 | {
125 | /* USER CODE BEGIN W1_BusFault_IRQn 0 */
126 | /* USER CODE END W1_BusFault_IRQn 0 */
127 | }
128 | }
129 |
130 | /**
131 | * @brief This function handles Undefined instruction or illegal state.
132 | */
133 | void UsageFault_Handler(void)
134 | {
135 | /* USER CODE BEGIN UsageFault_IRQn 0 */
136 |
137 | /* USER CODE END UsageFault_IRQn 0 */
138 | while (1)
139 | {
140 | /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
141 | /* USER CODE END W1_UsageFault_IRQn 0 */
142 | }
143 | }
144 |
145 | /**
146 | * @brief This function handles Debug monitor.
147 | */
148 | void DebugMon_Handler(void)
149 | {
150 | /* USER CODE BEGIN DebugMonitor_IRQn 0 */
151 |
152 | /* USER CODE END DebugMonitor_IRQn 0 */
153 | /* USER CODE BEGIN DebugMonitor_IRQn 1 */
154 |
155 | /* USER CODE END DebugMonitor_IRQn 1 */
156 | }
157 |
158 | /******************************************************************************/
159 | /* STM32F1xx Peripheral Interrupt Handlers */
160 | /* Add here the Interrupt Handlers for the used peripherals. */
161 | /* For the available peripheral interrupt handler names, */
162 | /* please refer to the startup file (startup_stm32f1xx.s). */
163 | /******************************************************************************/
164 |
165 | /**
166 | * @brief This function handles DMA1 channel6 global interrupt.
167 | */
168 | void DMA1_Channel6_IRQHandler(void)
169 | {
170 | /* USER CODE BEGIN DMA1_Channel6_IRQn 0 */
171 |
172 | /* USER CODE END DMA1_Channel6_IRQn 0 */
173 | HAL_DMA_IRQHandler(&hdma_usart2_rx);
174 | /* USER CODE BEGIN DMA1_Channel6_IRQn 1 */
175 |
176 | /* USER CODE END DMA1_Channel6_IRQn 1 */
177 | }
178 |
179 | /**
180 | * @brief This function handles TIM2 global interrupt.
181 | */
182 | void TIM2_IRQHandler(void)
183 | {
184 | /* USER CODE BEGIN TIM2_IRQn 0 */
185 |
186 | /* USER CODE END TIM2_IRQn 0 */
187 | HAL_TIM_IRQHandler(&htim2);
188 | /* USER CODE BEGIN TIM2_IRQn 1 */
189 |
190 | /* USER CODE END TIM2_IRQn 1 */
191 | }
192 |
193 | /**
194 | * @brief This function handles USART2 global interrupt.
195 | */
196 | void USART2_IRQHandler(void)
197 | {
198 | /* USER CODE BEGIN USART2_IRQn 0 */
199 |
200 | /* USER CODE END USART2_IRQn 0 */
201 | HAL_UART_IRQHandler(&huart2);
202 | /* USER CODE BEGIN USART2_IRQn 1 */
203 |
204 | USER_UART_IDLECallback(&huart2);
205 | /* USER CODE END USART2_IRQn 1 */
206 | }
207 |
208 | /* USER CODE BEGIN 1 */
209 |
210 | /* USER CODE END 1 */
211 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
212 |
--------------------------------------------------------------------------------
/Src/usart.c:
--------------------------------------------------------------------------------
1 | /**
2 | ******************************************************************************
3 | * File Name : USART.c
4 | * Description : This file provides code for the configuration
5 | * of the USART instances.
6 | ******************************************************************************
7 | * @attention
8 | *
9 | * © Copyright (c) 2019 STMicroelectronics.
10 | * All rights reserved.
11 | *
12 | * This software component is licensed by ST under Ultimate Liberty license
13 | * SLA0044, the "License"; You may not use this file except in compliance with
14 | * the License. You may obtain a copy of the License at:
15 | * www.st.com/SLA0044
16 | *
17 | ******************************************************************************
18 | */
19 |
20 | /* Includes ------------------------------------------------------------------*/
21 | #include "usart.h"
22 |
23 | /* USER CODE BEGIN 0 */
24 |
25 | /* USER CODE END 0 */
26 |
27 | UART_HandleTypeDef huart1;
28 | UART_HandleTypeDef huart2;
29 | DMA_HandleTypeDef hdma_usart2_rx;
30 |
31 | /* USART1 init function */
32 |
33 | void MX_USART1_UART_Init(void)
34 | {
35 |
36 | huart1.Instance = USART1;
37 | huart1.Init.BaudRate = 115200;
38 | huart1.Init.WordLength = UART_WORDLENGTH_8B;
39 | huart1.Init.StopBits = UART_STOPBITS_1;
40 | huart1.Init.Parity = UART_PARITY_NONE;
41 | huart1.Init.Mode = UART_MODE_TX_RX;
42 | huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
43 | huart1.Init.OverSampling = UART_OVERSAMPLING_16;
44 | if (HAL_UART_Init(&huart1) != HAL_OK)
45 | {
46 | Error_Handler();
47 | }
48 |
49 | }
50 | /* USART2 init function */
51 |
52 | void MX_USART2_UART_Init(void)
53 | {
54 |
55 | huart2.Instance = USART2;
56 | huart2.Init.BaudRate = 9600;
57 | huart2.Init.WordLength = UART_WORDLENGTH_8B;
58 | huart2.Init.StopBits = UART_STOPBITS_1;
59 | huart2.Init.Parity = UART_PARITY_NONE;
60 | huart2.Init.Mode = UART_MODE_TX_RX;
61 | huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE;
62 | huart2.Init.OverSampling = UART_OVERSAMPLING_16;
63 | if (HAL_UART_Init(&huart2) != HAL_OK)
64 | {
65 | Error_Handler();
66 | }
67 |
68 | }
69 |
70 | void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle)
71 | {
72 |
73 | GPIO_InitTypeDef GPIO_InitStruct = {0};
74 | if(uartHandle->Instance==USART1)
75 | {
76 | /* USER CODE BEGIN USART1_MspInit 0 */
77 |
78 | /* USER CODE END USART1_MspInit 0 */
79 | /* USART1 clock enable */
80 | __HAL_RCC_USART1_CLK_ENABLE();
81 |
82 | __HAL_RCC_GPIOA_CLK_ENABLE();
83 | /**USART1 GPIO Configuration
84 | PA9 ------> USART1_TX
85 | PA10 ------> USART1_RX
86 | */
87 | GPIO_InitStruct.Pin = GPIO_PIN_9;
88 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
89 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
90 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
91 |
92 | GPIO_InitStruct.Pin = GPIO_PIN_10;
93 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
94 | GPIO_InitStruct.Pull = GPIO_NOPULL;
95 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
96 |
97 | /* USER CODE BEGIN USART1_MspInit 1 */
98 |
99 | /* USER CODE END USART1_MspInit 1 */
100 | }
101 | else if(uartHandle->Instance==USART2)
102 | {
103 | /* USER CODE BEGIN USART2_MspInit 0 */
104 |
105 | /* USER CODE END USART2_MspInit 0 */
106 | /* USART2 clock enable */
107 | __HAL_RCC_USART2_CLK_ENABLE();
108 |
109 | __HAL_RCC_GPIOA_CLK_ENABLE();
110 | /**USART2 GPIO Configuration
111 | PA2 ------> USART2_TX
112 | PA3 ------> USART2_RX
113 | */
114 | GPIO_InitStruct.Pin = GPIO_PIN_2;
115 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
116 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
117 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
118 |
119 | GPIO_InitStruct.Pin = GPIO_PIN_3;
120 | GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
121 | GPIO_InitStruct.Pull = GPIO_NOPULL;
122 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
123 |
124 | /* USART2 DMA Init */
125 | /* USART2_RX Init */
126 | hdma_usart2_rx.Instance = DMA1_Channel6;
127 | hdma_usart2_rx.Init.Direction = DMA_PERIPH_TO_MEMORY;
128 | hdma_usart2_rx.Init.PeriphInc = DMA_PINC_DISABLE;
129 | hdma_usart2_rx.Init.MemInc = DMA_MINC_ENABLE;
130 | hdma_usart2_rx.Init.PeriphDataAlignment = DMA_PDATAALIGN_BYTE;
131 | hdma_usart2_rx.Init.MemDataAlignment = DMA_MDATAALIGN_BYTE;
132 | hdma_usart2_rx.Init.Mode = DMA_NORMAL;
133 | hdma_usart2_rx.Init.Priority = DMA_PRIORITY_LOW;
134 | if (HAL_DMA_Init(&hdma_usart2_rx) != HAL_OK)
135 | {
136 | Error_Handler();
137 | }
138 |
139 | __HAL_LINKDMA(uartHandle,hdmarx,hdma_usart2_rx);
140 |
141 | /* USART2 interrupt Init */
142 | HAL_NVIC_SetPriority(USART2_IRQn, 5, 0);
143 | HAL_NVIC_EnableIRQ(USART2_IRQn);
144 | /* USER CODE BEGIN USART2_MspInit 1 */
145 |
146 | /* USER CODE END USART2_MspInit 1 */
147 | }
148 | }
149 |
150 | void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
151 | {
152 |
153 | if(uartHandle->Instance==USART1)
154 | {
155 | /* USER CODE BEGIN USART1_MspDeInit 0 */
156 |
157 | /* USER CODE END USART1_MspDeInit 0 */
158 | /* Peripheral clock disable */
159 | __HAL_RCC_USART1_CLK_DISABLE();
160 |
161 | /**USART1 GPIO Configuration
162 | PA9 ------> USART1_TX
163 | PA10 ------> USART1_RX
164 | */
165 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
166 |
167 | /* USER CODE BEGIN USART1_MspDeInit 1 */
168 |
169 | /* USER CODE END USART1_MspDeInit 1 */
170 | }
171 | else if(uartHandle->Instance==USART2)
172 | {
173 | /* USER CODE BEGIN USART2_MspDeInit 0 */
174 |
175 | /* USER CODE END USART2_MspDeInit 0 */
176 | /* Peripheral clock disable */
177 | __HAL_RCC_USART2_CLK_DISABLE();
178 |
179 | /**USART2 GPIO Configuration
180 | PA2 ------> USART2_TX
181 | PA3 ------> USART2_RX
182 | */
183 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
184 |
185 | /* USART2 DMA DeInit */
186 | HAL_DMA_DeInit(uartHandle->hdmarx);
187 |
188 | /* USART2 interrupt Deinit */
189 | HAL_NVIC_DisableIRQ(USART2_IRQn);
190 | /* USER CODE BEGIN USART2_MspDeInit 1 */
191 |
192 | /* USER CODE END USART2_MspDeInit 1 */
193 | }
194 | }
195 |
196 | /* USER CODE BEGIN 1 */
197 |
198 | /* USER CODE END 1 */
199 |
200 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
201 |
--------------------------------------------------------------------------------
/User/AT.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/AT.c
--------------------------------------------------------------------------------
/User/AT.h:
--------------------------------------------------------------------------------
1 | #ifndef _AT_H_
2 | #define _AT_H_
3 |
4 | #include "Hardware.h"
5 | #include "ATCommand.h"
6 | #include "cmsis_os.h"
7 |
8 | extern QueueHandle_t ATcmdQueue ;
9 | extern SemaphoreHandle_t ATRXCplSemaphore;
10 |
11 | typedef struct {
12 | ATCommand RegCommandName;
13 | CmdType RegCommandType;
14 | char * RegCommandParam;
15 | }ATCommandRegInfo;
16 |
17 | void ATCommandRegister(ATCommand ATCommandName,CmdType ATCommandType,char* ATCommandParam);
18 | ATStatus CheckATCmdConsistency(void);
19 | ATStatus ATFormInit(void);
20 |
21 | ATStatus CheckEcho(ATCommandRegInfo SendATInfo,char * str,char ** ReStr);
22 | ATStatus CheckEnd(char *str);
23 |
24 | void ATCommandSendScheduler(void);
25 |
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/User/ATCommand.c:
--------------------------------------------------------------------------------
1 | #include "ATCommand.h"
2 | #include "string.h"
3 | #include "log.h"
4 |
5 | typedef struct
6 | {
7 | char* RxBuff;
8 | int len;
9 | }RxStrInfo;
10 |
11 | char DateHandleBuff[128];
12 | RxStrInfo RxHandleInfo;
13 |
14 |
15 | ATStatus CGSN_Callback(char * str)
16 | {
17 | return ATSUCCESS;
18 | }
19 |
20 | ATStatus CSQ_Callback(char *str)
21 | {
22 | return ATSUCCESS;
23 | }
24 |
25 | ATStatus CGATT_Callback(char *str)
26 | {
27 | return ATSUCCESS;
28 | }
29 |
30 | ATStatus NSCR_Calback(char *str)
31 | {
32 | return ATSUCCESS;
33 | }
34 | ATStatus NSOCO_Callback(char *str)
35 | {
36 | return ATSUCCESS;
37 | }
38 | ATStatus NSOSD_Callback(char *str)
39 | {
40 | return ATSUCCESS;
41 | }
42 | ATStatus NSORF_Callback(char *str)
43 | {
44 | return ATSUCCESS;
45 | }
46 |
47 |
48 |
--------------------------------------------------------------------------------
/User/ATCommand.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/ATCommand.h
--------------------------------------------------------------------------------
/User/ATtype.h:
--------------------------------------------------------------------------------
1 | #ifndef __ATTYPE_H_
2 | #define __ATTYPE_H_
3 |
4 | #include "stdint.h"
5 |
6 | #define _ATCOMMANDNAMELIST CGSN,CSQ
7 |
8 |
9 |
10 |
11 |
12 | #endif
13 |
14 |
--------------------------------------------------------------------------------
/User/Hardware.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/Hardware.c
--------------------------------------------------------------------------------
/User/Hardware.h:
--------------------------------------------------------------------------------
1 | #ifndef __HARDWARE_H_
2 | #define __HARDWARE_H_
3 |
4 | #include "FreeRTOS.h"
5 | #include "string.h"
6 | #include "AT.h"
7 |
8 | #include "usart.h"
9 |
10 |
11 | #define _UART_DMA_HANDLE hdma_usart2_rx
12 | #define _ATUART_HANDLE huart2
13 |
14 | #define _UART_TIMEOUT 1000
15 | #define _UART_RXBUFFSIZE 128
16 |
17 | extern DMA_HandleTypeDef _UART_DMA_HANDLE;
18 | extern char UartRXBuff[_UART_RXBUFFSIZE];
19 |
20 |
21 | void UartInit(void);
22 | void SendString(char * str);
23 | void SendMultiStr(int n,...);
24 | void MoudleResst(void);
25 | void USER_UART_IDLECallback(UART_HandleTypeDef *huart);
26 |
27 | #endif
28 |
--------------------------------------------------------------------------------
/User/LOG/cm_backtrace.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/LOG/cm_backtrace.c
--------------------------------------------------------------------------------
/User/LOG/cm_backtrace.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the CmBacktrace Library.
3 | *
4 | * Copyright (c) 2016, Armink,
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining
7 | * a copy of this software and associated documentation files (the
8 | * 'Software'), to deal in the Software without restriction, including
9 | * without limitation the rights to use, copy, modify, merge, publish,
10 | * distribute, sublicense, and/or sell copies of the Software, and to
11 | * permit persons to whom the Software is furnished to do so, subject to
12 | * the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | *
25 | * Function: It is an head file for this library. You can see all be called functions.
26 | * Created on: 2016-12-15
27 | */
28 |
29 | #ifndef _CORTEXM_BACKTRACE_H_
30 | #define _CORTEXM_BACKTRACE_H_
31 |
32 | #include "cmb_def.h"
33 |
34 | void cm_backtrace_init(const char *firmware_name, const char *hardware_ver, const char *software_ver);
35 | void cm_backtrace_firmware_info(void);
36 | size_t cm_backtrace_call_stack(uint32_t *buffer, size_t size, uint32_t sp);
37 | void cm_backtrace_assert(uint32_t sp);
38 | void cm_backtrace_fault(uint32_t fault_handler_lr, uint32_t fault_handler_sp);
39 |
40 | #endif /* _CORTEXM_BACKTRACE_H_ */
41 |
--------------------------------------------------------------------------------
/User/LOG/cmb_cfg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the CmBacktrace Library.
3 | *
4 | * Copyright (c) 2016, Armink,
5 | *
6 | * Permission is hereby granted, free of charge, to any person obtaining
7 | * a copy of this software and associated documentation files (the
8 | * 'Software'), to deal in the Software without restriction, including
9 | * without limitation the rights to use, copy, modify, merge, publish,
10 | * distribute, sublicense, and/or sell copies of the Software, and to
11 | * permit persons to whom the Software is furnished to do so, subject to
12 | * the following conditions:
13 | *
14 | * The above copyright notice and this permission notice shall be
15 | * included in all copies or substantial portions of the Software.
16 | *
17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | *
25 | * Function: It is the configure head file for this library.
26 | * Created on: 2016-12-15
27 | */
28 |
29 | #ifndef _CMB_CFG_H_
30 | #define _CMB_CFG_H_
31 |
32 | /* print line, must config by user */
33 | #define cmb_println(...) printf(__VA_ARGS__);printf("\r\n")
34 | /* enable OS platform */
35 | #define CMB_USING_OS_PLATFORM
36 | /* OS platform type, must config when CMB_USING_OS_PLATFORM is enable */
37 | #define CMB_OS_PLATFORM_TYPE CMB_OS_PLATFORM_FREERTOS
38 | /* cpu platform type, must config by user */
39 | #define CMB_CPU_PLATFORM_TYPE CMB_CPU_ARM_CORTEX_M3
40 | /* enable dump stack information */
41 | #define CMB_USING_DUMP_STACK_INFO
42 | /* language of print information */
43 | #define CMB_PRINT_LANGUAGE CMB_PRINT_LANUUAGE_ENGLISH
44 | #endif /* _CMB_CFG_H_ */
45 |
--------------------------------------------------------------------------------
/User/LOG/cmb_fault.S:
--------------------------------------------------------------------------------
1 | ;/*
2 | ; * This file is part of the CmBacktrace Library.
3 | ; *
4 | ; * Copyright (c) 2016, Armink,
5 | ; *
6 | ; * Permission is hereby granted, free of charge, to any person obtaining
7 | ; * a copy of this software and associated documentation files (the
8 | ; * 'Software'), to deal in the Software without restriction, including
9 | ; * without limitation the rights to use, copy, modify, merge, publish,
10 | ; * distribute, sublicense, and/or sell copies of the Software, and to
11 | ; * permit persons to whom the Software is furnished to do so, subject to
12 | ; * the following conditions:
13 | ; *
14 | ; * The above copyright notice and this permission notice shall be
15 | ; * included in all copies or substantial portions of the Software.
16 | ; *
17 | ; * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 | ; * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 | ; * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 | ; * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 | ; * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 | ; * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 | ; * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 | ; *
25 | ; * Function: Fault handler by MDK-ARM assembly code
26 | ; * Created on: 2016-12-16
27 | ; */
28 |
29 | AREA |.text|, CODE, READONLY, ALIGN=2
30 | THUMB
31 | REQUIRE8
32 | PRESERVE8
33 |
34 | ; NOTE: If use this file's HardFault_Handler, please comments the HardFault_Handler code on other file.
35 | IMPORT cm_backtrace_fault
36 | EXPORT HardFault_Handler
37 |
38 | HardFault_Handler PROC
39 | MOV r0, lr ; get lr
40 | MOV r1, sp ; get stack pointer (current is MSP)
41 | BL cm_backtrace_fault
42 |
43 | Fault_Loop
44 | BL Fault_Loop ;while(1)
45 | ENDP
46 |
47 | END
48 |
--------------------------------------------------------------------------------
/User/LOG/fault_test.c:
--------------------------------------------------------------------------------
1 | /*
2 | * fault_test.c
3 | *
4 | * Created on: 2016/12/25
5 | * Author: Armink
6 | */
7 |
8 | #include
9 |
10 | void fault_test_by_unalign(void) {
11 | volatile int * SCB_CCR = (volatile int *) 0xE000ED14; // SCB->CCR
12 | volatile int * p;
13 | volatile int value;
14 |
15 | *SCB_CCR |= (1 << 3); /* bit3: UNALIGN_TRP. */
16 |
17 | p = (int *) 0x00;
18 | value = *p;
19 | printf("addr:0x%02X value:0x%08X\r\n", (int) p, value);
20 |
21 | p = (int *) 0x04;
22 | value = *p;
23 | printf("addr:0x%02X value:0x%08X\r\n", (int) p, value);
24 |
25 | p = (int *) 0x03;
26 | value = *p;
27 | printf("addr:0x%02X value:0x%08X\r\n", (int) p, value);
28 | }
29 |
30 | void fault_test_by_div0(void) {
31 | volatile int * SCB_CCR = (volatile int *) 0xE000ED14; // SCB->CCR
32 | int x, y, z;
33 |
34 | *SCB_CCR |= (1 << 4); /* bit4: DIV_0_TRP. */
35 |
36 | x = 10;
37 | y = 0;
38 | z = x / y;
39 | printf("z:%d\n", z);
40 | }
41 |
--------------------------------------------------------------------------------
/User/log.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/log.c
--------------------------------------------------------------------------------
/User/log.h:
--------------------------------------------------------------------------------
1 | #ifndef __LOG_H_
2 | #define __LOG_H_
3 |
4 | #include "stm32f1xx_hal.h"
5 | #include "usart.h"
6 | #include "stdlib.h"
7 |
8 | #define DEBUG 1
9 |
10 |
11 | #if DEBUG
12 |
13 | #define __LOGNOLF(format, ...) do{ \
14 | char * UartTXBuff = (char *)calloc(128,sizeof(char)); \
15 | sprintf(UartTXBuff,"Tick:%d >> "format,HAL_GetTick(), ##__VA_ARGS__); \
16 | StrNoLR(UartTXBuff); \
17 | UartTXBuff[strlen(UartTXBuff)]='\n'; \
18 | HAL_UART_Transmit(&huart1, (uint8_t *)UartTXBuff, strlen(UartTXBuff), 1000); \
19 | free(UartTXBuff);\
20 | }while(0u)
21 |
22 | #define __LOG(format, ...) printf("Tick:%d >> "format"\n",HAL_GetTick(), ##__VA_ARGS__)
23 | #define __LOGARRAY(array,n,str) do \
24 | { printf("Log %s array >>:",str); \
25 | for(int i=0;i>File:" __FILE__ " Line:%d\nERROR LOG INFO >>"format"\n\n",HAL_GetTick(), __LINE__, ##__VA_ARGS__)
36 |
37 | char * mystrcat(int n,...);
38 | void StrNoLR(char * str);
39 |
40 | #endif
41 |
42 |
--------------------------------------------------------------------------------
/User/socket.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/MinjunHuang/ATFram/56b0b62eaf06a424520f8440e49529ba1b39f013/User/socket.c
--------------------------------------------------------------------------------
/User/socket.h:
--------------------------------------------------------------------------------
1 | #ifndef __SOCKET_H_
2 | #define __SOCKET_H_
3 |
4 | #include "AT.h"
5 |
6 | ATStatus NetwoekInit(void);
7 | ATStatus socket();
8 |
9 | #endif
10 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # AT指令处理框架
2 | AT指令处理框架,基于FreeRTOS,使用STM32进行开发
3 |
4 | ---
5 |
6 | 1. 在使用前将Hardware.c 与 ATCommand.h ATCommand.c中的函数进行配置。
7 | 2. 使用时注册一个任务运行AT指令处理调度器,使用ATCommandRegister()函数注册发送AT命令。当接收到正确的响应后,会将参数传递到用户的处理回调函数中。
8 |
9 |
10 | ## 提交版本日志:
11 | 1. 11-6 完成AT指令发送注册和返回命令参数提取
12 |
13 | ## 代码结构
14 | ```
15 | ├── ATFramework.ioc //CUBEMX工程
16 | ├── Drivers //HAL库驱动
17 | ├── Inc //工程头文件
18 | ├── MDK-ARM //keil工程文件
19 | ├── Middlewares //FreeRTOS库
20 | ├── Src //工程源文件
21 | ├── User //AT驱动库文件
22 | └── readme.md
23 |
24 | ```
25 |
26 | ## 参考链接:
27 | 1. [AT指令代码与实现方法(基于C语言)](https://blog.csdn.net/hnxyxiaomeng/article/details/84613712)
28 | 2. [STM32 HAL库学习(四):DMA之串口空闲中断](https://blog.csdn.net/la_fe_/article/details/100543141)
29 |
--------------------------------------------------------------------------------