├── .gitignore ├── .project ├── CC2530ZNP-with-SBL.hex ├── README.md └── zigbee_test ├── .clang-format ├── .cproject ├── .mxproject ├── .project ├── .settings ├── language.settings.xml └── stm32cubeide.project.prefs ├── .vscode ├── .cortex-debug.peripherals.state.json ├── .cortex-debug.registers.state.json ├── c_cpp_properties.json ├── launch.json ├── settings.json └── tasks.json ├── Core ├── Inc │ ├── FreeRTOSConfig.h │ ├── gpio.h │ ├── log.h │ ├── main.h │ ├── stm32l4xx_hal_conf.h │ ├── stm32l4xx_it.h │ └── usart.h ├── Src │ ├── freertos.c │ ├── gpio.c │ ├── log.c │ ├── main.c │ ├── stm32l4xx_hal_msp.c │ ├── stm32l4xx_hal_timebase_tim.c │ ├── stm32l4xx_it.c │ ├── syscalls.c │ ├── sysmem.c │ ├── system_stm32l4xx.c │ └── usart.c ├── startup │ └── startup_stm32l496xx.s ├── znp-app │ ├── znp_cb.c │ ├── znp_cb.h │ ├── znp_cmd.c │ ├── znp_cmd.h │ ├── znp_if.c │ └── znp_if.h └── znp-host-framework │ ├── README.MD │ ├── README.html │ ├── ZNP host SW framework_1.0.0_manifest.html │ ├── docs │ └── ZNP Host Framework Design Guide.pdf │ └── framework │ ├── SConscript │ ├── mt │ ├── Af │ │ ├── mtAf.c │ │ └── mtAf.h │ ├── AppCfg │ │ ├── mtAppCfg.c │ │ └── mtAppCfg.h │ ├── Sapi │ │ ├── mtSapi.c │ │ └── mtSapi.h │ ├── Sys │ │ ├── mtSys.c │ │ └── mtSys.h │ ├── Util │ │ ├── mtUtil.c │ │ └── mtUtil.h │ ├── Zdo │ │ ├── mtZdo.c │ │ └── mtZdo.h │ ├── mtParser.c │ └── mtParser.h │ ├── platform │ └── stm32 │ │ ├── dbgPrint.c │ │ ├── dbgPrint.h │ │ ├── rpcTransport.h │ │ └── rpcTransportUart.c │ └── rpc │ ├── rpc.c │ ├── rpc.h │ ├── rpc_queue.c │ └── rpc_queue.h ├── Debug ├── Application │ ├── Startup │ │ └── subdir.mk │ └── User │ │ └── subdir.mk ├── Core │ ├── Src │ │ └── subdir.mk │ ├── Startup │ │ └── subdir.mk │ ├── znp-app │ │ └── subdir.mk │ └── znp-host-framework │ │ └── framework │ │ ├── mt │ │ ├── Af │ │ │ └── subdir.mk │ │ ├── AppCfg │ │ │ └── subdir.mk │ │ ├── Sapi │ │ │ └── subdir.mk │ │ ├── Sys │ │ │ └── subdir.mk │ │ ├── Util │ │ │ └── subdir.mk │ │ ├── Zdo │ │ │ └── subdir.mk │ │ └── subdir.mk │ │ ├── platform │ │ └── stm32 │ │ │ └── subdir.mk │ │ └── rpc │ │ └── subdir.mk ├── Drivers │ ├── CMSIS │ │ └── subdir.mk │ └── STM32L4xx_HAL_Driver │ │ ├── Src │ │ └── subdir.mk │ │ └── subdir.mk ├── Middlewares │ └── Third_Party │ │ └── FreeRTOS │ │ └── Source │ │ ├── CMSIS_RTOS │ │ └── subdir.mk │ │ ├── portable │ │ ├── GCC │ │ │ └── ARM_CM4F │ │ │ │ └── subdir.mk │ │ └── MemMang │ │ │ └── subdir.mk │ │ └── subdir.mk ├── makefile ├── objects.list ├── objects.mk ├── sources.mk ├── subdir.mk ├── zigbee_test.bin └── zigbee_test.list ├── Drivers ├── CMSIS │ ├── Device │ │ └── ST │ │ │ └── STM32L4xx │ │ │ └── Include │ │ │ ├── stm32l496xx.h │ │ │ ├── stm32l4xx.h │ │ │ └── system_stm32l4xx.h │ └── Include │ │ ├── cmsis_armcc.h │ │ ├── cmsis_armclang.h │ │ ├── cmsis_compiler.h │ │ ├── cmsis_gcc.h │ │ ├── cmsis_iccarm.h │ │ ├── cmsis_version.h │ │ ├── core_armv8mbl.h │ │ ├── core_armv8mml.h │ │ ├── core_cm0.h │ │ ├── core_cm0plus.h │ │ ├── core_cm1.h │ │ ├── core_cm23.h │ │ ├── core_cm3.h │ │ ├── core_cm33.h │ │ ├── core_cm4.h │ │ ├── core_cm7.h │ │ ├── core_sc000.h │ │ ├── core_sc300.h │ │ ├── mpu_armv7.h │ │ ├── mpu_armv8.h │ │ └── tz_context.h └── STM32L4xx_HAL_Driver │ ├── Inc │ ├── Legacy │ │ └── stm32_hal_legacy.h │ ├── stm32l4xx_hal.h │ ├── stm32l4xx_hal_cortex.h │ ├── stm32l4xx_hal_def.h │ ├── stm32l4xx_hal_dma.h │ ├── stm32l4xx_hal_dma_ex.h │ ├── stm32l4xx_hal_exti.h │ ├── stm32l4xx_hal_flash.h │ ├── stm32l4xx_hal_flash_ex.h │ ├── stm32l4xx_hal_flash_ramfunc.h │ ├── stm32l4xx_hal_gpio.h │ ├── stm32l4xx_hal_gpio_ex.h │ ├── stm32l4xx_hal_i2c.h │ ├── stm32l4xx_hal_i2c_ex.h │ ├── stm32l4xx_hal_pwr.h │ ├── stm32l4xx_hal_pwr_ex.h │ ├── stm32l4xx_hal_rcc.h │ ├── stm32l4xx_hal_rcc_ex.h │ ├── stm32l4xx_hal_tim.h │ ├── stm32l4xx_hal_tim_ex.h │ ├── stm32l4xx_hal_uart.h │ └── stm32l4xx_hal_uart_ex.h │ └── Src │ ├── stm32l4xx_hal.c │ ├── stm32l4xx_hal_cortex.c │ ├── stm32l4xx_hal_dma.c │ ├── stm32l4xx_hal_dma_ex.c │ ├── stm32l4xx_hal_exti.c │ ├── stm32l4xx_hal_flash.c │ ├── stm32l4xx_hal_flash_ex.c │ ├── stm32l4xx_hal_flash_ramfunc.c │ ├── stm32l4xx_hal_gpio.c │ ├── stm32l4xx_hal_i2c.c │ ├── stm32l4xx_hal_i2c_ex.c │ ├── stm32l4xx_hal_pwr.c │ ├── stm32l4xx_hal_pwr_ex.c │ ├── stm32l4xx_hal_rcc.c │ ├── stm32l4xx_hal_rcc_ex.c │ ├── stm32l4xx_hal_tim.c │ ├── stm32l4xx_hal_tim_ex.c │ ├── stm32l4xx_hal_uart.c │ └── stm32l4xx_hal_uart_ex.c ├── 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 │ ├── message_buffer.h │ ├── mpu_prototypes.h │ ├── mpu_wrappers.h │ ├── portable.h │ ├── projdefs.h │ ├── queue.h │ ├── semphr.h │ ├── stack_macros.h │ ├── stream_buffer.h │ ├── task.h │ └── timers.h │ ├── list.c │ ├── portable │ ├── GCC │ │ └── ARM_CM4F │ │ │ ├── port.c │ │ │ └── portmacro.h │ └── MemMang │ │ └── heap_4.c │ ├── queue.c │ ├── stream_buffer.c │ ├── tasks.c │ └── timers.c ├── STM32L496AGIX_FLASH.ld ├── STM32L496AGIX_RAM.ld └── zigbee_test.ioc /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | /zigbee_test/build 54 | !CC2530ZNP-with-SBL.hex -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | znp-host-stm32 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # znp-host-stm32 2 | An example project for interfacing with the ZNP firmware on a CC2530 Zigbee Module from TI using an STM32 microcontroller. 3 | 4 | This project expands the znp-host-framework as found in: 5 | 6 | https://github.com/pengphei/znp-host-framework 7 | 8 | The framework has been ported to the STM32 and some extra missing commands are added. A lot of other code that was not meant for an embedde device was removed (file IO, malloc, etc). The goal of this repository is to support all commands in the ZNP firmware, just as Z-Tool on the PC would, but executable from the STM32 processor (or any other embedded device). 9 | 10 | # Software Buildup 11 | The project uses FreeRTOS to manage two tasks: 12 | - The application task and; 13 | - The communication task. 14 | 15 | Beside these two tasks there are four other OS objects: 16 | - Two queues for the sending and receiving of data bytes from the UART; 17 | - One queue for the transfer of data frames that are received; 18 | - One semaphore for reception frame signaling. 19 | 20 | A normal command cycle will look like the following: 21 | 22 | ``` 23 | 1. APP TX: 24 | APP TASK -> UART TX Queue -> CC2530 25 | 26 | 2. Wait RX: 27 | APP TASK Waits For Synchronous Response semaphore (srspSem) 28 | 29 | 3. Data RX: 30 | data frame queue <- COM TASK <- UART RX Queue <- CC2530 31 | 32 | 4. Done RX: 33 | COM TASK Gives Synchronous Response semaphore (srspSem) 34 | 35 | 5. APP RX: 36 | APP TASK <- data frame queue 37 | ``` 38 | 39 | The application task contains some examples for interfacing, but a lot of examples that can be found for the Z-Tool GUI can be easily ported to this code. 40 | 41 | 42 | # Building 43 | The project is build using STM32Cube IDE. This IDE is supplied by ST Microelectronics free of charge for all of it's microcontrollers. It can be downloaded from: 44 | 45 | https://www.st.com/en/development-tools/stm32cubeide.html 46 | 47 | In the IDE the project can be imported by selecting: 48 | 49 | ```file -> Open Projects From Filesystem...``` 50 | 51 | and browsing to the root directory of the project. 52 | 53 | # Hardware 54 | The used hardware for this project is the P-L496G-CELL02 (without BG96 modem) from ST and the CC2530 Eval Kit from Waveshare. 55 | 56 | https://www.st.com/en/evaluation-tools/p-l496g-cell02.html 57 | 58 | https://www.waveshare.com/cc2530-eval-kit.htm 59 | 60 | The CC2530 Eval Kit runs the ZNP firmware found in Z-Stack 3.0.2. For convienence it is also found in this repository as source file (CC2530ZNP-with-SBL.hex). This should be flashed on the CC2530 using the CC-Debuger from TI before connecting it with the STM32. 61 | 62 | Some connections between the modules are to be made. The Arduino headers on the bottom side of the P-L496G-CELL02 are used to connect to the CC2530 Eval Kit. The connections are as follows: 63 | 64 | ``` 65 | ST -> CC2530 66 | GND -> GND 67 | 3V3 -> VCC 68 | D0 -> P0_3 69 | D1 -> P0_2 70 | ``` 71 | 72 | On the CC2530 Eval Kit the onboard USB converter should be disconnected. This can be done by removing the yellow headers which are placed on the "UART0 JMP" jumper. 73 | 74 | # TODO 75 | - The framework can still be expanded by adding more commands. 76 | - The tasks and interfaces are not nicely coded at this point. 77 | - Sending data is not yet thread safe. 78 | -------------------------------------------------------------------------------- /zigbee_test/.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | # BasedOnStyle: Google 3 | AccessModifierOffset: -1 4 | AlignAfterOpenBracket: Align 5 | AlignConsecutiveAssignments: false 6 | AlignConsecutiveDeclarations: false 7 | AlignEscapedNewlines: Left 8 | AlignOperands: true 9 | AlignTrailingComments: true 10 | AllowAllParametersOfDeclarationOnNextLine: true 11 | AllowShortBlocksOnASingleLine: false 12 | AllowShortCaseLabelsOnASingleLine: false 13 | AllowShortFunctionsOnASingleLine: None 14 | AllowShortIfStatementsOnASingleLine: false 15 | AllowShortLoopsOnASingleLine: false 16 | AlwaysBreakAfterDefinitionReturnType: None 17 | AlwaysBreakAfterReturnType: None 18 | AlwaysBreakBeforeMultilineStrings: true 19 | AlwaysBreakTemplateDeclarations: Yes 20 | BinPackArguments: true 21 | BinPackParameters: true 22 | BraceWrapping: 23 | AfterClass: false 24 | AfterControlStatement: false 25 | AfterEnum: false 26 | AfterFunction: false 27 | AfterNamespace: false 28 | AfterObjCDeclaration: false 29 | AfterStruct: false 30 | AfterUnion: false 31 | AfterExternBlock: false 32 | BeforeCatch: false 33 | BeforeElse: true 34 | IndentBraces: false 35 | SplitEmptyFunction: true 36 | SplitEmptyRecord: true 37 | SplitEmptyNamespace: true 38 | BreakBeforeBinaryOperators: None 39 | BreakBeforeBraces: Attach 40 | BreakBeforeInheritanceComma: false 41 | BreakInheritanceList: BeforeColon 42 | BreakBeforeTernaryOperators: true 43 | BreakConstructorInitializersBeforeComma: false 44 | BreakConstructorInitializers: BeforeColon 45 | BreakAfterJavaFieldAnnotations: false 46 | BreakStringLiterals: true 47 | ColumnLimit: 120 48 | CommentPragmas: '^ IWYU pragma:' 49 | CompactNamespaces: false 50 | ConstructorInitializerAllOnOneLineOrOnePerLine: true 51 | ConstructorInitializerIndentWidth: 4 52 | ContinuationIndentWidth: 4 53 | Cpp11BracedListStyle: true 54 | DerivePointerAlignment: true 55 | DisableFormat: false 56 | ExperimentalAutoDetectBinPacking: false 57 | FixNamespaceComments: true 58 | ForEachMacros: 59 | - foreach 60 | - Q_FOREACH 61 | - BOOST_FOREACH 62 | IncludeBlocks: Preserve 63 | IncludeCategories: 64 | - Regex: '^' 65 | Priority: 2 66 | - Regex: '^<.*\.h>' 67 | Priority: 1 68 | - Regex: '^<.*' 69 | Priority: 2 70 | - Regex: '.*' 71 | Priority: 3 72 | IncludeIsMainRegex: '([-_](test|unittest))?$' 73 | IndentCaseLabels: true 74 | IndentPPDirectives: None 75 | IndentWidth: 4 76 | IndentWrappedFunctionNames: false 77 | JavaScriptQuotes: Leave 78 | JavaScriptWrapImports: true 79 | KeepEmptyLinesAtTheStartOfBlocks: false 80 | MacroBlockBegin: '' 81 | MacroBlockEnd: '' 82 | MaxEmptyLinesToKeep: 1 83 | NamespaceIndentation: None 84 | ObjCBinPackProtocolList: Never 85 | ObjCBlockIndentWidth: 4 86 | ObjCSpaceAfterProperty: false 87 | ObjCSpaceBeforeProtocolList: true 88 | PenaltyBreakAssignment: 2 89 | PenaltyBreakBeforeFirstCallParameter: 1 90 | PenaltyBreakComment: 300 91 | PenaltyBreakFirstLessLess: 120 92 | PenaltyBreakString: 1000 93 | PenaltyBreakTemplateDeclaration: 10 94 | PenaltyExcessCharacter: 1000000 95 | PenaltyReturnTypeOnItsOwnLine: 200 96 | PointerAlignment: Left 97 | RawStringFormats: 98 | - Language: Cpp 99 | Delimiters: 100 | - cc 101 | - CC 102 | - cpp 103 | - Cpp 104 | - CPP 105 | - 'c++' 106 | - 'C++' 107 | CanonicalDelimiter: '' 108 | BasedOnStyle: google 109 | - Language: TextProto 110 | Delimiters: 111 | - pb 112 | - PB 113 | - proto 114 | - PROTO 115 | EnclosingFunctions: 116 | - EqualsProto 117 | - EquivToProto 118 | - PARSE_PARTIAL_TEXT_PROTO 119 | - PARSE_TEST_PROTO 120 | - PARSE_TEXT_PROTO 121 | - ParseTextOrDie 122 | - ParseTextProtoOrDie 123 | CanonicalDelimiter: '' 124 | BasedOnStyle: google 125 | ReflowComments: true 126 | SortIncludes: false 127 | SortUsingDeclarations: false 128 | SpaceAfterCStyleCast: false 129 | SpaceAfterTemplateKeyword: true 130 | SpaceBeforeAssignmentOperators: true 131 | SpaceBeforeCpp11BracedList: false 132 | SpaceBeforeCtorInitializerColon: true 133 | SpaceBeforeInheritanceColon: true 134 | SpaceBeforeParens: ControlStatements 135 | SpaceBeforeRangeBasedForLoopColon: true 136 | SpaceInEmptyParentheses: false 137 | SpacesBeforeTrailingComments: 2 138 | SpacesInAngles: false 139 | SpacesInContainerLiterals: true 140 | SpacesInCStyleCastParentheses: false 141 | SpacesInParentheses: false 142 | SpacesInSquareBrackets: false 143 | Standard: Auto 144 | TabWidth: 8 145 | UseTab: Never -------------------------------------------------------------------------------- /zigbee_test/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | zigbee_test 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | com.st.stm32cube.ide.mcu.MCUProjectNature 23 | com.st.stm32cube.ide.mcu.MCUCubeProjectNature 24 | org.eclipse.cdt.core.cnature 25 | com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAProjectNature 26 | com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature 27 | com.st.stm32cube.ide.mcu.MCUEndUserDisabledTrustZoneProjectNature 28 | com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature 29 | com.st.stm32cube.ide.mcu.MCURootProjectNature 30 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 31 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 32 | com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature 33 | com.st.stm32cube.ide.mcu.MCUNonUnderRootProjectNature 34 | 35 | 36 | -------------------------------------------------------------------------------- /zigbee_test/.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /zigbee_test/.settings/stm32cubeide.project.prefs: -------------------------------------------------------------------------------- 1 | 2F62501ED4689FB349E356AB974DBE57=0882C2216CA897265A90C9595B344AA2 2 | 635E684B79701B039C64EA45C3F84D30=67659F1F6B9EA170C06E1412EAC53391 3 | 8DF89ED150041C4CBC7CB9A9CAA90856=7688A2E67F6832B2DE756A31E71B31CF 4 | DC22A860405A8BF2F2C095E5B6529F12=7688A2E67F6832B2DE756A31E71B31CF 5 | eclipse.preferences.version=1 6 | -------------------------------------------------------------------------------- /zigbee_test/.vscode/.cortex-debug.peripherals.state.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /zigbee_test/.vscode/.cortex-debug.registers.state.json: -------------------------------------------------------------------------------- 1 | [] -------------------------------------------------------------------------------- /zigbee_test/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "STM32", 5 | "includePath": [ 6 | "Core/Inc", 7 | "Core/znp-app", 8 | "Core/znp-host-framework/framework/mt", 9 | "Core/znp-host-framework/framework/mt/Af", 10 | "Core/znp-host-framework/framework/mt/AppCfg", 11 | "Core/znp-host-framework/framework/mt/Sapi", 12 | "Core/znp-host-framework/framework/mt/Sys", 13 | "Core/znp-host-framework/framework/mt/Util", 14 | "Core/znp-host-framework/framework/mt/Zdo", 15 | "Core/znp-host-framework/framework/platform/stm32", 16 | "Core/znp-host-framework/framework/rpc", 17 | "Drivers/CMSIS/Device/ST/STM32L4xx/Include", 18 | "Drivers/CMSIS/Include", 19 | "Drivers/STM32L4xx_HAL_Driver/Inc", 20 | "Drivers/STM32L4xx_HAL_Driver/Inc/Legacy", 21 | "Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS", 22 | "Middlewares/Third_Party/FreeRTOS/Source/include", 23 | "Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F" 24 | ], 25 | "defines": [ 26 | "STM32L496xx", 27 | "USE_HAL_DRIVER" 28 | ], 29 | "compilerPath": "C:\\VSCODE\\GNU-ARM-EMBEDDED-TOOLCHAIN\\10-2020-Q4-MAJOR\\BIN\\ARM-NONE-EABI-GCC.EXE" 30 | } 31 | ], 32 | "version": 4 33 | } -------------------------------------------------------------------------------- /zigbee_test/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "showDevDebugOutput": true, 5 | "cwd": "${workspaceRoot}", 6 | "executable": "./build/test_firmware.elf", 7 | "name": "Debug STM32", 8 | "request": "launch", 9 | "type": "cortex-debug", 10 | "servertype": "openocd", 11 | "preLaunchTask": "Build STM", 12 | "device": "stlink", 13 | "configFiles": [ 14 | "openocd.cfg" 15 | ] 16 | } 17 | ] 18 | } -------------------------------------------------------------------------------- /zigbee_test/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cortex-debug.armToolchainPath": "C:\\vscode\\GNU-Arm-Embedded-Toolchain\\10-2020-q4-major\\bin", 3 | "cortex-debug.openocdPath": "C:\\VSCODE\\OPENOCD-V0.11.0-I686-W64-MINGW32\\BIN\\OPENOCD.EXE", 4 | "files.associations": { 5 | "znp_if.h": "c", 6 | "dbgprint.h": "c" 7 | } 8 | } -------------------------------------------------------------------------------- /zigbee_test/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Build STM", 6 | "type": "process", 7 | "command": "${command:stm32-for-vscode.build}", 8 | "options": { 9 | "cwd": "${workspaceRoot}" 10 | }, 11 | "group": { 12 | "kind": "build", 13 | "isDefault": true 14 | }, 15 | "problemMatcher": [ 16 | "$gcc" 17 | ] 18 | }, 19 | { 20 | "label": "Build Clean STM", 21 | "type": "process", 22 | "command": "${command:stm32-for-vscode.cleanBuild}", 23 | "options": { 24 | "cwd": "${workspaceRoot}" 25 | }, 26 | "group": { 27 | "kind": "build", 28 | "isDefault": true 29 | }, 30 | "problemMatcher": [ 31 | "$gcc" 32 | ] 33 | }, 34 | { 35 | "label": "Flash STM", 36 | "type": "process", 37 | "command": "${command:stm32-for-vscode.flash}", 38 | "options": { 39 | "cwd": "${workspaceRoot}" 40 | }, 41 | "group": { 42 | "kind": "build", 43 | "isDefault": true 44 | }, 45 | "problemMatcher": [ 46 | "$gcc" 47 | ] 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 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 | -------------------------------------------------------------------------------- /zigbee_test/Core/Inc/log.h: -------------------------------------------------------------------------------- 1 | #ifndef __LOG_H___ 2 | #define __LOG_H___ 3 | 4 | extern void log_init(void); 5 | 6 | extern void log_print(const char *fmt, ...); 7 | 8 | #endif -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under BSD 3-Clause license, 14 | * the "License"; You may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at: 16 | * opensource.org/licenses/BSD-3-Clause 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 "stm32l4xx_hal.h" 32 | 33 | /* Private includes ----------------------------------------------------------*/ 34 | /* USER CODE BEGIN Includes */ 35 | 36 | /* USER CODE END Includes */ 37 | 38 | /* Exported types ------------------------------------------------------------*/ 39 | /* USER CODE BEGIN ET */ 40 | 41 | /* USER CODE END ET */ 42 | 43 | /* Exported constants --------------------------------------------------------*/ 44 | /* USER CODE BEGIN EC */ 45 | 46 | /* USER CODE END EC */ 47 | 48 | /* Exported macro ------------------------------------------------------------*/ 49 | /* USER CODE BEGIN EM */ 50 | 51 | /* USER CODE END EM */ 52 | 53 | /* Exported functions prototypes ---------------------------------------------*/ 54 | void Error_Handler(void); 55 | 56 | /* USER CODE BEGIN EFP */ 57 | 58 | /* USER CODE END EFP */ 59 | 60 | /* Private defines -----------------------------------------------------------*/ 61 | /* USER CODE BEGIN Private defines */ 62 | 63 | /* USER CODE END Private defines */ 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* __MAIN_H */ 70 | 71 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 72 | -------------------------------------------------------------------------------- /zigbee_test/Core/Inc/stm32l4xx_it.h: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32l4xx_it.h 5 | * @brief This file contains the headers of the interrupt handlers. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2021 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32L4xx_IT_H 23 | #define __STM32L4xx_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 TIM1_UP_TIM16_IRQHandler(void); 57 | void LPUART1_IRQHandler(void); 58 | /* USER CODE BEGIN EFP */ 59 | 60 | /* USER CODE END EFP */ 61 | 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | 66 | #endif /* __STM32L4xx_IT_H */ 67 | 68 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 69 | -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 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 hlpuart1; 34 | extern UART_HandleTypeDef huart2; 35 | 36 | /* USER CODE BEGIN Private defines */ 37 | 38 | /* USER CODE END Private defines */ 39 | 40 | void MX_LPUART1_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 | -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 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 | 30 | /* USER CODE END Includes */ 31 | 32 | /* Private typedef -----------------------------------------------------------*/ 33 | /* USER CODE BEGIN PTD */ 34 | 35 | /* USER CODE END PTD */ 36 | 37 | /* Private define ------------------------------------------------------------*/ 38 | /* USER CODE BEGIN PD */ 39 | 40 | /* USER CODE END PD */ 41 | 42 | /* Private macro -------------------------------------------------------------*/ 43 | /* USER CODE BEGIN PM */ 44 | 45 | /* USER CODE END PM */ 46 | 47 | /* Private variables ---------------------------------------------------------*/ 48 | /* USER CODE BEGIN Variables */ 49 | 50 | /* USER CODE END Variables */ 51 | osThreadId defaultTaskHandle; 52 | 53 | /* Private function prototypes -----------------------------------------------*/ 54 | /* USER CODE BEGIN FunctionPrototypes */ 55 | 56 | /* USER CODE END FunctionPrototypes */ 57 | 58 | void StartDefaultTask(void const * argument); 59 | 60 | void MX_FREERTOS_Init(void); /* (MISRA C 2004 rule 8.1) */ 61 | 62 | /* GetIdleTaskMemory prototype (linked to static allocation support) */ 63 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ); 64 | 65 | /* Hook prototypes */ 66 | void configureTimerForRunTimeStats(void); 67 | unsigned long getRunTimeCounterValue(void); 68 | void vApplicationStackOverflowHook(xTaskHandle xTask, signed char *pcTaskName); 69 | void vApplicationMallocFailedHook(void); 70 | 71 | /* USER CODE BEGIN 1 */ 72 | /* Functions needed when configGENERATE_RUN_TIME_STATS is on */ 73 | __weak void configureTimerForRunTimeStats(void) 74 | { 75 | 76 | } 77 | 78 | __weak unsigned long getRunTimeCounterValue(void) 79 | { 80 | return 0; 81 | } 82 | /* USER CODE END 1 */ 83 | 84 | /* USER CODE BEGIN 4 */ 85 | __weak void vApplicationStackOverflowHook(xTaskHandle xTask, signed char *pcTaskName) 86 | { 87 | /* Run time stack overflow checking is performed if 88 | configCHECK_FOR_STACK_OVERFLOW is defined to 1 or 2. This hook function is 89 | called if a stack overflow is detected. */ 90 | } 91 | /* USER CODE END 4 */ 92 | 93 | /* USER CODE BEGIN 5 */ 94 | __weak void vApplicationMallocFailedHook(void) 95 | { 96 | /* vApplicationMallocFailedHook() will only be called if 97 | configUSE_MALLOC_FAILED_HOOK is set to 1 in FreeRTOSConfig.h. It is a hook 98 | function that will get called if a call to pvPortMalloc() fails. 99 | pvPortMalloc() is called internally by the kernel whenever a task, queue, 100 | timer or semaphore is created. It is also called by various parts of the 101 | demo application. If heap_1.c or heap_2.c are used, then the size of the 102 | heap available to pvPortMalloc() is defined by configTOTAL_HEAP_SIZE in 103 | FreeRTOSConfig.h, and the xPortGetFreeHeapSize() API function can be used 104 | to query the size of free heap space that remains (although it does not 105 | provide information on how the remaining heap might be fragmented). */ 106 | } 107 | /* USER CODE END 5 */ 108 | 109 | /* USER CODE BEGIN GET_IDLE_TASK_MEMORY */ 110 | static StaticTask_t xIdleTaskTCBBuffer; 111 | static StackType_t xIdleStack[configMINIMAL_STACK_SIZE]; 112 | 113 | void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize ) 114 | { 115 | *ppxIdleTaskTCBBuffer = &xIdleTaskTCBBuffer; 116 | *ppxIdleTaskStackBuffer = &xIdleStack[0]; 117 | *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE; 118 | /* place for user code */ 119 | } 120 | /* USER CODE END GET_IDLE_TASK_MEMORY */ 121 | 122 | /** 123 | * @brief FreeRTOS initialization 124 | * @param None 125 | * @retval None 126 | */ 127 | void MX_FREERTOS_Init(void) { 128 | /* USER CODE BEGIN Init */ 129 | 130 | /* USER CODE END Init */ 131 | 132 | /* USER CODE BEGIN RTOS_MUTEX */ 133 | /* add mutexes, ... */ 134 | /* USER CODE END RTOS_MUTEX */ 135 | 136 | /* USER CODE BEGIN RTOS_SEMAPHORES */ 137 | /* add semaphores, ... */ 138 | /* USER CODE END RTOS_SEMAPHORES */ 139 | 140 | /* USER CODE BEGIN RTOS_TIMERS */ 141 | /* start timers, add new ones, ... */ 142 | /* USER CODE END RTOS_TIMERS */ 143 | 144 | /* USER CODE BEGIN RTOS_QUEUES */ 145 | /* add queues, ... */ 146 | /* USER CODE END RTOS_QUEUES */ 147 | 148 | /* Create the thread(s) */ 149 | /* definition and creation of defaultTask */ 150 | osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 128); 151 | defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL); 152 | 153 | /* USER CODE BEGIN RTOS_THREADS */ 154 | /* add threads, ... */ 155 | /* USER CODE END RTOS_THREADS */ 156 | 157 | } 158 | 159 | /* USER CODE BEGIN Header_StartDefaultTask */ 160 | /** 161 | * @brief Function implementing the defaultTask thread. 162 | * @param argument: Not used 163 | * @retval None 164 | */ 165 | /* USER CODE END Header_StartDefaultTask */ 166 | void StartDefaultTask(void const * argument) 167 | { 168 | /* USER CODE BEGIN StartDefaultTask */ 169 | /* Infinite loop */ 170 | for(;;) 171 | { 172 | osDelay(1); 173 | } 174 | /* USER CODE END StartDefaultTask */ 175 | } 176 | 177 | /* Private application code --------------------------------------------------*/ 178 | /* USER CODE BEGIN Application */ 179 | 180 | /* USER CODE END Application */ 181 | 182 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 183 | -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 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 | /** Pinout Configuration 34 | */ 35 | void MX_GPIO_Init(void) 36 | { 37 | 38 | /* GPIO Ports Clock Enable */ 39 | __HAL_RCC_GPIOD_CLK_ENABLE(); 40 | __HAL_RCC_GPIOG_CLK_ENABLE(); 41 | HAL_PWREx_EnableVddIO2(); 42 | __HAL_RCC_GPIOA_CLK_ENABLE(); 43 | 44 | } 45 | 46 | /* USER CODE BEGIN 2 */ 47 | 48 | /* USER CODE END 2 */ 49 | 50 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 51 | -------------------------------------------------------------------------------- /zigbee_test/Core/Src/log.c: -------------------------------------------------------------------------------- 1 | #include "log.h" 2 | #include "FreeRTOS.h" 3 | #include "semphr.h" 4 | #include "usart.h" 5 | #include 6 | 7 | // semaphore 8 | static SemaphoreHandle_t dbg_sem; 9 | 10 | // small local working buffer 11 | static char working_buffer[256]; 12 | 13 | void log_init(void) { 14 | dbg_sem = xSemaphoreCreateBinary(); 15 | xSemaphoreGive(dbg_sem); 16 | } 17 | 18 | void log_print(const char *fmt, ...) { 19 | if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED) { 20 | // take semaphore 21 | if (xSemaphoreTake(dbg_sem, 1000) == pdFALSE) 22 | return; 23 | 24 | // append tick 25 | snprintf(working_buffer, 256, "%lu\t", xTaskGetTickCount()); 26 | 27 | // append parameters 28 | va_list args; 29 | va_start(args, fmt); 30 | vsnprintf(&working_buffer[strlen(working_buffer)], 256 - strlen(working_buffer), fmt, args); 31 | va_end(args); 32 | 33 | // send data 34 | HAL_UART_Transmit(&huart2, (char *)working_buffer, strlen(working_buffer), 100); 35 | 36 | // Give semaphore back 37 | xSemaphoreGive(dbg_sem); 38 | } 39 | else { 40 | // append parameters 41 | va_list args; 42 | va_start(args, fmt); 43 | vsnprintf(working_buffer, 256, fmt, args); 44 | va_end(args); 45 | 46 | // send data 47 | HAL_UART_Transmit(&huart2, (char *)working_buffer, strlen(working_buffer), 100); 48 | } 49 | } -------------------------------------------------------------------------------- /zigbee_test/Core/Src/stm32l4xx_hal_msp.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * File Name : stm32l4xx_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) 2021 STMicroelectronics. 11 | * All rights reserved.

12 | * 13 | * This software component is licensed by ST under BSD 3-Clause license, 14 | * the "License"; You may not use this file except in compliance with the 15 | * License. You may obtain a copy of the License at: 16 | * opensource.org/licenses/BSD-3-Clause 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_SYSCFG_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 | /* USER CODE BEGIN MspInit 1 */ 78 | 79 | /* USER CODE END MspInit 1 */ 80 | } 81 | 82 | /* USER CODE BEGIN 1 */ 83 | 84 | /* USER CODE END 1 */ 85 | 86 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 87 | -------------------------------------------------------------------------------- /zigbee_test/Core/Src/stm32l4xx_hal_timebase_tim.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32l4xx_hal_timebase_TIM.c 5 | * @brief HAL time base based on the hardware TIM. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2021 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 "stm32l4xx_hal.h" 23 | #include "stm32l4xx_hal_tim.h" 24 | 25 | /* Private typedef -----------------------------------------------------------*/ 26 | /* Private define ------------------------------------------------------------*/ 27 | /* Private macro -------------------------------------------------------------*/ 28 | /* Private variables ---------------------------------------------------------*/ 29 | TIM_HandleTypeDef htim1; 30 | /* Private function prototypes -----------------------------------------------*/ 31 | /* Private functions ---------------------------------------------------------*/ 32 | 33 | /** 34 | * @brief This function configures the TIM1 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 TIM1 IRQ priority */ 50 | HAL_NVIC_SetPriority(TIM1_UP_TIM16_IRQn, TickPriority ,0); 51 | 52 | /* Enable the TIM1 global Interrupt */ 53 | HAL_NVIC_EnableIRQ(TIM1_UP_TIM16_IRQn); 54 | 55 | /* Enable TIM1 clock */ 56 | __HAL_RCC_TIM1_CLK_ENABLE(); 57 | 58 | /* Get clock configuration */ 59 | HAL_RCC_GetClockConfig(&clkconfig, &pFLatency); 60 | 61 | /* Compute TIM1 clock */ 62 | uwTimclock = HAL_RCC_GetPCLK2Freq(); 63 | 64 | /* Compute the prescaler value to have TIM1 counter clock equal to 1MHz */ 65 | uwPrescalerValue = (uint32_t) ((uwTimclock / 1000000) - 1); 66 | 67 | /* Initialize TIM1 */ 68 | htim1.Instance = TIM1; 69 | 70 | /* Initialize TIMx peripheral as follow: 71 | + Period = [(TIM1CLK/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 | htim1.Init.Period = (1000000 / 1000) - 1; 77 | htim1.Init.Prescaler = uwPrescalerValue; 78 | htim1.Init.ClockDivision = 0; 79 | htim1.Init.CounterMode = TIM_COUNTERMODE_UP; 80 | if(HAL_TIM_Base_Init(&htim1) == HAL_OK) 81 | { 82 | /* Start the TIM time Base generation in interrupt mode */ 83 | return HAL_TIM_Base_Start_IT(&htim1); 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 TIM1 update interrupt. 93 | * @param None 94 | * @retval None 95 | */ 96 | void HAL_SuspendTick(void) 97 | { 98 | /* Disable TIM1 update Interrupt */ 99 | __HAL_TIM_DISABLE_IT(&htim1, TIM_IT_UPDATE); 100 | } 101 | 102 | /** 103 | * @brief Resume Tick increment. 104 | * @note Enable the tick increment by Enabling TIM1 update interrupt. 105 | * @param None 106 | * @retval None 107 | */ 108 | void HAL_ResumeTick(void) 109 | { 110 | /* Enable TIM1 Update interrupt */ 111 | __HAL_TIM_ENABLE_IT(&htim1, TIM_IT_UPDATE); 112 | } 113 | 114 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 115 | -------------------------------------------------------------------------------- /zigbee_test/Core/Src/stm32l4xx_it.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Header */ 2 | /** 3 | ****************************************************************************** 4 | * @file stm32l4xx_it.c 5 | * @brief Interrupt Service Routines. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2021 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | /* USER CODE END Header */ 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "main.h" 23 | #include "stm32l4xx_it.h" 24 | #include "FreeRTOS.h" 25 | #include "task.h" 26 | /* Private includes ----------------------------------------------------------*/ 27 | /* USER CODE BEGIN Includes */ 28 | #include "rpcTransport.h" 29 | /* USER CODE END Includes */ 30 | 31 | /* Private typedef -----------------------------------------------------------*/ 32 | /* USER CODE BEGIN TD */ 33 | 34 | /* USER CODE END TD */ 35 | 36 | /* Private define ------------------------------------------------------------*/ 37 | /* USER CODE BEGIN PD */ 38 | 39 | /* USER CODE END PD */ 40 | 41 | /* Private macro -------------------------------------------------------------*/ 42 | /* USER CODE BEGIN PM */ 43 | 44 | /* USER CODE END PM */ 45 | 46 | /* Private variables ---------------------------------------------------------*/ 47 | /* USER CODE BEGIN PV */ 48 | 49 | /* USER CODE END PV */ 50 | 51 | /* Private function prototypes -----------------------------------------------*/ 52 | /* USER CODE BEGIN PFP */ 53 | 54 | /* USER CODE END PFP */ 55 | 56 | /* Private user code ---------------------------------------------------------*/ 57 | /* USER CODE BEGIN 0 */ 58 | 59 | /* USER CODE END 0 */ 60 | 61 | /* External variables --------------------------------------------------------*/ 62 | extern UART_HandleTypeDef hlpuart1; 63 | extern TIM_HandleTypeDef htim1; 64 | 65 | /* USER CODE BEGIN EV */ 66 | 67 | /* USER CODE END EV */ 68 | 69 | /******************************************************************************/ 70 | /* Cortex-M4 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 | /* STM32L4xx 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_stm32l4xx.s). */ 163 | /******************************************************************************/ 164 | 165 | /** 166 | * @brief This function handles TIM1 update interrupt and TIM16 global interrupt. 167 | */ 168 | void TIM1_UP_TIM16_IRQHandler(void) 169 | { 170 | /* USER CODE BEGIN TIM1_UP_TIM16_IRQn 0 */ 171 | 172 | /* USER CODE END TIM1_UP_TIM16_IRQn 0 */ 173 | HAL_TIM_IRQHandler(&htim1); 174 | /* USER CODE BEGIN TIM1_UP_TIM16_IRQn 1 */ 175 | 176 | /* USER CODE END TIM1_UP_TIM16_IRQn 1 */ 177 | } 178 | 179 | /** 180 | * @brief This function handles LPUART1 global interrupt. 181 | */ 182 | void LPUART1_IRQHandler(void) 183 | { 184 | /* USER CODE BEGIN LPUART1_IRQn 0 */ 185 | #if 0 186 | /* USER CODE END LPUART1_IRQn 0 */ 187 | HAL_UART_IRQHandler(&hlpuart1); 188 | /* USER CODE BEGIN LPUART1_IRQn 1 */ 189 | #endif 190 | rpcTransportISR(); 191 | /* USER CODE END LPUART1_IRQn 1 */ 192 | } 193 | 194 | /* USER CODE BEGIN 1 */ 195 | 196 | /* USER CODE END 1 */ 197 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 198 | -------------------------------------------------------------------------------- /zigbee_test/Core/Src/syscalls.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file syscalls.c 4 | * @author Auto-generated by STM32CubeIDE 5 | * @brief STM32CubeIDE Minimal System calls file 6 | * 7 | * For more information about which c-functions 8 | * need which of these lowlevel functions 9 | * please consult the Newlib libc-manual 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | *

© Copyright (c) 2020 STMicroelectronics. 14 | * All rights reserved.

15 | * 16 | * This software component is licensed by ST under BSD 3-Clause license, 17 | * the "License"; You may not use this file except in compliance with the 18 | * License. You may obtain a copy of the License at: 19 | * opensource.org/licenses/BSD-3-Clause 20 | * 21 | ****************************************************************************** 22 | */ 23 | 24 | /* Includes */ 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | 35 | /* Variables */ 36 | //#undef errno 37 | extern int errno; 38 | extern int __io_putchar(int ch) __attribute__((weak)); 39 | extern int __io_getchar(void) __attribute__((weak)); 40 | 41 | register char * stack_ptr asm("sp"); 42 | 43 | char *__env[1] = { 0 }; 44 | char **environ = __env; 45 | 46 | 47 | /* Functions */ 48 | void initialise_monitor_handles() 49 | { 50 | } 51 | 52 | int _getpid(void) 53 | { 54 | return 1; 55 | } 56 | 57 | int _kill(int pid, int sig) 58 | { 59 | errno = EINVAL; 60 | return -1; 61 | } 62 | 63 | void _exit (int status) 64 | { 65 | _kill(status, -1); 66 | while (1) {} /* Make sure we hang here */ 67 | } 68 | 69 | __attribute__((weak)) int _read(int file, char *ptr, int len) 70 | { 71 | int DataIdx; 72 | 73 | for (DataIdx = 0; DataIdx < len; DataIdx++) 74 | { 75 | *ptr++ = __io_getchar(); 76 | } 77 | 78 | return len; 79 | } 80 | 81 | __attribute__((weak)) int _write(int file, char *ptr, int len) 82 | { 83 | int DataIdx; 84 | 85 | for (DataIdx = 0; DataIdx < len; DataIdx++) 86 | { 87 | __io_putchar(*ptr++); 88 | } 89 | return len; 90 | } 91 | 92 | int _close(int file) 93 | { 94 | return -1; 95 | } 96 | 97 | 98 | int _fstat(int file, struct stat *st) 99 | { 100 | st->st_mode = S_IFCHR; 101 | return 0; 102 | } 103 | 104 | int _isatty(int file) 105 | { 106 | return 1; 107 | } 108 | 109 | int _lseek(int file, int ptr, int dir) 110 | { 111 | return 0; 112 | } 113 | 114 | int _open(char *path, int flags, ...) 115 | { 116 | /* Pretend like we always fail */ 117 | return -1; 118 | } 119 | 120 | int _wait(int *status) 121 | { 122 | errno = ECHILD; 123 | return -1; 124 | } 125 | 126 | int _unlink(char *name) 127 | { 128 | errno = ENOENT; 129 | return -1; 130 | } 131 | 132 | int _times(struct tms *buf) 133 | { 134 | return -1; 135 | } 136 | 137 | int _stat(char *file, struct stat *st) 138 | { 139 | st->st_mode = S_IFCHR; 140 | return 0; 141 | } 142 | 143 | int _link(char *old, char *new) 144 | { 145 | errno = EMLINK; 146 | return -1; 147 | } 148 | 149 | int _fork(void) 150 | { 151 | errno = EAGAIN; 152 | return -1; 153 | } 154 | 155 | int _execve(char *name, char **argv, char **env) 156 | { 157 | errno = ENOMEM; 158 | return -1; 159 | } 160 | -------------------------------------------------------------------------------- /zigbee_test/Core/Src/sysmem.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file sysmem.c 4 | * @author Auto-generated by STM32CubeIDE 5 | * @brief STM32CubeIDE Minimal System Memory calls file 6 | * 7 | * For more information about which c-functions 8 | * need which of these lowlevel functions 9 | * please consult the Newlib libc-manual 10 | ****************************************************************************** 11 | * @attention 12 | * 13 | *

© Copyright (c) 2020 STMicroelectronics. 14 | * All rights reserved.

15 | * 16 | * This software component is licensed by ST under BSD 3-Clause license, 17 | * the "License"; You may not use this file except in compliance with the 18 | * License. You may obtain a copy of the License at: 19 | * opensource.org/licenses/BSD-3-Clause 20 | * 21 | ****************************************************************************** 22 | */ 23 | 24 | /* Includes */ 25 | #include 26 | #include 27 | 28 | /* Variables */ 29 | extern int errno; 30 | register char * stack_ptr asm("sp"); 31 | 32 | /* Functions */ 33 | 34 | /** 35 | _sbrk 36 | Increase program data space. Malloc and related functions depend on this 37 | **/ 38 | caddr_t _sbrk(int incr) 39 | { 40 | extern char end asm("end"); 41 | static char *heap_end; 42 | char *prev_heap_end; 43 | 44 | if (heap_end == 0) 45 | heap_end = &end; 46 | 47 | prev_heap_end = heap_end; 48 | if (heap_end + incr > stack_ptr) 49 | { 50 | errno = ENOMEM; 51 | return (caddr_t) -1; 52 | } 53 | 54 | heap_end += incr; 55 | 56 | return (caddr_t) prev_heap_end; 57 | } 58 | 59 | -------------------------------------------------------------------------------- /zigbee_test/Core/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) 2021 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 hlpuart1; 28 | UART_HandleTypeDef huart2; 29 | 30 | /* LPUART1 init function */ 31 | 32 | void MX_LPUART1_UART_Init(void) 33 | { 34 | 35 | hlpuart1.Instance = LPUART1; 36 | hlpuart1.Init.BaudRate = 115200; 37 | hlpuart1.Init.WordLength = UART_WORDLENGTH_8B; 38 | hlpuart1.Init.StopBits = UART_STOPBITS_1; 39 | hlpuart1.Init.Parity = UART_PARITY_NONE; 40 | hlpuart1.Init.Mode = UART_MODE_TX_RX; 41 | hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; 42 | hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; 43 | hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT|UART_ADVFEATURE_DMADISABLEONERROR_INIT; 44 | hlpuart1.AdvancedInit.OverrunDisable = UART_ADVFEATURE_OVERRUN_DISABLE; 45 | hlpuart1.AdvancedInit.DMADisableonRxError = UART_ADVFEATURE_DMA_DISABLEONRXERROR; 46 | if (HAL_UART_Init(&hlpuart1) != HAL_OK) 47 | { 48 | Error_Handler(); 49 | } 50 | 51 | } 52 | /* USART2 init function */ 53 | 54 | void MX_USART2_UART_Init(void) 55 | { 56 | 57 | huart2.Instance = USART2; 58 | huart2.Init.BaudRate = 115200; 59 | huart2.Init.WordLength = UART_WORDLENGTH_8B; 60 | huart2.Init.StopBits = UART_STOPBITS_1; 61 | huart2.Init.Parity = UART_PARITY_NONE; 62 | huart2.Init.Mode = UART_MODE_TX_RX; 63 | huart2.Init.HwFlowCtl = UART_HWCONTROL_NONE; 64 | huart2.Init.OverSampling = UART_OVERSAMPLING_16; 65 | huart2.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; 66 | huart2.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_RXOVERRUNDISABLE_INIT|UART_ADVFEATURE_DMADISABLEONERROR_INIT; 67 | huart2.AdvancedInit.OverrunDisable = UART_ADVFEATURE_OVERRUN_DISABLE; 68 | huart2.AdvancedInit.DMADisableonRxError = UART_ADVFEATURE_DMA_DISABLEONRXERROR; 69 | if (HAL_UART_Init(&huart2) != HAL_OK) 70 | { 71 | Error_Handler(); 72 | } 73 | 74 | } 75 | 76 | void HAL_UART_MspInit(UART_HandleTypeDef* uartHandle) 77 | { 78 | 79 | GPIO_InitTypeDef GPIO_InitStruct = {0}; 80 | if(uartHandle->Instance==LPUART1) 81 | { 82 | /* USER CODE BEGIN LPUART1_MspInit 0 */ 83 | 84 | /* USER CODE END LPUART1_MspInit 0 */ 85 | /* LPUART1 clock enable */ 86 | __HAL_RCC_LPUART1_CLK_ENABLE(); 87 | 88 | __HAL_RCC_GPIOG_CLK_ENABLE(); 89 | HAL_PWREx_EnableVddIO2(); 90 | /**LPUART1 GPIO Configuration 91 | PG8 ------> LPUART1_RX 92 | PG7 ------> LPUART1_TX 93 | */ 94 | GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_7; 95 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 96 | GPIO_InitStruct.Pull = GPIO_NOPULL; 97 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 98 | GPIO_InitStruct.Alternate = GPIO_AF8_LPUART1; 99 | HAL_GPIO_Init(GPIOG, &GPIO_InitStruct); 100 | 101 | /* LPUART1 interrupt Init */ 102 | HAL_NVIC_SetPriority(LPUART1_IRQn, 5, 0); 103 | HAL_NVIC_EnableIRQ(LPUART1_IRQn); 104 | /* USER CODE BEGIN LPUART1_MspInit 1 */ 105 | 106 | /* USER CODE END LPUART1_MspInit 1 */ 107 | } 108 | else if(uartHandle->Instance==USART2) 109 | { 110 | /* USER CODE BEGIN USART2_MspInit 0 */ 111 | 112 | /* USER CODE END USART2_MspInit 0 */ 113 | /* USART2 clock enable */ 114 | __HAL_RCC_USART2_CLK_ENABLE(); 115 | 116 | __HAL_RCC_GPIOD_CLK_ENABLE(); 117 | __HAL_RCC_GPIOA_CLK_ENABLE(); 118 | /**USART2 GPIO Configuration 119 | PD6 ------> USART2_RX 120 | PA2 ------> USART2_TX 121 | */ 122 | GPIO_InitStruct.Pin = GPIO_PIN_6; 123 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 124 | GPIO_InitStruct.Pull = GPIO_NOPULL; 125 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 126 | GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 127 | HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); 128 | 129 | GPIO_InitStruct.Pin = GPIO_PIN_2; 130 | GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; 131 | GPIO_InitStruct.Pull = GPIO_NOPULL; 132 | GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; 133 | GPIO_InitStruct.Alternate = GPIO_AF7_USART2; 134 | HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); 135 | 136 | /* USER CODE BEGIN USART2_MspInit 1 */ 137 | 138 | /* USER CODE END USART2_MspInit 1 */ 139 | } 140 | } 141 | 142 | void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle) 143 | { 144 | 145 | if(uartHandle->Instance==LPUART1) 146 | { 147 | /* USER CODE BEGIN LPUART1_MspDeInit 0 */ 148 | 149 | /* USER CODE END LPUART1_MspDeInit 0 */ 150 | /* Peripheral clock disable */ 151 | __HAL_RCC_LPUART1_CLK_DISABLE(); 152 | 153 | /**LPUART1 GPIO Configuration 154 | PG8 ------> LPUART1_RX 155 | PG7 ------> LPUART1_TX 156 | */ 157 | HAL_GPIO_DeInit(GPIOG, GPIO_PIN_8|GPIO_PIN_7); 158 | 159 | /* LPUART1 interrupt Deinit */ 160 | HAL_NVIC_DisableIRQ(LPUART1_IRQn); 161 | /* USER CODE BEGIN LPUART1_MspDeInit 1 */ 162 | 163 | /* USER CODE END LPUART1_MspDeInit 1 */ 164 | } 165 | else if(uartHandle->Instance==USART2) 166 | { 167 | /* USER CODE BEGIN USART2_MspDeInit 0 */ 168 | 169 | /* USER CODE END USART2_MspDeInit 0 */ 170 | /* Peripheral clock disable */ 171 | __HAL_RCC_USART2_CLK_DISABLE(); 172 | 173 | /**USART2 GPIO Configuration 174 | PD6 ------> USART2_RX 175 | PA2 ------> USART2_TX 176 | */ 177 | HAL_GPIO_DeInit(GPIOD, GPIO_PIN_6); 178 | 179 | HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2); 180 | 181 | /* USER CODE BEGIN USART2_MspDeInit 1 */ 182 | 183 | /* USER CODE END USART2_MspDeInit 1 */ 184 | } 185 | } 186 | 187 | /* USER CODE BEGIN 1 */ 188 | 189 | /* USER CODE END 1 */ 190 | 191 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 192 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-app/znp_cb.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZNP_CB_H__ 2 | #define __ZNP_CB_H__ 3 | 4 | extern void znp_cb_register(void); 5 | 6 | #endif -------------------------------------------------------------------------------- /zigbee_test/Core/znp-app/znp_cmd.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZNP_CMD_H__ 2 | #define __ZNP_CMD_H__ 3 | 4 | #include 5 | 6 | #define ZNP_DATA_LEN_MAX 32 7 | 8 | typedef enum { 9 | ZCL_CMD_READ_ATTR = 0x00, 10 | ZCL_CMD_READ_ATTR_RSP = 0x01, 11 | ZCL_CMD_WRITE_ATTR = 0x02, 12 | ZCL_CMD_WRITE_ATTR_RSP = 0x04 13 | } zcl_cmd_type_t; 14 | 15 | typedef enum { 16 | ZCL_NO_DATA_TYPE = 0x00, 17 | ZCL_DATA_8BITS = 0x08, 18 | ZCL_DATA_16BITS = 0x09, 19 | ZCL_DATA_24BITS = 0x0a, 20 | ZCL_DATA_32BITS = 0x0b, 21 | ZCL_DATA_40BITS = 0x0c, 22 | ZCL_DATA_48BITS = 0x0d, 23 | ZCL_DATA_56BITS = 0x0e, 24 | ZCL_DATA_64BITS = 0x0f, 25 | ZCL_BOOLEAN_8BITS = 0x10, 26 | ZCL_BITMAP_8BITS = 0x18, 27 | ZCL_BITMAP_16BITS = 0x19, 28 | ZCL_BITMAP_24BITS = 0x1a, 29 | ZCL_BITMAP_32BITS = 0x1b, 30 | ZCL_BITMAP_40BITS = 0x1c, 31 | ZCL_BITMAP_48BITS = 0x1d, 32 | ZCL_BITMAP_56BITS = 0x1e, 33 | ZCL_BITMAP_64BITS = 0x1f, 34 | ZCL_UNSIGNED_8BITS = 0x20, 35 | ZCL_UNSIGNED_16BITS = 0x21, 36 | ZCL_UNSIGNED_24BITS = 0x22, 37 | ZCL_UNSIGNED_32BITS = 0x23, 38 | ZCL_UNSIGNED_40BITS = 0x24, 39 | ZCL_UNSIGNED_48BITS = 0x25, 40 | ZCL_UNSIGNED_56BITS = 0x26, 41 | ZCL_UNSIGNED_64BITS = 0x27, 42 | ZCL_SIGNED_8BITS = 0x28, 43 | ZCL_SIGNED_16BITS = 0x29, 44 | ZCL_SIGNED_24BITS = 0x2a, 45 | ZCL_SIGNED_32BITS = 0x2b, 46 | ZCL_SIGNED_40BITS = 0x2c, 47 | ZCL_SIGNED_48BITS = 0x2d, 48 | ZCL_SIGNED_56BITS = 0x2e, 49 | ZCL_SIGNED_64BITS = 0x2f, 50 | ZCL_ENUMERATION_8BITS = 0x30, 51 | ZCL_ENUMERATION_16BITS = 0x31, 52 | ZCL_SEMI_PRECISION = 0x38, 53 | ZCL_SINGLE_PRECISION = 0x39, 54 | ZCL_DOUBLE_PRECISION = 0x3a, 55 | ZCL_OCTET_STRING = 0x41, 56 | ZCL_CHARACTER_STRING = 0x42, 57 | ZCL_LONG_OCTET_STRING = 0x43, 58 | ZCL_LONG_CHAR_STRING = 0x44, 59 | ZCL_ARRAY_ORDERED = 0x48, 60 | ZCL_STRUCTURE_ORDERED = 0x4c, 61 | ZCL_SET_COLLECTION = 0x50, 62 | ZCL_BAG_COLLECTION = 0x51, 63 | ZCL_TIME_OF_DAY = 0xe0, 64 | ZCL_DATE_OF_DAY = 0xe1, 65 | ZCL_UTC_TIME = 0xe2, 66 | ZCL_CLUSTER_ID = 0xe8, 67 | ZCL_ATTRIBUTE_ID = 0xe9, 68 | ZCL_BACNET_OID = 0xea, 69 | ZCL_IEEE_ADDRESS = 0xf0, 70 | ZCL_SECURITY_KEY_128BITS = 0xf1, 71 | ZCL_UNKNOWN = 0xff 72 | } zcl_data_type_t; 73 | 74 | typedef struct { 75 | zcl_data_type_t type; 76 | union { 77 | int8_t data_i8; 78 | uint8_t data_u8; 79 | int16_t data_i16; 80 | uint16_t data_u16; 81 | int32_t data_i32; 82 | uint32_t data_u32; 83 | int64_t data_i64; 84 | uint64_t data_u64; 85 | uint8_t data_bool; 86 | float data_float; 87 | uint8_t data_arr[ZNP_DATA_LEN_MAX]; 88 | uint8_t data_arr_len; 89 | }; 90 | } zcl_cluster_record_t; 91 | 92 | extern void znp_cmd_init(void); 93 | 94 | extern int znp_cmd_dev_is_active(uint16_t address); 95 | 96 | extern int znp_cmd_dev_refresh_info(uint16_t address); 97 | 98 | extern int znp_cmd_dev_get_ieee(uint16_t address, uint64_t *adr_ieee); 99 | 100 | extern int znp_cmd_dev_register(uint16_t address); 101 | 102 | extern int znp_cmd_cluster_in_read(uint16_t address, uint16_t cluster, uint16_t attribute, zcl_cluster_record_t* record); 103 | 104 | extern int znp_cmd_cluster_in_write(uint16_t address, uint16_t cluster, uint16_t attribute, zcl_cluster_record_t* record); 105 | 106 | #endif 107 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-app/znp_if.c: -------------------------------------------------------------------------------- 1 | #include "znp_if.h" 2 | #include 3 | #include "FreeRTOS.h" 4 | #include "queue.h" 5 | 6 | static znp_device_t _dev_mem[DEVICE_MEM_MAX]; 7 | static QueueHandle_t _znp_ev_queue; 8 | 9 | void znp_if_init(void) { 10 | _znp_ev_queue = xQueueCreate(EV_QUEUE_SIZE, sizeof(event_result_t)); 11 | } 12 | 13 | void znp_if_evt_send(event_result_t* res) { 14 | xQueueSendToBack(_znp_ev_queue, res, 100); 15 | } 16 | 17 | event_result_t *znp_if_wait_for_event(event_type_t event_to_wait_for, uint16_t address, uint32_t timeout) { 18 | uint32_t waittime = timeout; 19 | uint32_t start = xTaskGetTickCount(); 20 | static event_result_t event = { 0 }; 21 | 22 | // loop 23 | while (1) { 24 | // calculate new timeout 25 | uint32_t passed_time = start - xTaskGetTickCount(); 26 | waittime -= passed_time; 27 | start = xTaskGetTickCount(); 28 | 29 | BaseType_t wat = xQueueReceive(_znp_ev_queue, &event, waittime); 30 | 31 | // event was given? 32 | if (wat == pdTRUE) { 33 | // correct address and event? 34 | if ((event.adr == address || event.adr == 0xFFFF) && event.type == event_to_wait_for) { 35 | break; 36 | } 37 | } 38 | else { 39 | // error 40 | event.type = EVT_NONE; 41 | 42 | // done 43 | break; 44 | } 45 | } 46 | 47 | // did we get the right event type? 48 | if (event.type == event_to_wait_for) { 49 | if (event.result == 0) 50 | return &event; 51 | else 52 | return NULL; 53 | } 54 | // bit not set, timeout 55 | else { 56 | return NULL; 57 | } 58 | } 59 | 60 | znp_device_t* znp_if_dev_get(uint16_t address) { 61 | // invalid address? 62 | if (address == 0x0000 || address == 0xFFFF) 63 | return NULL; 64 | 65 | // check if device already exists 66 | for (uint8_t i = 0; i < DEVICE_MEM_MAX; i++) { 67 | if (_dev_mem[i].adr_short == address) { 68 | return &_dev_mem[i]; 69 | } 70 | } 71 | return NULL; 72 | } 73 | 74 | uint8_t znp_if_dev_exists(uint16_t address) { 75 | // check if device already exists 76 | if (znp_if_dev_get(address) == NULL) 77 | return 0; 78 | else 79 | return 1; 80 | } 81 | 82 | int znp_if_dev_add(uint16_t address) { 83 | // check if device already exists 84 | if (znp_if_dev_exists(address)) 85 | return 0; 86 | 87 | // search for a free spot 88 | uint8_t index; 89 | for (index = 0; index < DEVICE_MEM_MAX; index++) { 90 | if (_dev_mem[index].adr_short == 0x0000) { 91 | break; 92 | } 93 | } 94 | 95 | // no free spot found? 96 | if (index >= DEVICE_MEM_MAX) 97 | return -1; 98 | 99 | // free spot, remember address 100 | _dev_mem[index].adr_short = address; 101 | 102 | // all good 103 | return 0; 104 | } 105 | 106 | int znp_if_dev_set_ieee(uint16_t address, uint64_t ieee_adr) { 107 | // get device handle 108 | znp_device_t* dev = znp_if_dev_get(address); 109 | 110 | // invalid handle? 111 | if (dev == NULL) 112 | return -1; 113 | 114 | // save ieee 115 | dev->adr_ieee = ieee_adr; 116 | 117 | // all good 118 | return 0; 119 | } 120 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-app/znp_if.h: -------------------------------------------------------------------------------- 1 | #ifndef __ZNP_IF_H__ 2 | #define __ZNP_IF_H__ 3 | 4 | #include 5 | 6 | #define DEVICE_MEM_MAX 32 7 | #define CLSTR_LIST_MAX 16 8 | 9 | #define EV_QUEUE_SIZE 4 10 | #define EV_DATA_LEN_MAX 32 11 | 12 | typedef struct { 13 | uint16_t adr_short; 14 | uint16_t adr_ieee; 15 | uint16_t profile_id; 16 | uint16_t device_id; 17 | uint8_t clstr_in_cnt; 18 | uint16_t clstr_in_list[CLSTR_LIST_MAX]; 19 | uint8_t clstr_out_cnt; 20 | uint16_t clstr_out_list[CLSTR_LIST_MAX]; 21 | } znp_device_t; 22 | 23 | typedef enum { 24 | EVT_NONE, 25 | EVT_RSP_IS_ACTIVE, 26 | EVT_RSP_SIMPLE_DESC, 27 | EVT_RSP_IEEE_ADR, 28 | EVT_RSP_REGISTER, 29 | EVT_RSP_DATA_REQUEST, 30 | } event_type_t; 31 | 32 | typedef struct { 33 | event_type_t type; 34 | uint16_t adr; 35 | uint8_t result; 36 | uint8_t data_len; 37 | uint8_t data[EV_DATA_LEN_MAX]; 38 | } event_result_t; 39 | 40 | extern void znp_if_init(void); 41 | 42 | extern void znp_if_evt_send(event_result_t *res); 43 | 44 | extern event_result_t *znp_if_wait_for_event(event_type_t event_to_wait_for, uint16_t address, uint32_t timeout); 45 | 46 | extern znp_device_t* znp_if_dev_get(uint16_t address); 47 | 48 | extern uint8_t znp_if_dev_exists(uint16_t address); 49 | 50 | extern int znp_if_dev_add(uint16_t address); 51 | 52 | extern int znp_if_dev_set_ieee(uint16_t address, uint64_t ieee_adr); 53 | 54 | #endif -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/README.MD: -------------------------------------------------------------------------------- 1 | # ZNP Host Framework 2 | 3 | ## Introduction 4 | 5 | This git repository contains the source code for the ZNP POSIX Host Framework and Examples. The project is intended to help developer to develop ZigBee application on a host MCU/MPU connected to the Texas Instruments ZigBee Network Processor (CC253x). The framework offers a C callable / callback API to access the ZigBee Network Processor functionality available as a Binary Remote Procedure Call format over the UART/SPI interface. 6 | 7 | The Framework and Examples utilize a subset of POSIX functions to access OS functionality (Semaphores etc) making it easily portable between OS’s (High Level or Real Time) and HW platforms. 8 | 9 | The Examples currently implemented are: 10 | 11 | - CmdLine: A command line example that exposes the ZNP API on the command line, auto complete and help on the available commands is at hand by pressing TAB. This example allows the user to intuitively learn the ZNP interface API as well as ZigBee commands. 12 | - DataSendRecv: A Simple example to send / receive data between nodes in the network. 13 | - NwkTopology: A Simple example to discover the topology of a network that the node is a part of. 14 | - servDesc: A Simple example to discover services of nodes on the network. 15 | - stressTest: A test example used for testing the robustness of the framework. 16 | 17 | The Platforms currently supported are: 18 | 19 | The framework and examples are described in more detail in the UserGuide in the /docs directory of this git. 20 | 21 | ## Quick Start Guide 22 | 23 | ### Required HW 24 | For the Linux platform only the [CC2538DK]( https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx) is required. 25 | 26 | For the TIRTOS Tiva platform you will need in addition to the [CC2538DK]( https://store.ti.com/CC2538DK-CC2538-Development-Kit-P4532.aspx) ; a [TIVA-C Launchpad](https://store.ti.com/Tiva-C-LaunchPad.aspx) and an [EM Booster pack](https://store.ti.com/boost-ccemadapter.aspx ) (modified as indicated in the Users Guide). 27 | 28 | ### Programming the CC2538EM's with ZNP FW 29 | Use the [SmartRF Programmer 2]( http://processors.wiki.ti.com/index.php/Download_CCS) to program the FW contain in the bin dir of the git repository. 30 | 31 | For the Linux Platform use /bin/cc2538-znp-120-usb-tclk.hex FW. For the TIRTOS/TIVA Platform use the cc2538-znp-120-uart-tclk.hex 32 | 33 | Remember to set the P5 header correctly on the CC2538EM: 34 | 35 | * For use with the Linux platform set P5 to VDD -> USB so the CC2538Em is powered from the USB connector. 36 | * For programming and use with the TIRTOS/TIVA Platform set P5 to VDD -> EM, so it is powered from the RM headers. 37 | 38 | Connect the CC2538EM to the Host: 39 | 40 | * For the Linux platform connect the CC2538EM to the Linux machine. 41 | * For the TIRTOS/TIVA platform connect the CC2538EM to the EM Booster Pack and then to the TIRTOS/TIVA Launchpad. 42 | 43 | ### Building and running the examples 44 | 45 | The following describe how the build environment is setup and how one of the examples can be run. For a complete description consult the Users Guide. 46 | 47 | Clone the git 48 | 49 | git clone git://git.ti.com/znp-host-framework/znp-host-framework.git 50 | 51 | #### Linux 52 | 53 | Change dir to the build directory for one of the examples and build it 54 | 55 | cd znp-posix-framework/examples/cmdLine/build/gnu/ 56 | make 57 | 58 | Then run the example: 59 | 60 | ./cmdLine.bin /dev/ttyACM0 61 | 62 | 63 | #### TI RTOS 64 | 65 | Download CCS v6 from here: 66 | [CCS v6]( http://processors.wiki.ti.com/index.php/Download_CCS) 67 | 68 | Download TIRTOS for TIVA-C version 2.00.02.36 from here: 69 | [TIRTOS for TIVA-C version 2.00.02.36 (for Windows)]( http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/2_00_02_36/exports/tirtos_tivac_setupwin32_2_00_02_36.exe) 70 | 71 | Other versions of TIRTOS are available [here]( http://software-dl.ti.com/dsps/dsps_public_sw/sdo_sb/targetcontent/tirtos/index.html) however these are not yet tested so we recommend that you use the version suggested above. 72 | 73 | Open CCSv6, Import the project through Project->Import->Code Composer Studio->CCS Project. Browse to /znp-posix-framework\examples\cmdLine\build\tirtos\ccs 74 | 75 | To build and download the example Right click on the example in the Project Explorer and select Debug As->Code Composer Debug Session 76 | 77 | ## Known Issues and Limitations 78 | 79 | * When built from ZStack-Home-1.2.1 ZNP for CC2538 USB the host framework intermittently receives corrupted RPC messages. For this reason hex files from ZStack-Home-1.2.0 are included. The root cause of this issue is currently being investigated. 80 | 81 | * API documentation is not yet released. 82 | 83 | * stressTest Example with ED's results in high level of lost packets. This is because the Ed device sleeps and polls it parent at a default rate, its parent is responsible for buffering any messages until it polls. In this test the Coordinator will send a test message every 200ms, this can cause the parents buffer to overflow and messages to get lost. A possible resolution would be to configure the EndDevice a Always On for this test, but this has not yet been implemented. 84 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/ZNP host SW framework_1.0.0_manifest.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Core/znp-host-framework/ZNP host SW framework_1.0.0_manifest.html -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/docs/ZNP Host Framework Design Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Core/znp-host-framework/docs/ZNP Host Framework Design Guide.pdf -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/SConscript: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2016, Han Pengfei. All Rights Reserved. 3 | # Distributed under the terms of the MIT License. 4 | # 5 | 6 | Import("genv") 7 | 8 | env = Environment() 9 | env["CC"] = genv["CC"] 10 | env["CXX"] = genv["CXX"] 11 | env["AS"] = genv["AS"] 12 | env["AR"] = genv["AR"] 13 | env["LINK"] = genv["LINK"] 14 | env["OBJCOPY"] = genv["OBJCOPY"] 15 | env["NM"] = genv["NM"] 16 | env["ENV"] = genv["ENV"] 17 | 18 | # env["CCFLAGS"] = ["-DRPC_ENABLE_CRTSCTS"] 19 | 20 | inc = [ 21 | ".", 22 | "./mt", 23 | "./mt/Af", 24 | "./mt/Sapi", 25 | "./mt/Sys/", 26 | "./mt/Zdo", 27 | "./platform/gnu", 28 | "./rpc", 29 | ] 30 | 31 | dst = "znp-framework" 32 | src = env.Glob("mt/*.c") 33 | src += env.Glob("mt/Af/*.c") 34 | src += env.Glob("mt/Sapi/*.c") 35 | src += env.Glob("mt/Sys/*.c") 36 | src += env.Glob("mt/Zdo/*.c") 37 | src += env.Glob("platform/gnu/*.c") 38 | src += env.Glob("rpc/*.c") 39 | 40 | lib = [] 41 | 42 | framework = env.StaticLibrary(target=dst, source=src, LIBS=lib, CPPPATH=inc) 43 | Return("framework") 44 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mtAppCfg.c 3 | * 4 | * Created on: Apr 2, 2021 5 | * Author: Sande 6 | */ 7 | 8 | #include "mtAppCfg.h" 9 | #include "rpc.h" 10 | #include "dbgPrint.h" 11 | #include 12 | #include 13 | 14 | static mtAppCfgCb_t mtAppCfgCbs; 15 | 16 | void appCfgRegisterCallbacks(mtAppCfgCb_t cbs) { 17 | memcpy(&mtAppCfgCbs, &cbs, sizeof(mtAppCfgCb_t)); 18 | } 19 | 20 | static void processCommissioningNotify(uint8_t *rpcBuff, uint8_t rpcLen) { 21 | // valid function pointer? 22 | if (mtAppCfgCbs.pfnAppCfgCommissioningNotifyCb_t) { 23 | uint8_t msgIdx = 2; 24 | appCfgCommissioningNotifyFormat_t rsp; 25 | 26 | // size error? 27 | if (rpcLen < 3) { 28 | printf("MT_RPC_ERR_LENGTH\n"); 29 | } 30 | 31 | // copy command 32 | rsp.status = rpcBuff[msgIdx++]; 33 | rsp.commissioningMode1 = rpcBuff[msgIdx++]; 34 | rsp.commissioningMode2 = rpcBuff[msgIdx++]; 35 | 36 | // callback function 37 | mtAppCfgCbs.pfnAppCfgCommissioningNotifyCb_t(&rsp); 38 | } 39 | } 40 | 41 | static void processSetChannel(uint8_t *rpcBuff, uint8_t rpcLen) { 42 | // valid function pointer? 43 | if (mtAppCfgCbs.pfnAppCfgSetChannelCb_t) { 44 | uint8_t msgIdx = 2; 45 | appCfgSetChannelFormat_t rsp; 46 | 47 | // size error? 48 | if (rpcLen < 1) { 49 | printf("MT_RPC_ERR_LENGTH\n"); 50 | } 51 | 52 | // copy command 53 | rsp.success = rpcBuff[msgIdx++]; 54 | 55 | // callback function 56 | mtAppCfgCbs.pfnAppCfgSetChannelCb_t(&rsp); 57 | } 58 | } 59 | 60 | static void processStartCommissioning(uint8_t *rpcBuff, uint8_t rpcLen) { 61 | // valid function pointer? 62 | if (mtAppCfgCbs.pfnAppCfgCommissioningStartCb_t) { 63 | uint8_t msgIdx = 2; 64 | appCfgStartCommissioningStart_t rsp; 65 | 66 | // size error? 67 | if (rpcLen < 1) { 68 | printf("MT_RPC_ERR_LENGTH\n"); 69 | } 70 | 71 | // copy command 72 | rsp.success = rpcBuff[msgIdx++]; 73 | 74 | // callback function 75 | mtAppCfgCbs.pfnAppCfgCommissioningStartCb_t(&rsp); 76 | } 77 | } 78 | 79 | static void processSrsp(uint8_t *rpcBuff, uint8_t rpcLen) { 80 | //srspRpcLen = rpcLen; 81 | switch (rpcBuff[1]) { 82 | case MT_APP_CFG_SRSP_SET_CHANNEL: 83 | dbg_print(PRINT_LEVEL_VERBOSE, "appCfgProcess: SET_CHANNEL_SRSP\n"); 84 | processSetChannel(rpcBuff, rpcLen); 85 | break; 86 | case MT_APP_CFG_SRSP_START_COMMISSIONING: 87 | dbg_print(PRINT_LEVEL_VERBOSE, "appCfgProcess: START_COMMISSIONING_SRSP\n"); 88 | processStartCommissioning(rpcBuff, rpcLen); 89 | break; 90 | default: 91 | dbg_print(PRINT_LEVEL_INFO, "processSrsp: unsupported message [%x:%x]\n", rpcBuff[0], rpcBuff[1]); 92 | break; 93 | } 94 | } 95 | 96 | void appCfgProcess(uint8_t *rpcBuff, uint8_t rpcLen) { 97 | dbg_print(PRINT_LEVEL_VERBOSE, "appCfgProcess: processing CMD0:%x, CMD1:%x\n", rpcBuff[0], rpcBuff[1]); 98 | 99 | //process the synchronous SRSP from SREQ 100 | if ((rpcBuff[0] & MT_RPC_CMD_TYPE_MASK) == MT_RPC_CMD_SRSP) { 101 | processSrsp(rpcBuff, rpcLen); 102 | } 103 | else { 104 | //Read CMD1 and processes the specific SREQ 105 | switch (rpcBuff[1]) { 106 | case MT_APP_CFG_COMMISSIONING_NOTIFY: 107 | dbg_print(PRINT_LEVEL_VERBOSE, "appCfgProcess: MT_AP_CFG_COMMISSIONING_NOTIFY\n"); 108 | processCommissioningNotify(rpcBuff, rpcLen); 109 | break; 110 | default: 111 | dbg_print(PRINT_LEVEL_WARNING, "processRpcAf: CMD0:%x, CMD1:%x, not handled\n", rpcBuff[0], rpcBuff[1]); 112 | break; 113 | } 114 | } 115 | } 116 | 117 | uint8_t appCfgSetChannel(setChannelFormat_t *req) { 118 | uint8_t status; 119 | uint8_t payload[5]; 120 | 121 | // build command 122 | payload[0] = (req->primaryChannel) ? 1 : 0; 123 | payload[1] = req->channel & 0xFF; 124 | payload[2] = (req->channel >> 8) & 0xFF; 125 | payload[3] = (req->channel >> 16) & 0xFF; 126 | payload[4] = (req->channel >> 24) & 0xFF; 127 | 128 | // send the frame 129 | status = rpcSendFrame((MT_RPC_CMD_SREQ | MT_RPC_SYS_APP_CFG), 0x08, payload, 5); 130 | 131 | // wait for a response 132 | if (status == MT_RPC_SUCCESS) { 133 | rpcWaitMqClientMsg(50); 134 | } 135 | 136 | // return 137 | return status; 138 | } 139 | 140 | uint8_t appCfgStartCommissioning(startCommissioningFormat_t *req) { 141 | uint8_t status; 142 | uint8_t payload[1]; 143 | 144 | // build command 145 | payload[0] = req->commissioningMode; 146 | 147 | // send the frame 148 | status = rpcSendFrame((MT_RPC_CMD_SREQ | MT_RPC_SYS_APP_CFG), 0x05, payload, 1); 149 | 150 | // wait for a response 151 | if (status == MT_RPC_SUCCESS) { 152 | rpcWaitMqClientMsg(50); 153 | } 154 | 155 | // return 156 | return status; 157 | } 158 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mtAppCfg.h 3 | * 4 | * Created on: Apr 2, 2021 5 | * Author: Sande 6 | */ 7 | 8 | #ifndef _MTAPPCFG_H_ 9 | #define _MTAPPCFG_H_ 10 | 11 | #include 12 | 13 | #define CFG_CHANNEL_NONE 0x00000000 14 | #define CFG_CHANNEL_0x00000800 0x00000800 // 11 15 | #define CFG_CHANNEL_0x00001000 0x00001000 // 12 16 | #define CFG_CHANNEL_0x00002000 0x00002000 // 13 17 | #define CFG_CHANNEL_0x00004000 0x00004000 // 14 18 | #define CFG_CHANNEL_0x00008000 0x00008000 // 15 19 | #define CFG_CHANNEL_0x00010000 0x00010000 // 16 20 | #define CFG_CHANNEL_0x00020000 0x00020000 // 17 21 | #define CFG_CHANNEL_0x00040000 0x00040000 // 18 22 | #define CFG_CHANNEL_0x00080000 0x00080000 // 19 23 | #define CFG_CHANNEL_0x00100000 0x00100000 // 20 24 | #define CFG_CHANNEL_0x00200000 0x00200000 // 21 25 | #define CFG_CHANNEL_0x00400000 0x00400000 // 22 26 | #define CFG_CHANNEL_ALL 0x007FF800 // ALL 27 | 28 | #define CFG_COMM_MODE_TOUCHLINK 0x01 29 | #define CFG_COMM_MODE_NWK_STEERING 0x02 30 | #define CFG_COMM_MODE_NWK_FORMATION 0x04 31 | #define CFG_COMM_MODE_FIND_BIND 0x08 32 | 33 | #define MT_APP_CFG_SRSP_SET_CHANNEL 0x08 34 | #define MT_APP_CFG_SRSP_START_COMMISSIONING 0x05 35 | 36 | #define MT_APP_CFG_COMMISSIONING_NOTIFY 0x80 37 | 38 | typedef struct { 39 | uint8_t primaryChannel; 40 | uint32_t channel; 41 | } setChannelFormat_t; 42 | 43 | typedef struct { 44 | uint8_t commissioningMode; 45 | } startCommissioningFormat_t; 46 | 47 | typedef struct { 48 | uint8_t status; 49 | uint8_t commissioningMode1; 50 | uint8_t commissioningMode2; 51 | } appCfgCommissioningNotifyFormat_t; 52 | 53 | typedef struct { 54 | uint8_t success; 55 | } appCfgSetChannelFormat_t; 56 | 57 | typedef struct { 58 | uint8_t success; 59 | } appCfgStartCommissioningStart_t; 60 | 61 | typedef uint8_t (*mtAppCfgCommissioningNotifyCb_t)(appCfgCommissioningNotifyFormat_t *msg); 62 | typedef uint8_t (*mtAppCfgSetChannelCb_t)(appCfgSetChannelFormat_t *msg); 63 | typedef uint8_t (*mtAppCfgCommissioningStartCb_t)(appCfgStartCommissioningStart_t *msg); 64 | 65 | typedef struct { 66 | mtAppCfgCommissioningNotifyCb_t pfnAppCfgCommissioningNotifyCb_t; 67 | mtAppCfgSetChannelCb_t pfnAppCfgSetChannelCb_t; 68 | mtAppCfgCommissioningStartCb_t pfnAppCfgCommissioningStartCb_t; 69 | } mtAppCfgCb_t; 70 | 71 | void appCfgRegisterCallbacks(mtAppCfgCb_t cbs); 72 | void appCfgProcess(uint8_t *rpcBuff, uint8_t rpcLen); 73 | uint8_t appCfgSetChannel(setChannelFormat_t *req); 74 | uint8_t appCfgStartCommissioning(startCommissioningFormat_t *req); 75 | 76 | #endif /* _MTAPPCFG_H_ */ 77 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/Util/mtUtil.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mtUtil.c 3 | * 4 | * Created on: Apr 12, 2021 5 | * Author: Sande 6 | */ 7 | 8 | #include "mtUtil.h" 9 | #include "rpc.h" 10 | #include "dbgPrint.h" 11 | #include 12 | #include 13 | 14 | static mtUtilCb_t mtUtilCbs; 15 | 16 | void utilRegisterCallbacks(mtUtilCb_t cbs) { 17 | memcpy(&mtUtilCbs, &cbs, sizeof(mtUtilCb_t)); 18 | } 19 | 20 | static void processGetDeviceInfo(uint8_t *rpcBuff, uint8_t rpcLen) { 21 | // valid function pointer? 22 | if (mtUtilCbs.pfnUtilGetDeviceInfoCb_t) { 23 | uint8_t msgIdx = 2; 24 | utilGetDeviceInfoFormat_t rsp; 25 | 26 | // size error? 27 | if (rpcLen < 1) { 28 | printf("MT_RPC_ERR_LENGTH\n"); 29 | } 30 | 31 | // copy command data 32 | rsp.success = rpcBuff[msgIdx++]; 33 | rsp.ieee_addr = 0; 34 | for (uint8_t i = 0; i < 8; i++) 35 | rsp.ieee_addr |= ((uint64_t) rpcBuff[msgIdx++]) << (i * 8); 36 | rsp.short_addr = rpcBuff[msgIdx++]; 37 | rsp.short_addr |= (rpcBuff[msgIdx++] << 8); 38 | rsp.device_type = rpcBuff[msgIdx++]; 39 | rsp.device_state = rpcBuff[msgIdx++]; 40 | #warning possible loss of data 41 | rsp.ass_device_cnt = MIN(rpcBuff[msgIdx], ASS_DEVICE_LIST_MAX); 42 | msgIdx++; 43 | if (rsp.ass_device_cnt) { 44 | for (uint8_t i = 0; i < rsp.ass_device_cnt; i++) { 45 | rsp.ass_device_list[i] = rpcBuff[msgIdx++]; 46 | rsp.ass_device_list[i] |= (rpcBuff[msgIdx++] << 8); 47 | } 48 | } 49 | 50 | // callback function 51 | mtUtilCbs.pfnUtilGetDeviceInfoCb_t(&rsp); 52 | } 53 | } 54 | 55 | static void processSrsp(uint8_t *rpcBuff, uint8_t rpcLen) { 56 | //srspRpcLen = rpcLen; 57 | switch (rpcBuff[1]) { 58 | case MT_UTIL_SRSP_GET_DEVICE_INFO: 59 | dbg_print(PRINT_LEVEL_VERBOSE, "utilProcess: SET_CHANNEL_SRSP\n"); 60 | processGetDeviceInfo(rpcBuff, rpcLen); 61 | break; 62 | default: 63 | dbg_print(PRINT_LEVEL_INFO, "processSrsp: unsupported message [%x:%x]\n", rpcBuff[0], rpcBuff[1]); 64 | break; 65 | } 66 | } 67 | 68 | void utilProcess(uint8_t *rpcBuff, uint8_t rpcLen) { 69 | dbg_print(PRINT_LEVEL_VERBOSE, "utilProcess: processing CMD0:%x, CMD1:%x\n", rpcBuff[0], rpcBuff[1]); 70 | 71 | //process the synchronous SRSP from SREQ 72 | if ((rpcBuff[0] & MT_RPC_CMD_TYPE_MASK) == MT_RPC_CMD_SRSP) { 73 | processSrsp(rpcBuff, rpcLen); 74 | } 75 | else { 76 | //Read CMD1 and processes the specific SREQ 77 | switch (rpcBuff[1]) { 78 | default: 79 | dbg_print(PRINT_LEVEL_WARNING, "processRpcAf: CMD0:%x, CMD1:%x, not handled\n", rpcBuff[0], rpcBuff[1]); 80 | break; 81 | } 82 | } 83 | } 84 | 85 | uint8_t utilGetDeviceInfo(void) { 86 | uint8_t status; 87 | 88 | // send the frame 89 | status = rpcSendFrame((MT_RPC_CMD_SREQ | MT_RPC_SYS_UTIL), 0x00, NULL, 0); 90 | 91 | // wait for a response 92 | if (status == MT_RPC_SUCCESS) { 93 | rpcWaitMqClientMsg(50); 94 | } 95 | 96 | // return 97 | return status; 98 | } 99 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/Util/mtUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mtUtil.h 3 | * 4 | * Created on: Apr 12, 2021 5 | * Author: Sande 6 | */ 7 | 8 | #ifndef _MT_UTIL_MTUTIL_H_ 9 | #define _MT_UTIL_MTUTIL_H_ 10 | 11 | #include 12 | 13 | #define MT_UTIL_SRSP_GET_DEVICE_INFO 0x00 14 | 15 | #define ASS_DEVICE_LIST_MAX 32 16 | 17 | typedef struct { 18 | uint8_t success; 19 | uint64_t ieee_addr; 20 | uint16_t short_addr; 21 | uint8_t device_type; 22 | uint8_t device_state; 23 | uint8_t ass_device_cnt; 24 | uint16_t ass_device_list[ASS_DEVICE_LIST_MAX]; 25 | } utilGetDeviceInfoFormat_t; 26 | 27 | typedef uint8_t (*mtUtilGetDeviceInfoCb_t)(utilGetDeviceInfoFormat_t *msg); 28 | 29 | typedef struct { 30 | mtUtilGetDeviceInfoCb_t pfnUtilGetDeviceInfoCb_t; 31 | } mtUtilCb_t; 32 | 33 | void utilRegisterCallbacks(mtUtilCb_t cbs); 34 | void utilProcess(uint8_t *rpcBuff, uint8_t rpcLen); 35 | uint8_t utilGetDeviceInfo(void); 36 | 37 | #endif /* ZNP_HOST_FRAMEWORK_FRAMEWORK_MT_UTIL_MTUTIL_H_ */ 38 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/mtParser.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mtParser.c 3 | * 4 | * This module contains the API for the ZigBee SoC Host Interface. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | /********************************************************************* 40 | * INCLUDES 41 | */ 42 | #include 43 | #include 44 | #include 45 | 46 | #include "mtParser.h" 47 | #include "rpc.h" 48 | 49 | #include "mtSys.h" 50 | #include "mtZdo.h" 51 | #include "mtAf.h" 52 | #include "mtSapi.h" 53 | #include "mtAppCfg.h" 54 | #include "mtUtil.h" 55 | 56 | #include "dbgPrint.h" 57 | 58 | /********************************************************************* 59 | * MACROS 60 | */ 61 | 62 | /********************************************************************* 63 | * GLOBAL VARIABLES 64 | */ 65 | uint8_t srspRpcBuff[RPC_MAX_LEN]; 66 | uint8_t srspRpcLen; 67 | 68 | /********************************************************************* 69 | * LOCAL FUNCTIONS 70 | */ 71 | 72 | /********************************************************************* 73 | * API FUNCTIONS 74 | */ 75 | 76 | /************************************************************************************************* 77 | * @fn mtProcess() 78 | * 79 | * @brief read and process the RPC mt message from the ZB SoC 80 | * 81 | * @param none 82 | * 83 | * @return length of current Rx Buffer 84 | *************************************************************************************************/ 85 | void mtProcess(uint8_t *rpcBuff, uint8_t rpcLen) { 86 | //Read CMD0 87 | switch (rpcBuff[0] & MT_RPC_SUBSYSTEM_MASK) { 88 | case MT_RPC_SYS_ZDO: 89 | //process ZDO RPC's in the ZDO module 90 | zdoProcess(rpcBuff, rpcLen); 91 | break; 92 | 93 | case MT_RPC_SYS_SYS: 94 | //process SYS RPC's in the Sys module 95 | sysProcess(rpcBuff, rpcLen); 96 | break; 97 | 98 | case MT_RPC_SYS_AF: 99 | //process SYS RPC's in the Sys module 100 | afProcess(rpcBuff, rpcLen); 101 | break; 102 | 103 | case MT_RPC_SYS_SAPI: 104 | //process SYS RPC's in the Sys module 105 | sapiProcess(rpcBuff, rpcLen); 106 | break; 107 | 108 | case MT_RPC_SYS_UTIL: 109 | //process SYS RPC's in the Util module 110 | utilProcess(rpcBuff, rpcLen); 111 | break; 112 | 113 | case MT_RPC_SYS_APP_CFG: 114 | //process SYS RPC's in the App Cfg module 115 | appCfgProcess(rpcBuff, rpcLen); 116 | break; 117 | 118 | default: 119 | dbg_print(PRINT_LEVEL_VERBOSE, "mtProcess: CMD0:%x, CMD1:%x, not handled\n", rpcBuff[0], rpcBuff[1]); 120 | 121 | break; 122 | } 123 | 124 | } 125 | 126 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/mt/mtParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mtParser.h 3 | * 4 | * This module contains the API for the ZigBee SoC Host Interface. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | #ifndef ZBMTPARSER_H 39 | #define ZBMTPARSER_H 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | #include 47 | #include "rpc.h" 48 | 49 | ////MT SYS Commands 50 | //#define MT_SYS_RESET_REQ 0x00 51 | 52 | #define BUILD_UINT16(loByte, hiByte) \ 53 | ((uint16_t)(((loByte) & 0x00FF) + (((hiByte) & 0x00FF) << 8))) 54 | 55 | #define BUILD_UINT32(Byte0, Byte1, Byte2, Byte3) \ 56 | ((uint32_t)((uint32_t)((Byte0) & 0x00FF) \ 57 | + ((uint32_t)((Byte1) & 0x00FF) << 8) \ 58 | + ((uint32_t)((Byte2) & 0x00FF) << 16) \ 59 | + ((uint32_t)((Byte3) & 0x00FF) << 24))) 60 | 61 | void zbSendMtFrame(uint8_t cmd0, uint8_t cmd1, uint8_t * payload, uint8_t payload_len); 62 | void mtProcess(uint8_t *rpcBuff, uint8_t rpcLen); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* ZBMTPARSER_H */ 69 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/platform/stm32/dbgPrint.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dbgPrint.c 3 | * 4 | * This module contains the API for debug print. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | /********************************************************************* 40 | * INCLUDES 41 | */ 42 | #include 43 | #include 44 | 45 | #include "dbgPrint.h" 46 | 47 | /********************************************************************* 48 | * MACROS 49 | */ 50 | 51 | /********************************************************************* 52 | * LOCAL VARIABLE 53 | */ 54 | 55 | /********************************************************************* 56 | * LOCAL FUNCTIONS 57 | */ 58 | 59 | /********************************************************************* 60 | * API FUNCTIONS 61 | */ 62 | 63 | /************************************************************************************************** 64 | * @fn dbgPrint 65 | * 66 | * @brief This function checks the print level and prints if required. 67 | * 68 | * input parameters 69 | * 70 | * @param simpleDesc - A pointer to the simpleDesc descriptor to register. 71 | * 72 | * output parameters 73 | * 74 | * None. 75 | * 76 | * @return None. 77 | ************************************************************************************************** 78 | */ 79 | /*void dbg_print(int print_level, const char *fmt, ...) { 80 | static char working_buffer[256]; 81 | 82 | if (print_level >= PRINT_LEVEL) { 83 | return; 84 | } 85 | else { 86 | // Create vaarg list 87 | va_list args; 88 | va_start(args, fmt); 89 | 90 | // Write string to buffer 91 | vsnprintf(working_buffer, 256, fmt, args); 92 | 93 | // Close vaarg list 94 | va_end(args); 95 | 96 | // send data 97 | log_print("%s", working_buffer); 98 | } 99 | }*/ 100 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/platform/stm32/dbgPrint.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dbgPrint.h 3 | * 4 | * This module contains the API for debug print. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | #ifndef DBGPRINT_H 39 | #define DBGPRINT_H 40 | 41 | #ifdef __cplusplus 42 | extern "C" 43 | { 44 | #endif 45 | 46 | #include "log.h" 47 | 48 | enum 49 | { 50 | PRINT_LEVEL_ERROR, 51 | PRINT_LEVEL_WARNING, 52 | PRINT_LEVEL_INFO, 53 | PRINT_LEVEL_INFO_LOWLEVEL, 54 | PRINT_LEVEL_VERBOSE 55 | }; 56 | 57 | #define PRINT_LEVEL PRINT_LEVEL_INFO_LOWLEVEL 58 | 59 | #define dbg_print(lvl, fmt, ...) do { if (lvl < PRINT_LEVEL) { log_print(fmt, ##__VA_ARGS__); } } while(0) 60 | 61 | //void dbg_print(int printf_level, const char *fmt, ...); 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* DBGPRINT_H */ 68 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/platform/stm32/rpcTransport.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rpcTransport.h 3 | * 4 | * This module contains the API for the zll SoC Host Interface. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef RPCTRANSPORT_H 40 | #define RPCTRANSPORT_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" 44 | { 45 | #endif 46 | 47 | #include 48 | 49 | /********************************************************************/ 50 | // ZigBee Soc API 51 | int32_t rpcTransportOpen(void); 52 | void rpcTransportClose(void); 53 | void rpcTransportISR(void); 54 | void rpcTransportWrite(uint8_t* buf, uint8_t len); 55 | uint8_t rpcTransportRead(uint8_t* buf, uint8_t len); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* RPCTRANSPORT_H */ 62 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/rpc/rpc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * rpc.h 3 | * 4 | * This module contains the RPC (Remote Procedure Call) API for the 5 | * ZigBee Network Processor (ZNP) Host Interface. 6 | * 7 | * Copyright (C) 2014 Texas Instruments Incorporated - http://www.ti.com/ 8 | * 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * 17 | * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the 20 | * distribution. 21 | * 22 | * Neither the name of Texas Instruments Incorporated nor the names of 23 | * its contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 29 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 30 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 31 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 32 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 36 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | */ 39 | 40 | #ifndef RPC_H 41 | #define RPC_H 42 | 43 | #ifdef __cplusplus 44 | extern "C" 45 | { 46 | #endif 47 | 48 | /*********************************************************************************** 49 | * INCLUDES 50 | */ 51 | #include 52 | 53 | /********************************************************************* 54 | * MACROS 55 | */ 56 | 57 | #define MIN(a, b) (((a) < (b)) ? (a) : (b)) 58 | 59 | /********************************************************************* 60 | * CONSTANTS 61 | */ 62 | 63 | // 64 | // RPC (Remote Procedure Call) definitions 65 | // 66 | // SOF (Start of Frame) indicator byte byte 67 | #define MT_RPC_SOF (0xFE) 68 | 69 | // The 3 MSB's of the 1st command field byte (Cmd0) are for command type 70 | #define MT_RPC_CMD_TYPE_MASK (0xE0) 71 | 72 | // The 5 LSB's of the 1st command field byte (Cmd0) are for the subsystem 73 | #define MT_RPC_SUBSYSTEM_MASK (0x1F) 74 | 75 | // maximum length of RPC frame 76 | // (1 byte length + 2 bytes command + 0-250 bytes data) 77 | #define RPC_MAX_LEN (256) 78 | 79 | // RPC Frame field lengths 80 | #define RPC_UART_SOF_LEN (1) 81 | #define RPC_UART_FCS_LEN (1) 82 | 83 | #define RPC_UART_FRAME_START_IDX (1) 84 | 85 | #define RPC_LEN_FIELD_LEN (1) 86 | #define RPC_CMD0_FIELD_LEN (1) 87 | #define RPC_CMD1_FIELD_LEN (1) 88 | 89 | #define RPC_HDR_LEN (RPC_LEN_FIELD_LEN + RPC_CMD0_FIELD_LEN + \ 90 | RPC_CMD1_FIELD_LEN) 91 | 92 | #define RPC_UART_HDR_LEN (RPC_UART_SOF_LEN + RPC_HDR_LEN) 93 | 94 | /*********************************************************************************** 95 | * TYPEDEFS 96 | */ 97 | 98 | // Cmd0 Command Type 99 | typedef enum 100 | { 101 | MT_RPC_CMD_POLL = 0x00, // POLL command 102 | MT_RPC_CMD_SREQ = 0x20, // SREQ (Synchronous Request) command 103 | MT_RPC_CMD_AREQ = 0x40, // AREQ (Acynchronous Request) command 104 | MT_RPC_CMD_SRSP = 0x60, // SRSP (Synchronous Response) 105 | MT_RPC_CMD_RES4 = 0x80, // Reserved 106 | MT_RPC_CMD_RES5 = 0xA0, // Reserved 107 | MT_RPC_CMD_RES6 = 0xC0, // Reserved 108 | MT_RPC_CMD_RES7 = 0xE0 // Reserved 109 | } mtRpcCmdType_t; 110 | 111 | // Cmd0 Command Subsystem 112 | typedef enum 113 | { 114 | MT_RPC_SYS_RES0, // Reserved. 115 | MT_RPC_SYS_SYS, // SYS interface 116 | MT_RPC_SYS_MAC, 117 | MT_RPC_SYS_NWK, 118 | MT_RPC_SYS_AF, // AF interface 119 | MT_RPC_SYS_ZDO, // ZDO interface 120 | MT_RPC_SYS_SAPI, // Simple API interface 121 | MT_RPC_SYS_UTIL, // UTIL interface 122 | MT_RPC_SYS_DBG, 123 | MT_RPC_SYS_APP, 124 | MT_RPC_SYS_OTA, 125 | MT_RPC_SYS_ZNP, 126 | MT_RPC_SYS_SPARE_12, 127 | MT_RPC_SYS_SBL = 13, // 13 to be compatible with existing RemoTI - AKA MT_RPC_SYS_UBL 128 | MT_RPC_SYS_MAX, // Maximum value, must be last (so 14-32 available, not yet assigned). 129 | MT_RPC_SYS_APP_CFG = 15 130 | } mtRpcSysType_t; 131 | 132 | // Error codes in Attribute byte of SRSP packet 133 | typedef enum 134 | { 135 | MT_RPC_SUCCESS = 0, // success 136 | MT_RPC_ERR_SUBSYSTEM = 1, // invalid subsystem 137 | MT_RPC_ERR_COMMAND_ID = 2, // invalid command ID 138 | MT_RPC_ERR_PARAMETER = 3, // invalid parameter 139 | MT_RPC_ERR_LENGTH = 4 // invalid length 140 | } mtRpcErrorCode_t; 141 | 142 | /*********************************************************************************** 143 | * GLOBAL VARIABLES 144 | */ 145 | 146 | /*********************************************************************************** 147 | * GLOBAL FUNCTIONS 148 | */ 149 | 150 | int32_t rpcOpen(void); 151 | void rpcClose(void); 152 | int32_t rpcProcess(void); 153 | uint8_t rpcSendFrame(uint8_t cmd0, uint8_t cmd1, uint8_t * payload, 154 | uint8_t payload_len); 155 | void rpcForceRun(void); 156 | int32_t rpcInitMq(void); 157 | int32_t rpcGetMqClientMsg(void); 158 | int32_t rpcWaitMqClientMsg(uint32_t timeout); 159 | 160 | #ifdef __cplusplus 161 | } 162 | #endif 163 | 164 | #endif /* RPC_H */ 165 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/rpc/rpc_queue.c: -------------------------------------------------------------------------------- 1 | /* 2 | * mqueue.c 3 | * 4 | * This module contains the POSIX wrapper for Semaphore. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include "rpc_queue.h" 46 | #include "rpc.h" 47 | 48 | #include "FreeRTOS.h" 49 | #include "queue.h" 50 | 51 | #define Q_SIZE 8 52 | #define Q_FRAME_SIZE RPC_MAX_LEN 53 | 54 | typedef struct { 55 | uint8_t data[Q_FRAME_SIZE]; 56 | uint16_t len; 57 | } queue_data_t; 58 | 59 | /********************************************************************* 60 | * @fn llq_open 61 | * 62 | * @brief Create a queue handle 63 | * 64 | * @param llq_t *hndl - handle to queue to be created 65 | * 66 | * @return none 67 | */ 68 | void llq_open(llq_t *hndl) { 69 | hndl->queue = xQueueCreate(Q_SIZE, sizeof(queue_data_t)); 70 | } 71 | 72 | void llq_close(llq_t *hndl) { 73 | vQueueDelete(hndl->queue); 74 | } 75 | 76 | /********************************************************************* 77 | * @fn llq_timedreceive 78 | * 79 | * @brief Block until a message is recieved or timeout 80 | * 81 | * @param llq_t *hndl - handle to queue to read the message from 82 | * @Param char *buffer - Pointer to buffer to read the message in to 83 | * @Param int maxLength - Max length of message to read 84 | * @Param struct timespec * timeout - Timeout value 85 | * 86 | * @return length of message read from queue 87 | */ 88 | int llq_timedreceive(llq_t *hndl, char *buffer, int maxLength, int timeout) { 89 | int sepmRnt = 0; 90 | queue_data_t q_buf = { 0 }; 91 | 92 | // wait for a message or timeout 93 | if (xQueueReceive(hndl->queue, &q_buf, timeout) != pdTRUE) { 94 | return -1; 95 | } 96 | 97 | // we read with success? 98 | int rLength = MIN(q_buf.len, maxLength); 99 | memcpy(buffer, q_buf.data, rLength); 100 | 101 | // return 102 | return rLength; 103 | } 104 | 105 | /********************************************************************* 106 | * @fn llq_timedreceive 107 | * 108 | * @brief Block until a message is recieved 109 | * 110 | * @param llq_t *hndl - handle to queue to read the message from 111 | * @Param char *buffer - Pointer to buffer to read the message in to 112 | * @Param int maxLength - Max length of message to read 113 | * 114 | * @return length of message read from queue 115 | */ 116 | int llq_receive(llq_t *hndl, char *buffer, int maxLength) { 117 | return llq_timedreceive(hndl, buffer, maxLength, portMAX_DELAY); 118 | } 119 | 120 | /********************************************************************* 121 | * @fn llq_add 122 | * 123 | * @brief write message to queue 124 | * 125 | * @param llq_t *hndl - handle to queue to read the message from 126 | * @Param char *buffer - Pointer to buffer containing the message 127 | * @Param int len - Length of message 128 | * @Param int prio - 1 message has priority and should be added to 129 | * head of queue, 0 message assed to tail of queue 130 | * 131 | * @return length of message read from queue 132 | */ 133 | int llq_add(llq_t *hndl, char *buffer, int len, int prio) { 134 | int ret = 0; 135 | queue_data_t q_buf = { 0 }; 136 | 137 | // length 138 | q_buf.len = MIN(Q_FRAME_SIZE, len); 139 | // data 140 | memcpy(q_buf.data, buffer, q_buf.len); 141 | 142 | if (prio == 1) { 143 | xQueueSendToFront(hndl->queue, &q_buf, 10); 144 | } 145 | else { 146 | xQueueSendToBack(hndl->queue, &q_buf, 10); 147 | } 148 | 149 | return ret; 150 | } 151 | 152 | -------------------------------------------------------------------------------- /zigbee_test/Core/znp-host-framework/framework/rpc/rpc_queue.h: -------------------------------------------------------------------------------- 1 | /* 2 | * mqueue.h 3 | * 4 | * This module contains the POSIX wrapper for Semaphore. 5 | * 6 | * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/ 7 | * 8 | * 9 | * Redistribution and use in source and binary forms, with or without 10 | * modification, are permitted provided that the following conditions 11 | * are met: 12 | * 13 | * Redistributions of source code must retain the above copyright 14 | * notice, this list of conditions and the following disclaimer. 15 | * 16 | * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the 19 | * distribution. 20 | * 21 | * Neither the name of Texas Instruments Incorporated nor the names of 22 | * its contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 26 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 27 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 28 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 29 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 30 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 31 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 32 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 33 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 34 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 35 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | */ 38 | 39 | #ifndef RPC_QUEUE_H 40 | #define RPC_QUEUE_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" 44 | { 45 | #endif 46 | 47 | #include 48 | #include 49 | #include 50 | 51 | #include "FreeRTOS.h" 52 | #include "queue.h" 53 | 54 | typedef struct 55 | { 56 | QueueHandle_t queue; 57 | } llq_t; 58 | 59 | /********************************************************************* 60 | * @fn llq_open 61 | * 62 | * @brief Create a queue handle 63 | * 64 | * @param llq_t *hndl - handle to queue to be created 65 | * 66 | * @return none 67 | */ 68 | extern void llq_open(llq_t *hndl); 69 | 70 | /********************************************************************* 71 | * @fn llq_timedreceive 72 | * 73 | * @brief Block until a message is recieved or timeout 74 | * 75 | * @param llq_t *hndl - handle to queue to read the message from 76 | * @Param char *buffer - Pointer to buffer to read the message in to 77 | * @Param int maxLength - Max length of message to read 78 | * @Param struct timespec * timeout - Timeout value 79 | * 80 | * @return length of message read from queue 81 | */ 82 | extern void llq_close(llq_t *hndl); 83 | 84 | /********************************************************************* 85 | * @fn llq_add 86 | * 87 | * @brief write message to queue 88 | * 89 | * @param llq_t *hndl - handle to queue to read the message from 90 | * @Param char *buffer - Pointer to buffer containing the message 91 | * @Param int len - Length of message 92 | * @Param int prio - 1 message has priority and should be added to 93 | * head of queue, 0 message assed to tail of queue 94 | * 95 | * @return length of message read from queue 96 | */ 97 | extern int llq_add(llq_t *hndl, char *buffer, int len, int prio); 98 | 99 | /********************************************************************* 100 | * @fn llq_timedreceive 101 | * 102 | * @brief Block until a message is recieved 103 | * 104 | * @param llq_t *hndl - handle to queue to read the message from 105 | * @Param char *buffer - Pointer to buffer to read the message in to 106 | * @Param int maxLength - Max length of message to read 107 | * 108 | * @return length of message read from queue 109 | */ 110 | extern int llq_receive(llq_t *hndl, char *buffer, int maxLength); 111 | 112 | /********************************************************************* 113 | * @fn llq_timedreceive 114 | * 115 | * @brief Block until a message is recieved or timeout 116 | * 117 | * @param llq_t *hndl - handle to queue to read the message from 118 | * @Param char *buffer - Pointer to buffer to read the message in to 119 | * @Param int maxLength - Max length of message to read 120 | * @Param struct timespec * timeout - Timeout value 121 | * 122 | * @return length of message read from queue 123 | */ 124 | extern int llq_timedreceive(llq_t *hndl, char *buffer, int maxLength, int timeout); 125 | 126 | #ifdef __cplusplus 127 | } 128 | #endif 129 | 130 | #endif /* SEMAPHORE_H */ 131 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Application/Startup/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | S_SRCS += \ 8 | ../Application/Startup/startup_stm32l496agix.s 9 | 10 | OBJS += \ 11 | ./Application/Startup/startup_stm32l496agix.o 12 | 13 | S_DEPS += \ 14 | ./Application/Startup/startup_stm32l496agix.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Application/Startup/%.o: ../Application/Startup/%.s Application/Startup/subdir.mk 19 | arm-none-eabi-gcc -mcpu=cortex-m4 -g3 -DDEBUG -c -x assembler-with-cpp -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" "$<" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Application/User/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/Src/freertos.c \ 9 | ../Core/Src/main.c \ 10 | ../Core/Src/stm32l4xx_hal_msp.c \ 11 | ../Core/Src/stm32l4xx_hal_timebase_tim.c \ 12 | ../Core/Src/stm32l4xx_it.c \ 13 | ../Application/User/syscalls.c \ 14 | ../Application/User/sysmem.c 15 | 16 | OBJS += \ 17 | ./Application/User/freertos.o \ 18 | ./Application/User/main.o \ 19 | ./Application/User/stm32l4xx_hal_msp.o \ 20 | ./Application/User/stm32l4xx_hal_timebase_tim.o \ 21 | ./Application/User/stm32l4xx_it.o \ 22 | ./Application/User/syscalls.o \ 23 | ./Application/User/sysmem.o 24 | 25 | C_DEPS += \ 26 | ./Application/User/freertos.d \ 27 | ./Application/User/main.d \ 28 | ./Application/User/stm32l4xx_hal_msp.d \ 29 | ./Application/User/stm32l4xx_hal_timebase_tim.d \ 30 | ./Application/User/stm32l4xx_it.d \ 31 | ./Application/User/syscalls.d \ 32 | ./Application/User/sysmem.d 33 | 34 | 35 | # Each subdirectory must supply rules for building sources it contributes 36 | Application/User/freertos.o: C:/GitHub/znp-host-stm32/zigbee_test/Core/Src/freertos.c Application/User/subdir.mk 37 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 38 | Application/User/main.o: C:/GitHub/znp-host-stm32/zigbee_test/Core/Src/main.c Application/User/subdir.mk 39 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 40 | Application/User/stm32l4xx_hal_msp.o: C:/GitHub/znp-host-stm32/zigbee_test/Core/Src/stm32l4xx_hal_msp.c Application/User/subdir.mk 41 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 42 | Application/User/stm32l4xx_hal_timebase_tim.o: C:/GitHub/znp-host-stm32/zigbee_test/Core/Src/stm32l4xx_hal_timebase_tim.c Application/User/subdir.mk 43 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 44 | Application/User/stm32l4xx_it.o: C:/GitHub/znp-host-stm32/zigbee_test/Core/Src/stm32l4xx_it.c Application/User/subdir.mk 45 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 46 | Application/User/%.o: ../Application/User/%.c Application/User/subdir.mk 47 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../../Core/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc -I../../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../../Middlewares/Third_Party/FreeRTOS/Source/include -I../../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../../Drivers/CMSIS/Include -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 48 | 49 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/Src/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/Src/freertos.c \ 9 | ../Core/Src/gpio.c \ 10 | ../Core/Src/log.c \ 11 | ../Core/Src/main.c \ 12 | ../Core/Src/stm32l4xx_hal_msp.c \ 13 | ../Core/Src/stm32l4xx_hal_timebase_tim.c \ 14 | ../Core/Src/stm32l4xx_it.c \ 15 | ../Core/Src/syscalls.c \ 16 | ../Core/Src/sysmem.c \ 17 | ../Core/Src/system_stm32l4xx.c \ 18 | ../Core/Src/usart.c 19 | 20 | OBJS += \ 21 | ./Core/Src/freertos.o \ 22 | ./Core/Src/gpio.o \ 23 | ./Core/Src/log.o \ 24 | ./Core/Src/main.o \ 25 | ./Core/Src/stm32l4xx_hal_msp.o \ 26 | ./Core/Src/stm32l4xx_hal_timebase_tim.o \ 27 | ./Core/Src/stm32l4xx_it.o \ 28 | ./Core/Src/syscalls.o \ 29 | ./Core/Src/sysmem.o \ 30 | ./Core/Src/system_stm32l4xx.o \ 31 | ./Core/Src/usart.o 32 | 33 | C_DEPS += \ 34 | ./Core/Src/freertos.d \ 35 | ./Core/Src/gpio.d \ 36 | ./Core/Src/log.d \ 37 | ./Core/Src/main.d \ 38 | ./Core/Src/stm32l4xx_hal_msp.d \ 39 | ./Core/Src/stm32l4xx_hal_timebase_tim.d \ 40 | ./Core/Src/stm32l4xx_it.d \ 41 | ./Core/Src/syscalls.d \ 42 | ./Core/Src/sysmem.d \ 43 | ./Core/Src/system_stm32l4xx.d \ 44 | ./Core/Src/usart.d 45 | 46 | 47 | # Each subdirectory must supply rules for building sources it contributes 48 | Core/Src/%.o: ../Core/Src/%.c Core/Src/subdir.mk 49 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 50 | 51 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/Startup/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | S_SRCS += \ 8 | ../Core/startup/startup_stm32l496xx.s 9 | 10 | OBJS += \ 11 | ./Core/startup/startup_stm32l496xx.o 12 | 13 | S_DEPS += \ 14 | ./Core/startup/startup_stm32l496xx.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/startup/%.o: ../Core/startup/%.s Core/startup/subdir.mk 19 | arm-none-eabi-gcc -mcpu=cortex-m4 -g3 -DDEBUG -c -I../Core/startup -x assembler-with-cpp -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" "$<" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-app/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-app/znp_cb.c \ 9 | ../Core/znp-app/znp_cmd.c \ 10 | ../Core/znp-app/znp_if.c 11 | 12 | OBJS += \ 13 | ./Core/znp-app/znp_cb.o \ 14 | ./Core/znp-app/znp_cmd.o \ 15 | ./Core/znp-app/znp_if.o 16 | 17 | C_DEPS += \ 18 | ./Core/znp-app/znp_cb.d \ 19 | ./Core/znp-app/znp_cmd.d \ 20 | ./Core/znp-app/znp_if.d 21 | 22 | 23 | # Each subdirectory must supply rules for building sources it contributes 24 | Core/znp-app/%.o: ../Core/znp-app/%.c Core/znp-app/subdir.mk 25 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 26 | 27 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/Af/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/Af/mtAf.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/Af/mtAf.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/Af/mtAf.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/Af/%.o: ../Core/znp-host-framework/framework/mt/Af/%.c Core/znp-host-framework/framework/mt/Af/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/AppCfg/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/AppCfg/%.o: ../Core/znp-host-framework/framework/mt/AppCfg/%.c Core/znp-host-framework/framework/mt/AppCfg/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/Sapi/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/Sapi/mtSapi.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/Sapi/mtSapi.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/Sapi/mtSapi.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/Sapi/%.o: ../Core/znp-host-framework/framework/mt/Sapi/%.c Core/znp-host-framework/framework/mt/Sapi/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/Sys/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/Sys/mtSys.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/Sys/mtSys.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/Sys/mtSys.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/Sys/%.o: ../Core/znp-host-framework/framework/mt/Sys/%.c Core/znp-host-framework/framework/mt/Sys/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/Util/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/Util/mtUtil.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/Util/mtUtil.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/Util/mtUtil.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/Util/%.o: ../Core/znp-host-framework/framework/mt/Util/%.c Core/znp-host-framework/framework/mt/Util/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/Zdo/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/Zdo/mtZdo.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/Zdo/mtZdo.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/Zdo/mtZdo.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/Zdo/%.o: ../Core/znp-host-framework/framework/mt/Zdo/%.c Core/znp-host-framework/framework/mt/Zdo/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/mt/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/mt/mtParser.c 9 | 10 | OBJS += \ 11 | ./Core/znp-host-framework/framework/mt/mtParser.o 12 | 13 | C_DEPS += \ 14 | ./Core/znp-host-framework/framework/mt/mtParser.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Core/znp-host-framework/framework/mt/%.o: ../Core/znp-host-framework/framework/mt/%.c Core/znp-host-framework/framework/mt/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/platform/stm32/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/platform/stm32/dbgPrint.c \ 9 | ../Core/znp-host-framework/framework/platform/stm32/rpcTransportUart.c 10 | 11 | OBJS += \ 12 | ./Core/znp-host-framework/framework/platform/stm32/dbgPrint.o \ 13 | ./Core/znp-host-framework/framework/platform/stm32/rpcTransportUart.o 14 | 15 | C_DEPS += \ 16 | ./Core/znp-host-framework/framework/platform/stm32/dbgPrint.d \ 17 | ./Core/znp-host-framework/framework/platform/stm32/rpcTransportUart.d 18 | 19 | 20 | # Each subdirectory must supply rules for building sources it contributes 21 | Core/znp-host-framework/framework/platform/stm32/%.o: ../Core/znp-host-framework/framework/platform/stm32/%.c Core/znp-host-framework/framework/platform/stm32/subdir.mk 22 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 23 | 24 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Core/znp-host-framework/framework/rpc/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Core/znp-host-framework/framework/rpc/rpc.c \ 9 | ../Core/znp-host-framework/framework/rpc/rpc_queue.c 10 | 11 | OBJS += \ 12 | ./Core/znp-host-framework/framework/rpc/rpc.o \ 13 | ./Core/znp-host-framework/framework/rpc/rpc_queue.o 14 | 15 | C_DEPS += \ 16 | ./Core/znp-host-framework/framework/rpc/rpc.d \ 17 | ./Core/znp-host-framework/framework/rpc/rpc_queue.d 18 | 19 | 20 | # Each subdirectory must supply rules for building sources it contributes 21 | Core/znp-host-framework/framework/rpc/%.o: ../Core/znp-host-framework/framework/rpc/%.c Core/znp-host-framework/framework/rpc/subdir.mk 22 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 23 | 24 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Drivers/CMSIS/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | 8 | # Each subdirectory must supply rules for building sources it contributes 9 | 10 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Drivers/STM32L4xx_HAL_Driver/Src/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.c \ 9 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.c \ 10 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.c \ 11 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.c \ 12 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.c \ 13 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.c \ 14 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.c \ 15 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.c \ 16 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.c \ 17 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.c \ 18 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.c \ 19 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.c \ 20 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.c \ 21 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.c \ 22 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.c \ 23 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.c \ 24 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.c \ 25 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.c \ 26 | ../Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.c 27 | 28 | OBJS += \ 29 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o \ 30 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o \ 31 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.o \ 32 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.o \ 33 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.o \ 34 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.o \ 35 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.o \ 36 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.o \ 37 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.o \ 38 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.o \ 39 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.o \ 40 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.o \ 41 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.o \ 42 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.o \ 43 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.o \ 44 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.o \ 45 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.o \ 46 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.o \ 47 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.o 48 | 49 | C_DEPS += \ 50 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.d \ 51 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.d \ 52 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.d \ 53 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.d \ 54 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.d \ 55 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.d \ 56 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.d \ 57 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.d \ 58 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.d \ 59 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.d \ 60 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.d \ 61 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.d \ 62 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.d \ 63 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.d \ 64 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.d \ 65 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.d \ 66 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.d \ 67 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.d \ 68 | ./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.d 69 | 70 | 71 | # Each subdirectory must supply rules for building sources it contributes 72 | Drivers/STM32L4xx_HAL_Driver/Src/%.o: ../Drivers/STM32L4xx_HAL_Driver/Src/%.c Drivers/STM32L4xx_HAL_Driver/Src/subdir.mk 73 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 74 | 75 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c 9 | 10 | OBJS += \ 11 | ./Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.o 12 | 13 | C_DEPS += \ 14 | ./Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/%.o: ../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/%.c Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c 9 | 10 | OBJS += \ 11 | ./Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.o 12 | 13 | C_DEPS += \ 14 | ./Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/%.o: ../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/%.c Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.c 9 | 10 | OBJS += \ 11 | ./Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.o 12 | 13 | C_DEPS += \ 14 | ./Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.d 15 | 16 | 17 | # Each subdirectory must supply rules for building sources it contributes 18 | Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/%.o: ../Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/%.c Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/subdir.mk 19 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 20 | 21 | -------------------------------------------------------------------------------- /zigbee_test/Debug/Middlewares/Third_Party/FreeRTOS/Source/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | C_SRCS += \ 8 | ../Middlewares/Third_Party/FreeRTOS/Source/croutine.c \ 9 | ../Middlewares/Third_Party/FreeRTOS/Source/event_groups.c \ 10 | ../Middlewares/Third_Party/FreeRTOS/Source/list.c \ 11 | ../Middlewares/Third_Party/FreeRTOS/Source/queue.c \ 12 | ../Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.c \ 13 | ../Middlewares/Third_Party/FreeRTOS/Source/tasks.c \ 14 | ../Middlewares/Third_Party/FreeRTOS/Source/timers.c 15 | 16 | OBJS += \ 17 | ./Middlewares/Third_Party/FreeRTOS/Source/croutine.o \ 18 | ./Middlewares/Third_Party/FreeRTOS/Source/event_groups.o \ 19 | ./Middlewares/Third_Party/FreeRTOS/Source/list.o \ 20 | ./Middlewares/Third_Party/FreeRTOS/Source/queue.o \ 21 | ./Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.o \ 22 | ./Middlewares/Third_Party/FreeRTOS/Source/tasks.o \ 23 | ./Middlewares/Third_Party/FreeRTOS/Source/timers.o 24 | 25 | C_DEPS += \ 26 | ./Middlewares/Third_Party/FreeRTOS/Source/croutine.d \ 27 | ./Middlewares/Third_Party/FreeRTOS/Source/event_groups.d \ 28 | ./Middlewares/Third_Party/FreeRTOS/Source/list.d \ 29 | ./Middlewares/Third_Party/FreeRTOS/Source/queue.d \ 30 | ./Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.d \ 31 | ./Middlewares/Third_Party/FreeRTOS/Source/tasks.d \ 32 | ./Middlewares/Third_Party/FreeRTOS/Source/timers.d 33 | 34 | 35 | # Each subdirectory must supply rules for building sources it contributes 36 | Middlewares/Third_Party/FreeRTOS/Source/%.o: ../Middlewares/Third_Party/FreeRTOS/Source/%.c Middlewares/Third_Party/FreeRTOS/Source/subdir.mk 37 | arm-none-eabi-gcc "$<" -mcpu=cortex-m4 -std=gnu11 -g3 -DDEBUG -DUSE_HAL_DRIVER -DSTM32L496xx -c -I../Middlewares/Third_Party/FreeRTOS/Source/include -I../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F -I../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS -I../Drivers/CMSIS/Device/ST/STM32L4xx/Include -I../Drivers/CMSIS/Include -I../Drivers/STM32L4xx_HAL_Driver/Inc/Legacy -I../Drivers/STM32L4xx_HAL_Driver/Inc -I../Core/Inc -I../Core/znp-app -I../Core/znp-host-framework/framework/rpc -I../Core/znp-host-framework/framework/platform/stm32 -I../Core/znp-host-framework/framework/mt/Af -I../Core/znp-host-framework/framework/mt/AppCfg -I../Core/znp-host-framework/framework/mt/Sapi -I../Core/znp-host-framework/framework/mt/Sys -I../Core/znp-host-framework/framework/mt/Util -I../Core/znp-host-framework/framework/mt/Zdo -I../Core/znp-host-framework/framework/mt -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"$(@:%.o=%.d)" -MT"$@" --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -o "$@" 38 | 39 | -------------------------------------------------------------------------------- /zigbee_test/Debug/makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | -include ../makefile.init 7 | 8 | RM := rm -rf 9 | 10 | # All of the sources participating in the build are defined here 11 | -include sources.mk 12 | -include Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/subdir.mk 13 | -include Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/subdir.mk 14 | -include Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/subdir.mk 15 | -include Middlewares/Third_Party/FreeRTOS/Source/subdir.mk 16 | -include Drivers/STM32L4xx_HAL_Driver/Src/subdir.mk 17 | -include Core/znp-host-framework/framework/rpc/subdir.mk 18 | -include Core/znp-host-framework/framework/platform/stm32/subdir.mk 19 | -include Core/znp-host-framework/framework/mt/Zdo/subdir.mk 20 | -include Core/znp-host-framework/framework/mt/Util/subdir.mk 21 | -include Core/znp-host-framework/framework/mt/Sys/subdir.mk 22 | -include Core/znp-host-framework/framework/mt/Sapi/subdir.mk 23 | -include Core/znp-host-framework/framework/mt/AppCfg/subdir.mk 24 | -include Core/znp-host-framework/framework/mt/Af/subdir.mk 25 | -include Core/znp-host-framework/framework/mt/subdir.mk 26 | -include Core/znp-app/subdir.mk 27 | -include Core/startup/subdir.mk 28 | -include Core/Src/subdir.mk 29 | -include subdir.mk 30 | -include objects.mk 31 | 32 | ifneq ($(MAKECMDGOALS),clean) 33 | ifneq ($(strip $(S_DEPS)),) 34 | -include $(S_DEPS) 35 | endif 36 | ifneq ($(strip $(S_UPPER_DEPS)),) 37 | -include $(S_UPPER_DEPS) 38 | endif 39 | ifneq ($(strip $(C_DEPS)),) 40 | -include $(C_DEPS) 41 | endif 42 | endif 43 | 44 | -include ../makefile.defs 45 | 46 | OPTIONAL_TOOL_DEPS := \ 47 | $(wildcard ../makefile.defs) \ 48 | $(wildcard ../makefile.init) \ 49 | $(wildcard ../makefile.targets) \ 50 | 51 | 52 | BUILD_ARTIFACT_NAME := zigbee_test 53 | BUILD_ARTIFACT_EXTENSION := elf 54 | BUILD_ARTIFACT_PREFIX := 55 | BUILD_ARTIFACT := $(BUILD_ARTIFACT_PREFIX)$(BUILD_ARTIFACT_NAME)$(if $(BUILD_ARTIFACT_EXTENSION),.$(BUILD_ARTIFACT_EXTENSION),) 56 | 57 | # Add inputs and outputs from these tool invocations to the build variables 58 | EXECUTABLES += \ 59 | zigbee_test.elf \ 60 | 61 | SIZE_OUTPUT += \ 62 | default.size.stdout \ 63 | 64 | OBJDUMP_LIST += \ 65 | zigbee_test.list \ 66 | 67 | OBJCOPY_BIN += \ 68 | zigbee_test.bin \ 69 | 70 | 71 | # All Target 72 | all: main-build 73 | 74 | # Main-build Target 75 | main-build: zigbee_test.elf secondary-outputs 76 | 77 | # Tool invocations 78 | zigbee_test.elf: $(OBJS) $(USER_OBJS) C:\GitHub\znp-host-stm32\zigbee_test\STM32L496AGIX_FLASH.ld makefile objects.list $(OPTIONAL_TOOL_DEPS) 79 | arm-none-eabi-gcc -o "zigbee_test.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m4 -T"C:\GitHub\znp-host-stm32\zigbee_test\STM32L496AGIX_FLASH.ld" --specs=nosys.specs -Wl,-Map="zigbee_test.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group 80 | @echo 'Finished building target: $@' 81 | @echo ' ' 82 | 83 | default.size.stdout: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS) 84 | arm-none-eabi-size $(EXECUTABLES) 85 | @echo 'Finished building: $@' 86 | @echo ' ' 87 | 88 | zigbee_test.list: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS) 89 | arm-none-eabi-objdump -h -S $(EXECUTABLES) > "zigbee_test.list" 90 | @echo 'Finished building: $@' 91 | @echo ' ' 92 | 93 | zigbee_test.bin: $(EXECUTABLES) makefile objects.list $(OPTIONAL_TOOL_DEPS) 94 | arm-none-eabi-objcopy -O binary $(EXECUTABLES) "zigbee_test.bin" 95 | @echo 'Finished building: $@' 96 | @echo ' ' 97 | 98 | # Other Targets 99 | clean: 100 | -$(RM) $(SIZE_OUTPUT)$(OBJDUMP_LIST)$(EXECUTABLES)$(OBJS)$(S_DEPS)$(S_UPPER_DEPS)$(C_DEPS)$(OBJCOPY_BIN) zigbee_test.elf 101 | -@echo ' ' 102 | 103 | secondary-outputs: $(SIZE_OUTPUT) $(OBJDUMP_LIST) $(OBJCOPY_BIN) 104 | 105 | fail-specified-linker-script-missing: 106 | @echo 'Error: Cannot find the specified linker script. Check the linker settings in the build configuration.' 107 | @exit 2 108 | 109 | warn-no-linker-script-specified: 110 | @echo 'Warning: No linker script specified. Check the linker settings in the build configuration.' 111 | 112 | .PHONY: all clean dependents fail-specified-linker-script-missing warn-no-linker-script-specified 113 | 114 | -include ../makefile.targets 115 | -------------------------------------------------------------------------------- /zigbee_test/Debug/objects.list: -------------------------------------------------------------------------------- 1 | "./Core/Src/freertos.o" 2 | "./Core/Src/gpio.o" 3 | "./Core/Src/log.o" 4 | "./Core/Src/main.o" 5 | "./Core/Src/stm32l4xx_hal_msp.o" 6 | "./Core/Src/stm32l4xx_hal_timebase_tim.o" 7 | "./Core/Src/stm32l4xx_it.o" 8 | "./Core/Src/syscalls.o" 9 | "./Core/Src/sysmem.o" 10 | "./Core/Src/system_stm32l4xx.o" 11 | "./Core/Src/usart.o" 12 | "./Core/startup/startup_stm32l496xx.o" 13 | "./Core/znp-app/znp_cb.o" 14 | "./Core/znp-app/znp_cmd.o" 15 | "./Core/znp-app/znp_if.o" 16 | "./Core/znp-host-framework/framework/mt/Af/mtAf.o" 17 | "./Core/znp-host-framework/framework/mt/AppCfg/mtAppCfg.o" 18 | "./Core/znp-host-framework/framework/mt/Sapi/mtSapi.o" 19 | "./Core/znp-host-framework/framework/mt/Sys/mtSys.o" 20 | "./Core/znp-host-framework/framework/mt/Util/mtUtil.o" 21 | "./Core/znp-host-framework/framework/mt/Zdo/mtZdo.o" 22 | "./Core/znp-host-framework/framework/mt/mtParser.o" 23 | "./Core/znp-host-framework/framework/platform/stm32/dbgPrint.o" 24 | "./Core/znp-host-framework/framework/platform/stm32/rpcTransportUart.o" 25 | "./Core/znp-host-framework/framework/rpc/rpc.o" 26 | "./Core/znp-host-framework/framework/rpc/rpc_queue.o" 27 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal.o" 28 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_cortex.o" 29 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma.o" 30 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_dma_ex.o" 31 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_exti.o" 32 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash.o" 33 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ex.o" 34 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_flash_ramfunc.o" 35 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_gpio.o" 36 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c.o" 37 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_i2c_ex.o" 38 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr.o" 39 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_pwr_ex.o" 40 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc.o" 41 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_rcc_ex.o" 42 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim.o" 43 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_tim_ex.o" 44 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart.o" 45 | "./Drivers/STM32L4xx_HAL_Driver/Src/stm32l4xx_hal_uart_ex.o" 46 | "./Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.o" 47 | "./Middlewares/Third_Party/FreeRTOS/Source/croutine.o" 48 | "./Middlewares/Third_Party/FreeRTOS/Source/event_groups.o" 49 | "./Middlewares/Third_Party/FreeRTOS/Source/list.o" 50 | "./Middlewares/Third_Party/FreeRTOS/Source/queue.o" 51 | "./Middlewares/Third_Party/FreeRTOS/Source/stream_buffer.o" 52 | "./Middlewares/Third_Party/FreeRTOS/Source/tasks.o" 53 | "./Middlewares/Third_Party/FreeRTOS/Source/timers.o" 54 | "./Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.o" 55 | "./Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang/heap_4.o" 56 | -------------------------------------------------------------------------------- /zigbee_test/Debug/objects.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | USER_OBJS := 7 | 8 | LIBS := 9 | 10 | -------------------------------------------------------------------------------- /zigbee_test/Debug/sources.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | ELF_SRCS := 7 | OBJ_SRCS := 8 | S_SRCS := 9 | C_SRCS := 10 | S_UPPER_SRCS := 11 | O_SRCS := 12 | SIZE_OUTPUT := 13 | OBJDUMP_LIST := 14 | EXECUTABLES := 15 | OBJS := 16 | S_DEPS := 17 | S_UPPER_DEPS := 18 | C_DEPS := 19 | OBJCOPY_BIN := 20 | 21 | # Every subdirectory with source files must be described here 22 | SUBDIRS := \ 23 | Core/Src \ 24 | Core/startup \ 25 | Core/znp-app \ 26 | Core/znp-host-framework/framework/mt/Af \ 27 | Core/znp-host-framework/framework/mt/AppCfg \ 28 | Core/znp-host-framework/framework/mt/Sapi \ 29 | Core/znp-host-framework/framework/mt/Sys \ 30 | Core/znp-host-framework/framework/mt/Util \ 31 | Core/znp-host-framework/framework/mt/Zdo \ 32 | Core/znp-host-framework/framework/mt \ 33 | Core/znp-host-framework/framework/platform/stm32 \ 34 | Core/znp-host-framework/framework/rpc \ 35 | Drivers/STM32L4xx_HAL_Driver/Src \ 36 | Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS \ 37 | Middlewares/Third_Party/FreeRTOS/Source \ 38 | Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F \ 39 | Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang \ 40 | 41 | -------------------------------------------------------------------------------- /zigbee_test/Debug/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | # Toolchain: GNU Tools for STM32 (9-2020-q2-update) 4 | ################################################################################ 5 | 6 | # Add inputs and outputs from these tool invocations to the build variables 7 | 8 | # Each subdirectory must supply rules for building sources it contributes 9 | 10 | -------------------------------------------------------------------------------- /zigbee_test/Debug/zigbee_test.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Debug/zigbee_test.bin -------------------------------------------------------------------------------- /zigbee_test/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l496xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l496xx.h -------------------------------------------------------------------------------- /zigbee_test/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Drivers/CMSIS/Device/ST/STM32L4xx/Include/stm32l4xx.h -------------------------------------------------------------------------------- /zigbee_test/Drivers/CMSIS/Device/ST/STM32L4xx/Include/system_stm32l4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32l4xx.h 4 | * @author MCD Application Team 5 | * @brief CMSIS Cortex-M4 Device System Source File for STM32L4xx devices. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /** @addtogroup CMSIS 21 | * @{ 22 | */ 23 | 24 | /** @addtogroup stm32l4xx_system 25 | * @{ 26 | */ 27 | 28 | /** 29 | * @brief Define to prevent recursive inclusion 30 | */ 31 | #ifndef __SYSTEM_STM32L4XX_H 32 | #define __SYSTEM_STM32L4XX_H 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** @addtogroup STM32L4xx_System_Includes 39 | * @{ 40 | */ 41 | 42 | /** 43 | * @} 44 | */ 45 | 46 | 47 | /** @addtogroup STM32L4xx_System_Exported_Variables 48 | * @{ 49 | */ 50 | /* The SystemCoreClock variable is updated in three ways: 51 | 1) by calling CMSIS function SystemCoreClockUpdate() 52 | 2) by calling HAL API function HAL_RCC_GetSysClockFreq() 53 | 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency 54 | Note: If you use this function to configure the system clock; then there 55 | is no need to call the 2 first functions listed above, since SystemCoreClock 56 | variable is updated automatically. 57 | */ 58 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 59 | 60 | extern const uint8_t AHBPrescTable[16]; /*!< AHB prescalers table values */ 61 | extern const uint8_t APBPrescTable[8]; /*!< APB prescalers table values */ 62 | extern const uint32_t MSIRangeTable[12]; /*!< MSI ranges table values */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @addtogroup STM32L4xx_System_Exported_Constants 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @addtogroup STM32L4xx_System_Exported_Macros 77 | * @{ 78 | */ 79 | 80 | /** 81 | * @} 82 | */ 83 | 84 | /** @addtogroup STM32L4xx_System_Exported_Functions 85 | * @{ 86 | */ 87 | 88 | extern void SystemInit(void); 89 | extern void SystemCoreClockUpdate(void); 90 | /** 91 | * @} 92 | */ 93 | 94 | #ifdef __cplusplus 95 | } 96 | #endif 97 | 98 | #endif /*__SYSTEM_STM32L4XX_H */ 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | /** 105 | * @} 106 | */ 107 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 108 | -------------------------------------------------------------------------------- /zigbee_test/Drivers/CMSIS/Include/cmsis_version.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file cmsis_version.h 3 | * @brief CMSIS Core(M) Version definitions 4 | * @version V5.0.2 5 | * @date 19. April 2017 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2009-2017 ARM Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef __CMSIS_VERSION_H 32 | #define __CMSIS_VERSION_H 33 | 34 | /* CMSIS Version definitions */ 35 | #define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ 36 | #define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ 37 | #define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ 38 | __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ 39 | #endif 40 | -------------------------------------------------------------------------------- /zigbee_test/Drivers/CMSIS/Include/tz_context.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * @file tz_context.h 3 | * @brief Context Management for Armv8-M TrustZone 4 | * @version V1.0.1 5 | * @date 10. January 2018 6 | ******************************************************************************/ 7 | /* 8 | * Copyright (c) 2017-2018 Arm Limited. All rights reserved. 9 | * 10 | * SPDX-License-Identifier: Apache-2.0 11 | * 12 | * Licensed under the Apache License, Version 2.0 (the License); you may 13 | * not use this file except in compliance with the License. 14 | * You may obtain a copy of the License at 15 | * 16 | * www.apache.org/licenses/LICENSE-2.0 17 | * 18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT 20 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | #if defined ( __ICCARM__ ) 26 | #pragma system_include /* treat file as system include file for MISRA check */ 27 | #elif defined (__clang__) 28 | #pragma clang system_header /* treat file as system include file */ 29 | #endif 30 | 31 | #ifndef TZ_CONTEXT_H 32 | #define TZ_CONTEXT_H 33 | 34 | #include 35 | 36 | #ifndef TZ_MODULEID_T 37 | #define TZ_MODULEID_T 38 | /// \details Data type that identifies secure software modules called by a process. 39 | typedef uint32_t TZ_ModuleId_t; 40 | #endif 41 | 42 | /// \details TZ Memory ID identifies an allocated memory slot. 43 | typedef uint32_t TZ_MemoryId_t; 44 | 45 | /// Initialize secure context memory system 46 | /// \return execution status (1: success, 0: error) 47 | uint32_t TZ_InitContextSystem_S (void); 48 | 49 | /// Allocate context memory for calling secure software modules in TrustZone 50 | /// \param[in] module identifies software modules called from non-secure mode 51 | /// \return value != 0 id TrustZone memory slot identifier 52 | /// \return value 0 no memory available or internal error 53 | TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module); 54 | 55 | /// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S 56 | /// \param[in] id TrustZone memory slot identifier 57 | /// \return execution status (1: success, 0: error) 58 | uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id); 59 | 60 | /// Load secure context (called on RTOS thread context switch) 61 | /// \param[in] id TrustZone memory slot identifier 62 | /// \return execution status (1: success, 0: error) 63 | uint32_t TZ_LoadContext_S (TZ_MemoryId_t id); 64 | 65 | /// Store secure context (called on RTOS thread context switch) 66 | /// \param[in] id TrustZone memory slot identifier 67 | /// \return execution status (1: success, 0: error) 68 | uint32_t TZ_StoreContext_S (TZ_MemoryId_t id); 69 | 70 | #endif // TZ_CONTEXT_H 71 | -------------------------------------------------------------------------------- /zigbee_test/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ex.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32l4xx_hal_flash_ex.h 4 | * @author MCD Application Team 5 | * @brief Header file of FLASH HAL Extended module. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef STM32L4xx_HAL_FLASH_EX_H 22 | #define STM32L4xx_HAL_FLASH_EX_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32l4xx_hal_def.h" 30 | 31 | /** @addtogroup STM32L4xx_HAL_Driver 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup FLASHEx 36 | * @{ 37 | */ 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | 41 | /* Exported constants --------------------------------------------------------*/ 42 | #if defined (FLASH_CFGR_LVEN) 43 | /** @addtogroup FLASHEx_Exported_Constants 44 | * @{ 45 | */ 46 | /** @defgroup FLASHEx_LVE_PIN_CFG FLASHEx LVE pin configuration 47 | * @{ 48 | */ 49 | #define FLASH_LVE_PIN_CTRL 0x00000000U /*!< LVE FLASH pin controlled by power controller */ 50 | #define FLASH_LVE_PIN_FORCED FLASH_CFGR_LVEN /*!< LVE FLASH pin enforced to low (external SMPS used) */ 51 | /** 52 | * @} 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | #endif /* FLASH_CFGR_LVEN */ 59 | 60 | /* Exported macro ------------------------------------------------------------*/ 61 | 62 | /* Exported functions --------------------------------------------------------*/ 63 | /** @addtogroup FLASHEx_Exported_Functions 64 | * @{ 65 | */ 66 | 67 | /* Extended Program operation functions *************************************/ 68 | /** @addtogroup FLASHEx_Exported_Functions_Group1 69 | * @{ 70 | */ 71 | HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError); 72 | HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit); 73 | HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit); 74 | void HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit); 75 | /** 76 | * @} 77 | */ 78 | 79 | #if defined (FLASH_CFGR_LVEN) 80 | /** @addtogroup FLASHEx_Exported_Functions_Group2 81 | * @{ 82 | */ 83 | HAL_StatusTypeDef HAL_FLASHEx_ConfigLVEPin(uint32_t ConfigLVE); 84 | /** 85 | * @} 86 | */ 87 | #endif /* FLASH_CFGR_LVEN */ 88 | 89 | /** 90 | * @} 91 | */ 92 | 93 | /* Private function ----------------------------------------------------------*/ 94 | /** @addtogroup FLASHEx_Private_Functions FLASHEx Private Functions 95 | * @{ 96 | */ 97 | void FLASH_PageErase(uint32_t Page, uint32_t Banks); 98 | void FLASH_FlushCaches(void); 99 | /** 100 | * @} 101 | */ 102 | 103 | /* Private macros ------------------------------------------------------------*/ 104 | /** 105 | @cond 0 106 | */ 107 | #if defined (FLASH_CFGR_LVEN) 108 | #define IS_FLASH_LVE_PIN(CFG) (((CFG) == FLASH_LVE_PIN_CTRL) || ((CFG) == FLASH_LVE_PIN_FORCED)) 109 | #endif /* FLASH_CFGR_LVEN */ 110 | /** 111 | @endcond 112 | */ 113 | 114 | /** 115 | * @} 116 | */ 117 | 118 | /** 119 | * @} 120 | */ 121 | 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif /* STM32L4xx_HAL_FLASH_EX_H */ 127 | 128 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 129 | -------------------------------------------------------------------------------- /zigbee_test/Drivers/STM32L4xx_HAL_Driver/Inc/stm32l4xx_hal_flash_ramfunc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32l4xx_hal_flash_ramfunc.h 4 | * @author MCD Application Team 5 | * @brief Header file of FLASH RAMFUNC driver. 6 | ****************************************************************************** 7 | * @attention 8 | * 9 | *

© Copyright (c) 2017 STMicroelectronics. 10 | * All rights reserved.

11 | * 12 | * This software component is licensed by ST under BSD 3-Clause license, 13 | * the "License"; You may not use this file except in compliance with the 14 | * License. You may obtain a copy of the License at: 15 | * opensource.org/licenses/BSD-3-Clause 16 | * 17 | ****************************************************************************** 18 | */ 19 | 20 | /* Define to prevent recursive inclusion -------------------------------------*/ 21 | #ifndef STM32L4xx_FLASH_RAMFUNC_H 22 | #define STM32L4xx_FLASH_RAMFUNC_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | /* Includes ------------------------------------------------------------------*/ 29 | #include "stm32l4xx_hal_def.h" 30 | 31 | /** @addtogroup STM32L4xx_HAL_Driver 32 | * @{ 33 | */ 34 | 35 | /** @addtogroup FLASH_RAMFUNC 36 | * @{ 37 | */ 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported macro ------------------------------------------------------------*/ 41 | /* Exported functions --------------------------------------------------------*/ 42 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions 43 | * @{ 44 | */ 45 | 46 | /** @addtogroup FLASH_RAMFUNC_Exported_Functions_Group1 47 | * @{ 48 | */ 49 | /* Peripheral Control functions ************************************************/ 50 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_EnableRunPowerDown(void); 51 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_DisableRunPowerDown(void); 52 | #if defined (STM32L4P5xx) || defined (STM32L4Q5xx) || defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx) 53 | __RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_OB_DBankConfig(uint32_t DBankConfig); 54 | #endif 55 | /** 56 | * @} 57 | */ 58 | 59 | /** 60 | * @} 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** 68 | * @} 69 | */ 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* STM32L4xx_FLASH_RAMFUNC_H */ 76 | 77 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 78 | -------------------------------------------------------------------------------- /zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.c -------------------------------------------------------------------------------- /zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sandertrilectronics/znp-host-stm32/dd2b5806b1f2cf7b387769023dfacc485d74c670/zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS/cmsis_os.h -------------------------------------------------------------------------------- /zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/include/StackMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef STACK_MACROS_H 29 | #define STACK_MACROS_H 30 | 31 | #ifndef _MSC_VER /* Visual Studio doesn't support #warning. */ 32 | #warning The name of this file has changed to stack_macros.h. Please update your code accordingly. This source file (which has the original name) will be removed in future released. 33 | #endif 34 | 35 | /* 36 | * Call the stack overflow hook function if the stack of the task being swapped 37 | * out is currently overflowed, or looks like it might have overflowed in the 38 | * past. 39 | * 40 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check 41 | * the current stack state only - comparing the current top of stack value to 42 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 43 | * will also cause the last few stack bytes to be checked to ensure the value 44 | * to which the bytes were set when the task was created have not been 45 | * overwritten. Note this second test does not guarantee that an overflowed 46 | * stack will always be recognised. 47 | */ 48 | 49 | /*-----------------------------------------------------------*/ 50 | 51 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 52 | 53 | /* Only the current stack state is to be checked. */ 54 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 55 | { \ 56 | /* Is the currently saved stack pointer within the stack limit? */ \ 57 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 58 | { \ 59 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 60 | } \ 61 | } 62 | 63 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 64 | /*-----------------------------------------------------------*/ 65 | 66 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 67 | 68 | /* Only the current stack state is to be checked. */ 69 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 70 | { \ 71 | \ 72 | /* Is the currently saved stack pointer within the stack limit? */ \ 73 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 74 | { \ 75 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 76 | } \ 77 | } 78 | 79 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 80 | /*-----------------------------------------------------------*/ 81 | 82 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 83 | 84 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 85 | { \ 86 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 87 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 88 | \ 89 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ 90 | ( pulStack[ 1 ] != ulCheckValue ) || \ 91 | ( pulStack[ 2 ] != ulCheckValue ) || \ 92 | ( pulStack[ 3 ] != ulCheckValue ) ) \ 93 | { \ 94 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 95 | } \ 96 | } 97 | 98 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 99 | /*-----------------------------------------------------------*/ 100 | 101 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 102 | 103 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 104 | { \ 105 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 106 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 107 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 108 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 109 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 110 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 111 | \ 112 | \ 113 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 114 | \ 115 | /* Has the extremity of the task stack ever been written over? */ \ 116 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 117 | { \ 118 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 119 | } \ 120 | } 121 | 122 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 123 | /*-----------------------------------------------------------*/ 124 | 125 | /* Remove stack overflow macro if not being used. */ 126 | #ifndef taskCHECK_FOR_STACK_OVERFLOW 127 | #define taskCHECK_FOR_STACK_OVERFLOW() 128 | #endif 129 | 130 | 131 | 132 | #endif /* STACK_MACROS_H */ 133 | 134 | -------------------------------------------------------------------------------- /zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/include/projdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef PROJDEFS_H 29 | #define PROJDEFS_H 30 | 31 | /* 32 | * Defines the prototype to which task functions must conform. Defined in this 33 | * file to ensure the type is known before portable.h is included. 34 | */ 35 | typedef void (*TaskFunction_t)( void * ); 36 | 37 | /* Converts a time in milliseconds to a time in ticks. This macro can be 38 | overridden by a macro of the same name defined in FreeRTOSConfig.h in case the 39 | definition here is not suitable for your application. */ 40 | #ifndef pdMS_TO_TICKS 41 | #define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) ( ( ( TickType_t ) ( xTimeInMs ) * ( TickType_t ) configTICK_RATE_HZ ) / ( TickType_t ) 1000 ) ) 42 | #endif 43 | 44 | #define pdFALSE ( ( BaseType_t ) 0 ) 45 | #define pdTRUE ( ( BaseType_t ) 1 ) 46 | 47 | #define pdPASS ( pdTRUE ) 48 | #define pdFAIL ( pdFALSE ) 49 | #define errQUEUE_EMPTY ( ( BaseType_t ) 0 ) 50 | #define errQUEUE_FULL ( ( BaseType_t ) 0 ) 51 | 52 | /* FreeRTOS error definitions. */ 53 | #define errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY ( -1 ) 54 | #define errQUEUE_BLOCKED ( -4 ) 55 | #define errQUEUE_YIELD ( -5 ) 56 | 57 | /* Macros used for basic data corruption checks. */ 58 | #ifndef configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 59 | #define configUSE_LIST_DATA_INTEGRITY_CHECK_BYTES 0 60 | #endif 61 | 62 | #if( configUSE_16_BIT_TICKS == 1 ) 63 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a 64 | #else 65 | #define pdINTEGRITY_CHECK_VALUE 0x5a5a5a5aUL 66 | #endif 67 | 68 | /* The following errno values are used by FreeRTOS+ components, not FreeRTOS 69 | itself. */ 70 | #define pdFREERTOS_ERRNO_NONE 0 /* No errors */ 71 | #define pdFREERTOS_ERRNO_ENOENT 2 /* No such file or directory */ 72 | #define pdFREERTOS_ERRNO_EINTR 4 /* Interrupted system call */ 73 | #define pdFREERTOS_ERRNO_EIO 5 /* I/O error */ 74 | #define pdFREERTOS_ERRNO_ENXIO 6 /* No such device or address */ 75 | #define pdFREERTOS_ERRNO_EBADF 9 /* Bad file number */ 76 | #define pdFREERTOS_ERRNO_EAGAIN 11 /* No more processes */ 77 | #define pdFREERTOS_ERRNO_EWOULDBLOCK 11 /* Operation would block */ 78 | #define pdFREERTOS_ERRNO_ENOMEM 12 /* Not enough memory */ 79 | #define pdFREERTOS_ERRNO_EACCES 13 /* Permission denied */ 80 | #define pdFREERTOS_ERRNO_EFAULT 14 /* Bad address */ 81 | #define pdFREERTOS_ERRNO_EBUSY 16 /* Mount device busy */ 82 | #define pdFREERTOS_ERRNO_EEXIST 17 /* File exists */ 83 | #define pdFREERTOS_ERRNO_EXDEV 18 /* Cross-device link */ 84 | #define pdFREERTOS_ERRNO_ENODEV 19 /* No such device */ 85 | #define pdFREERTOS_ERRNO_ENOTDIR 20 /* Not a directory */ 86 | #define pdFREERTOS_ERRNO_EISDIR 21 /* Is a directory */ 87 | #define pdFREERTOS_ERRNO_EINVAL 22 /* Invalid argument */ 88 | #define pdFREERTOS_ERRNO_ENOSPC 28 /* No space left on device */ 89 | #define pdFREERTOS_ERRNO_ESPIPE 29 /* Illegal seek */ 90 | #define pdFREERTOS_ERRNO_EROFS 30 /* Read only file system */ 91 | #define pdFREERTOS_ERRNO_EUNATCH 42 /* Protocol driver not attached */ 92 | #define pdFREERTOS_ERRNO_EBADE 50 /* Invalid exchange */ 93 | #define pdFREERTOS_ERRNO_EFTYPE 79 /* Inappropriate file type or format */ 94 | #define pdFREERTOS_ERRNO_ENMFILE 89 /* No more files */ 95 | #define pdFREERTOS_ERRNO_ENOTEMPTY 90 /* Directory not empty */ 96 | #define pdFREERTOS_ERRNO_ENAMETOOLONG 91 /* File or path name too long */ 97 | #define pdFREERTOS_ERRNO_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ 98 | #define pdFREERTOS_ERRNO_ENOBUFS 105 /* No buffer space available */ 99 | #define pdFREERTOS_ERRNO_ENOPROTOOPT 109 /* Protocol not available */ 100 | #define pdFREERTOS_ERRNO_EADDRINUSE 112 /* Address already in use */ 101 | #define pdFREERTOS_ERRNO_ETIMEDOUT 116 /* Connection timed out */ 102 | #define pdFREERTOS_ERRNO_EINPROGRESS 119 /* Connection already in progress */ 103 | #define pdFREERTOS_ERRNO_EALREADY 120 /* Socket already connected */ 104 | #define pdFREERTOS_ERRNO_EADDRNOTAVAIL 125 /* Address not available */ 105 | #define pdFREERTOS_ERRNO_EISCONN 127 /* Socket is already connected */ 106 | #define pdFREERTOS_ERRNO_ENOTCONN 128 /* Socket is not connected */ 107 | #define pdFREERTOS_ERRNO_ENOMEDIUM 135 /* No medium inserted */ 108 | #define pdFREERTOS_ERRNO_EILSEQ 138 /* An invalid UTF-16 sequence was encountered. */ 109 | #define pdFREERTOS_ERRNO_ECANCELED 140 /* Operation canceled. */ 110 | 111 | /* The following endian values are used by FreeRTOS+ components, not FreeRTOS 112 | itself. */ 113 | #define pdFREERTOS_LITTLE_ENDIAN 0 114 | #define pdFREERTOS_BIG_ENDIAN 1 115 | 116 | /* Re-defining endian values for generic naming. */ 117 | #define pdLITTLE_ENDIAN pdFREERTOS_LITTLE_ENDIAN 118 | #define pdBIG_ENDIAN pdFREERTOS_BIG_ENDIAN 119 | 120 | 121 | #endif /* PROJDEFS_H */ 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /zigbee_test/Middlewares/Third_Party/FreeRTOS/Source/include/stack_macros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FreeRTOS Kernel V10.2.1 3 | * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. 4 | * 5 | * Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | * this software and associated documentation files (the "Software"), to deal in 7 | * the Software without restriction, including without limitation the rights to 8 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | * the Software, and to permit persons to whom the Software is furnished to do so, 10 | * subject to the following conditions: 11 | * 12 | * The above copyright notice and this permission notice shall be included in all 13 | * copies or substantial portions of the Software. 14 | * 15 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | * 22 | * http://www.FreeRTOS.org 23 | * http://aws.amazon.com/freertos 24 | * 25 | * 1 tab == 4 spaces! 26 | */ 27 | 28 | #ifndef STACK_MACROS_H 29 | #define STACK_MACROS_H 30 | 31 | /* 32 | * Call the stack overflow hook function if the stack of the task being swapped 33 | * out is currently overflowed, or looks like it might have overflowed in the 34 | * past. 35 | * 36 | * Setting configCHECK_FOR_STACK_OVERFLOW to 1 will cause the macro to check 37 | * the current stack state only - comparing the current top of stack value to 38 | * the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1 39 | * will also cause the last few stack bytes to be checked to ensure the value 40 | * to which the bytes were set when the task was created have not been 41 | * overwritten. Note this second test does not guarantee that an overflowed 42 | * stack will always be recognised. 43 | */ 44 | 45 | /*-----------------------------------------------------------*/ 46 | 47 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH < 0 ) ) 48 | 49 | /* Only the current stack state is to be checked. */ 50 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 51 | { \ 52 | /* Is the currently saved stack pointer within the stack limit? */ \ 53 | if( pxCurrentTCB->pxTopOfStack <= pxCurrentTCB->pxStack ) \ 54 | { \ 55 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 56 | } \ 57 | } 58 | 59 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 60 | /*-----------------------------------------------------------*/ 61 | 62 | #if( ( configCHECK_FOR_STACK_OVERFLOW == 1 ) && ( portSTACK_GROWTH > 0 ) ) 63 | 64 | /* Only the current stack state is to be checked. */ 65 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 66 | { \ 67 | \ 68 | /* Is the currently saved stack pointer within the stack limit? */ \ 69 | if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \ 70 | { \ 71 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 72 | } \ 73 | } 74 | 75 | #endif /* configCHECK_FOR_STACK_OVERFLOW == 1 */ 76 | /*-----------------------------------------------------------*/ 77 | 78 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH < 0 ) ) 79 | 80 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 81 | { \ 82 | const uint32_t * const pulStack = ( uint32_t * ) pxCurrentTCB->pxStack; \ 83 | const uint32_t ulCheckValue = ( uint32_t ) 0xa5a5a5a5; \ 84 | \ 85 | if( ( pulStack[ 0 ] != ulCheckValue ) || \ 86 | ( pulStack[ 1 ] != ulCheckValue ) || \ 87 | ( pulStack[ 2 ] != ulCheckValue ) || \ 88 | ( pulStack[ 3 ] != ulCheckValue ) ) \ 89 | { \ 90 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 91 | } \ 92 | } 93 | 94 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 95 | /*-----------------------------------------------------------*/ 96 | 97 | #if( ( configCHECK_FOR_STACK_OVERFLOW > 1 ) && ( portSTACK_GROWTH > 0 ) ) 98 | 99 | #define taskCHECK_FOR_STACK_OVERFLOW() \ 100 | { \ 101 | int8_t *pcEndOfStack = ( int8_t * ) pxCurrentTCB->pxEndOfStack; \ 102 | static const uint8_t ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 103 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 104 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 105 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \ 106 | tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE }; \ 107 | \ 108 | \ 109 | pcEndOfStack -= sizeof( ucExpectedStackBytes ); \ 110 | \ 111 | /* Has the extremity of the task stack ever been written over? */ \ 112 | if( memcmp( ( void * ) pcEndOfStack, ( void * ) ucExpectedStackBytes, sizeof( ucExpectedStackBytes ) ) != 0 ) \ 113 | { \ 114 | vApplicationStackOverflowHook( ( TaskHandle_t ) pxCurrentTCB, pxCurrentTCB->pcTaskName ); \ 115 | } \ 116 | } 117 | 118 | #endif /* #if( configCHECK_FOR_STACK_OVERFLOW > 1 ) */ 119 | /*-----------------------------------------------------------*/ 120 | 121 | /* Remove stack overflow macro if not being used. */ 122 | #ifndef taskCHECK_FOR_STACK_OVERFLOW 123 | #define taskCHECK_FOR_STACK_OVERFLOW() 124 | #endif 125 | 126 | 127 | 128 | #endif /* STACK_MACROS_H */ 129 | 130 | -------------------------------------------------------------------------------- /zigbee_test/STM32L496AGIX_FLASH.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ****************************************************************************** 3 | ** 4 | ** @file : LinkerScript.ld 5 | ** 6 | ** @author : Auto-generated by STM32CubeIDE 7 | ** 8 | ** @brief : Linker script for STM32L496AGIx Device from STM32L4 series 9 | ** 1024Kbytes FLASH 10 | ** 256Kbytes RAM 11 | ** 64Kbytes RAM2 12 | ** 13 | ** Set heap size, stack size and stack location according 14 | ** to application requirements. 15 | ** 16 | ** Set memory bank area and size if external memory is used 17 | ** 18 | ** Target : STMicroelectronics STM32 19 | ** 20 | ** Distribution: The file is distributed as is, without any warranty 21 | ** of any kind. 22 | ** 23 | ****************************************************************************** 24 | ** @attention 25 | ** 26 | **

© Copyright (c) 2021 STMicroelectronics. 27 | ** All rights reserved.

28 | ** 29 | ** This software component is licensed by ST under BSD 3-Clause license, 30 | ** the "License"; You may not use this file except in compliance with the 31 | ** License. You may obtain a copy of the License at: 32 | ** opensource.org/licenses/BSD-3-Clause 33 | ** 34 | ****************************************************************************** 35 | */ 36 | 37 | /* Entry Point */ 38 | ENTRY(Reset_Handler) 39 | 40 | /* Highest address of the user mode stack */ 41 | _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ 42 | 43 | _Min_Heap_Size = 0x200; /* required amount of heap */ 44 | _Min_Stack_Size = 0x400; /* required amount of stack */ 45 | 46 | /* Memories definition */ 47 | MEMORY 48 | { 49 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K 50 | RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 64K 51 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K 52 | } 53 | 54 | /* Sections */ 55 | SECTIONS 56 | { 57 | /* The startup code into "FLASH" Rom type memory */ 58 | .isr_vector : 59 | { 60 | . = ALIGN(4); 61 | KEEP(*(.isr_vector)) /* Startup code */ 62 | . = ALIGN(4); 63 | } >FLASH 64 | 65 | /* The program code and other data into "FLASH" Rom type memory */ 66 | .text : 67 | { 68 | . = ALIGN(4); 69 | *(.text) /* .text sections (code) */ 70 | *(.text*) /* .text* sections (code) */ 71 | *(.glue_7) /* glue arm to thumb code */ 72 | *(.glue_7t) /* glue thumb to arm code */ 73 | *(.eh_frame) 74 | 75 | KEEP (*(.init)) 76 | KEEP (*(.fini)) 77 | 78 | . = ALIGN(4); 79 | _etext = .; /* define a global symbols at end of code */ 80 | } >FLASH 81 | 82 | /* Constant data into "FLASH" Rom type memory */ 83 | .rodata : 84 | { 85 | . = ALIGN(4); 86 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 87 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 88 | . = ALIGN(4); 89 | } >FLASH 90 | 91 | .ARM.extab : { 92 | . = ALIGN(4); 93 | *(.ARM.extab* .gnu.linkonce.armextab.*) 94 | . = ALIGN(4); 95 | } >FLASH 96 | 97 | .ARM : { 98 | . = ALIGN(4); 99 | __exidx_start = .; 100 | *(.ARM.exidx*) 101 | __exidx_end = .; 102 | . = ALIGN(4); 103 | } >FLASH 104 | 105 | .preinit_array : 106 | { 107 | . = ALIGN(4); 108 | PROVIDE_HIDDEN (__preinit_array_start = .); 109 | KEEP (*(.preinit_array*)) 110 | PROVIDE_HIDDEN (__preinit_array_end = .); 111 | . = ALIGN(4); 112 | } >FLASH 113 | 114 | .init_array : 115 | { 116 | . = ALIGN(4); 117 | PROVIDE_HIDDEN (__init_array_start = .); 118 | KEEP (*(SORT(.init_array.*))) 119 | KEEP (*(.init_array*)) 120 | PROVIDE_HIDDEN (__init_array_end = .); 121 | . = ALIGN(4); 122 | } >FLASH 123 | 124 | .fini_array : 125 | { 126 | . = ALIGN(4); 127 | PROVIDE_HIDDEN (__fini_array_start = .); 128 | KEEP (*(SORT(.fini_array.*))) 129 | KEEP (*(.fini_array*)) 130 | PROVIDE_HIDDEN (__fini_array_end = .); 131 | . = ALIGN(4); 132 | } >FLASH 133 | 134 | /* Used by the startup to initialize data */ 135 | _sidata = LOADADDR(.data); 136 | 137 | /* Initialized data sections into "RAM" Ram type memory */ 138 | .data : 139 | { 140 | . = ALIGN(4); 141 | _sdata = .; /* create a global symbol at data start */ 142 | *(.data) /* .data sections */ 143 | *(.data*) /* .data* sections */ 144 | *(.RamFunc) /* .RamFunc sections */ 145 | *(.RamFunc*) /* .RamFunc* sections */ 146 | 147 | . = ALIGN(4); 148 | _edata = .; /* define a global symbol at data end */ 149 | 150 | } >RAM AT> FLASH 151 | 152 | /* Uninitialized data section into "RAM" Ram type memory */ 153 | . = ALIGN(4); 154 | .bss : 155 | { 156 | /* This is used by the startup in order to initialize the .bss section */ 157 | _sbss = .; /* define a global symbol at bss start */ 158 | __bss_start__ = _sbss; 159 | *(.bss) 160 | *(.bss*) 161 | *(COMMON) 162 | 163 | . = ALIGN(4); 164 | _ebss = .; /* define a global symbol at bss end */ 165 | __bss_end__ = _ebss; 166 | } >RAM 167 | 168 | /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ 169 | ._user_heap_stack : 170 | { 171 | . = ALIGN(8); 172 | PROVIDE ( end = . ); 173 | PROVIDE ( _end = . ); 174 | . = . + _Min_Heap_Size; 175 | . = . + _Min_Stack_Size; 176 | . = ALIGN(8); 177 | } >RAM 178 | 179 | /* Remove information from the compiler libraries */ 180 | /DISCARD/ : 181 | { 182 | libc.a ( * ) 183 | libm.a ( * ) 184 | libgcc.a ( * ) 185 | } 186 | 187 | .ARM.attributes 0 : { *(.ARM.attributes) } 188 | } 189 | -------------------------------------------------------------------------------- /zigbee_test/STM32L496AGIX_RAM.ld: -------------------------------------------------------------------------------- 1 | /* 2 | ****************************************************************************** 3 | ** 4 | ** @file : LinkerScript.ld (debug in RAM dedicated) 5 | ** 6 | ** @author : Auto-generated by STM32CubeIDE 7 | ** 8 | ** @brief : Linker script for STM32L496AGIx Device from STM32L4 series 9 | ** 1024Kbytes FLASH 10 | ** 256Kbytes RAM 11 | ** 64Kbytes RAM2 12 | ** 13 | ** Set heap size, stack size and stack location according 14 | ** to application requirements. 15 | ** 16 | ** Set memory bank area and size if external memory is used 17 | ** 18 | ** Target : STMicroelectronics STM32 19 | ** 20 | ** Distribution: The file is distributed as is, without any warranty 21 | ** of any kind. 22 | ** 23 | ****************************************************************************** 24 | ** @attention 25 | ** 26 | **

© Copyright (c) 2021 STMicroelectronics. 27 | ** All rights reserved.

28 | ** 29 | ** This software component is licensed by ST under BSD 3-Clause license, 30 | ** the "License"; You may not use this file except in compliance with the 31 | ** License. You may obtain a copy of the License at: 32 | ** opensource.org/licenses/BSD-3-Clause 33 | ** 34 | ****************************************************************************** 35 | */ 36 | 37 | /* Entry Point */ 38 | ENTRY(Reset_Handler) 39 | 40 | /* Highest address of the user mode stack */ 41 | _estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ 42 | 43 | _Min_Heap_Size = 0x200; /* required amount of heap */ 44 | _Min_Stack_Size = 0x400; /* required amount of stack */ 45 | 46 | /* Memories definition */ 47 | MEMORY 48 | { 49 | RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K 50 | RAM2 (xrw) : ORIGIN = 0x10000000, LENGTH = 64K 51 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 1024K 52 | } 53 | 54 | /* Sections */ 55 | SECTIONS 56 | { 57 | /* The startup code into "RAM" Ram type memory */ 58 | .isr_vector : 59 | { 60 | . = ALIGN(4); 61 | KEEP(*(.isr_vector)) /* Startup code */ 62 | . = ALIGN(4); 63 | } >RAM 64 | 65 | /* The program code and other data into "RAM" Ram type memory */ 66 | .text : 67 | { 68 | . = ALIGN(4); 69 | *(.text) /* .text sections (code) */ 70 | *(.text*) /* .text* sections (code) */ 71 | *(.glue_7) /* glue arm to thumb code */ 72 | *(.glue_7t) /* glue thumb to arm code */ 73 | *(.eh_frame) 74 | *(.RamFunc) /* .RamFunc sections */ 75 | *(.RamFunc*) /* .RamFunc* sections */ 76 | 77 | KEEP (*(.init)) 78 | KEEP (*(.fini)) 79 | 80 | . = ALIGN(4); 81 | _etext = .; /* define a global symbols at end of code */ 82 | } >RAM 83 | 84 | /* Constant data into "RAM" Ram type memory */ 85 | .rodata : 86 | { 87 | . = ALIGN(4); 88 | *(.rodata) /* .rodata sections (constants, strings, etc.) */ 89 | *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ 90 | . = ALIGN(4); 91 | } >RAM 92 | 93 | .ARM.extab : { 94 | . = ALIGN(4); 95 | *(.ARM.extab* .gnu.linkonce.armextab.*) 96 | . = ALIGN(4); 97 | } >RAM 98 | 99 | .ARM : { 100 | . = ALIGN(4); 101 | __exidx_start = .; 102 | *(.ARM.exidx*) 103 | __exidx_end = .; 104 | . = ALIGN(4); 105 | } >RAM 106 | 107 | .preinit_array : 108 | { 109 | . = ALIGN(4); 110 | PROVIDE_HIDDEN (__preinit_array_start = .); 111 | KEEP (*(.preinit_array*)) 112 | PROVIDE_HIDDEN (__preinit_array_end = .); 113 | . = ALIGN(4); 114 | } >RAM 115 | 116 | .init_array : 117 | { 118 | . = ALIGN(4); 119 | PROVIDE_HIDDEN (__init_array_start = .); 120 | KEEP (*(SORT(.init_array.*))) 121 | KEEP (*(.init_array*)) 122 | PROVIDE_HIDDEN (__init_array_end = .); 123 | . = ALIGN(4); 124 | } >RAM 125 | 126 | .fini_array : 127 | { 128 | . = ALIGN(4); 129 | PROVIDE_HIDDEN (__fini_array_start = .); 130 | KEEP (*(SORT(.fini_array.*))) 131 | KEEP (*(.fini_array*)) 132 | PROVIDE_HIDDEN (__fini_array_end = .); 133 | . = ALIGN(4); 134 | } >RAM 135 | 136 | /* Used by the startup to initialize data */ 137 | _sidata = LOADADDR(.data); 138 | 139 | /* Initialized data sections into "RAM" Ram type memory */ 140 | .data : 141 | { 142 | . = ALIGN(4); 143 | _sdata = .; /* create a global symbol at data start */ 144 | *(.data) /* .data sections */ 145 | *(.data*) /* .data* sections */ 146 | 147 | . = ALIGN(4); 148 | _edata = .; /* define a global symbol at data end */ 149 | 150 | } >RAM 151 | 152 | /* Uninitialized data section into "RAM" Ram type memory */ 153 | . = ALIGN(4); 154 | .bss : 155 | { 156 | /* This is used by the startup in order to initialize the .bss section */ 157 | _sbss = .; /* define a global symbol at bss start */ 158 | __bss_start__ = _sbss; 159 | *(.bss) 160 | *(.bss*) 161 | *(COMMON) 162 | 163 | . = ALIGN(4); 164 | _ebss = .; /* define a global symbol at bss end */ 165 | __bss_end__ = _ebss; 166 | } >RAM 167 | 168 | /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ 169 | ._user_heap_stack : 170 | { 171 | . = ALIGN(8); 172 | PROVIDE ( end = . ); 173 | PROVIDE ( _end = . ); 174 | . = . + _Min_Heap_Size; 175 | . = . + _Min_Stack_Size; 176 | . = ALIGN(8); 177 | } >RAM 178 | 179 | /* Remove information from the compiler libraries */ 180 | /DISCARD/ : 181 | { 182 | libc.a ( * ) 183 | libm.a ( * ) 184 | libgcc.a ( * ) 185 | } 186 | 187 | .ARM.attributes 0 : { *(.ARM.attributes) } 188 | } 189 | --------------------------------------------------------------------------------