Explorar el Código

Add support ChibiOS v16.x.x (both nil and rt kernels)

Alex Novikov hace 10 años
padre
commit
8aeb17dbcd

+ 1 - 1
README.md

@@ -85,7 +85,7 @@ You can use cmake variables below to tune the generated linker. To specify a cus
 
 # ChibiOS Support
 
-This project also supports ChibiOS v3.x.x (both nil and rt kernels).
+This project also supports ChibiOS v3.x.x and ChibiOS v16.x.x (both nil and rt kernels).
 
 CMake modules for ChibiOS can find specified ChibiOS components using the COMPONENTS directive.
 

+ 80 - 0
cmake/ChibiOS16.cmake

@@ -0,0 +1,80 @@
+IF(NOT ChibiOS_FIND_COMPONENTS)
+    SET(ChibiOS_FIND_COMPONENTS nil hal st)
+    MESSAGE(STATUS "No ChibiOS components specified, using default: ${ChibiOS_FIND_COMPONENTS}")
+ENDIF()
+
+
+LIST(FIND ChibiOS_FIND_COMPONENTS nil ChibiOS_FIND_COMPONENTS_nil)
+LIST(FIND ChibiOS_FIND_COMPONENTS rt ChibiOS_FIND_COMPONENTS_rt)
+LIST(FIND ChibiOS_FIND_COMPONENTS hal ChibiOS_FIND_COMPONENTS_hal)
+LIST(FIND ChibiOS_FIND_COMPONENTS st ChibiOS_FIND_COMPONENTS_st)
+
+IF((${ChibiOS_FIND_COMPONENTS_nil} LESS 0) AND (${ChibiOS_FIND_COMPONENTS_rt} LESS 0))
+  MESSAGE(STATUS "No kernel component selected, using Nil kernel")
+  LIST(APPEND ChibiOS_FIND_COMPONENTS nil)
+  SET(CHIBIOS_KERNEL nil)
+ELSE()
+  IF((NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0)) AND (NOT (${ChibiOS_FIND_COMPONENTS_rt} LESS 0)))
+    MESSAGE(FATAL_ERROR "Cannot use RT and Nil kernel at the same time")
+  ENDIF()
+  IF(NOT (${ChibiOS_FIND_COMPONENTS_nil} LESS 0))
+    SET(CHIBIOS_KERNEL nil)
+  ELSE()
+    SET(CHIBIOS_KERNEL rt)
+  ENDIF()
+ENDIF()
+
+IF(${ChibiOS_FIND_COMPONENTS_hal} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS hal)
+ENDIF()
+
+IF(${ChibiOS_FIND_COMPONENTS_st} LESS 0)
+  LIST(APPEND ChibiOS_FIND_COMPONENTS st)
+ENDIF()
+
+INCLUDE(ChibiOS16_LD)
+INCLUDE(ChibiOS16_HAL)
+
+
+IF(${CHIBIOS_KERNEL} STREQUAL rt)
+  INCLUDE(ChibiOS16_RT)
+ELSE()
+  INCLUDE(ChibiOS16_NIL)
+ENDIF()
+
+INCLUDE(ChibiOS16_Various)
+
+SET(CHIBIOS_COMPONENTS nil rt hal ${CHIBIOS_HAL_MODULES} ${CHIBIOS_HAL_LIB_MODULES} ${CHIBIOS_VARIOUS_MODULES})
+
+IF(NOT ChibiOS_LINKER_SCRIPT)
+    MESSAGE(STATUS "ChibiOS doesn't have linker script for your chip, please specify it directly using ChibiOS_LINKER_SCRIPT variable.")
+ENDIF()
+
+FOREACH(comp ${ChibiOS_FIND_COMPONENTS})
+    LIST(FIND CHIBIOS_COMPONENTS ${comp} INDEX)
+    IF(INDEX EQUAL -1)
+        MESSAGE(FATAL_ERROR "Unknown ChibiOS component: ${comp}\nSupported ChibiOS components: ${CHIBIOS_COMPONENTS}")
+    ENDIF()
+    FOREACH(source ${CHIBIOS_${comp}_SOURCES})
+        FIND_FILE(CHIBIOS_${comp}_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH)
+        LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_${source}})
+    ENDFOREACH()
+    IF(CHIBIOS_${comp}_SEARCH_HEADERS)
+        FOREACH(header ${CHIBIOS_${comp}_SEARCH_HEADERS})
+            FIND_PATH(CHIBIOS_${comp}_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH)
+            LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_${header}_INCLUDE_DIR})
+        ENDFOREACH()
+    ENDIF()
+    IF(CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS)
+        FOREACH(header ${CHIBIOS_${comp}_PLATFORM_SEARCH_HEADERS})
+            FIND_PATH(CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR NAMES ${header} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH)
+            LIST(APPEND ChibiOS_INCLUDE_DIRS ${CHIBIOS_${comp}_PLATFORM_${header}_INCLUDE_DIR})
+        ENDFOREACH()
+    ENDIF()
+    IF(CHIBIOS_${comp}_PLATFORM_SOURCES)
+        FOREACH(source ${CHIBIOS_${comp}_PLATFORM_SOURCES})
+            FIND_FILE(CHIBIOS_${comp}_PLATFORM_${source} NAMES ${source} PATHS ${CHIBIOS_${comp}_PLATFORM_SEARCH_PATH} NO_DEFAULT_PATH CMAKE_FIND_ROOT_PATH_BOTH)
+            LIST(APPEND ChibiOS_SOURCES ${CHIBIOS_${comp}_PLATFORM_${source}})
+        ENDFOREACH()
+    ENDIF()
+ENDFOREACH()

+ 199 - 0
cmake/ChibiOS16_HAL.cmake

@@ -0,0 +1,199 @@
+SET(CHIBIOS_HAL_LIB_MODULES chprintf memstreams nullstreams)
+SET(CHIBIOS_HAL_MODULES adc can dac ext gpt i2c i2s icu mac mmc_spi mmcsd pal pwm rtc sdc serial serial_usb spi st uart usb)
+
+IF(${CHIBIOS_KERNEL} STREQUAL nil)
+  SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/nil)
+ELSE()
+  SET(CHIBIOS_OSAL_PATH ${CHIBIOS_ROOT}/os/hal/osal/rt)
+ENDIF()
+
+SET(CHIBIOS_hal_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src/ ${CHIBIOS_OSAL_PATH})
+SET(CHIBIOS_hal_SEARCH_HEADERS hal.h osal.h)
+SET(CHIBIOS_hal_SOURCES hal.c hal_queues.c osal.c)
+
+FOREACH(module ${CHIBIOS_HAL_MODULES})
+  SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/include ${CHIBIOS_ROOT}/os/hal/src)
+  SET(CHIBIOS_${module}_SOURCES ${module}.c)
+  SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h)
+
+  IF(${module} STREQUAL mmcsd)
+    SET(CHIBIOS_${module}_SOURCES hal_mmcsd.c)
+  ENDIF()
+ENDFOREACH()
+
+FOREACH(module ${CHIBIOS_HAL_LIB_MODULES})
+  SET(CHIBIOS_${module}_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/lib/streams)
+  SET(CHIBIOS_${module}_SOURCES ${module}.c)
+  SET(CHIBIOS_${module}_SEARCH_HEADERS ${module}.h)
+ENDFOREACH()
+
+IF(STM32_FAMILY STREQUAL "F0")
+    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb)
+    SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES
+            LLD/ADCv1
+            LLD/CANv1
+            LLD/DACv1
+            LLD/EXTIv1
+            LLD/TIMv1
+            LLD/I2Cv2
+            LLD/SPIv1
+            LLD/TIMv1
+            LLD/MACv1
+            LLD/GPIOv2
+            LLD/TIMv1
+            LLD/RTCv2
+            LLD/SDMMCv1
+            LLD/USARTv2
+            LLD/SPIv2
+            LLD/TIMv1
+            LLD/USARTv2
+            LLD/USBv1
+            LDD/DMAv1
+            )
+
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH
+            ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx
+            ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx
+            ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1
+            ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1
+            )
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS
+            hal_lld.h
+            stm32_dma.h
+            nvic.h
+            st_lld.h
+            )
+    SET(CHIBIOS_hal_PLATFORM_SOURCES
+            hal_lld.c
+            stm32_dma.c
+            nvic.c
+            st_lld.c
+            )
+    SET(INDEX 0)
+    FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES})
+        LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path)
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path})
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h)
+        SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c)
+
+        IF(${module} STREQUAL ext)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F0xx)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h)
+            SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c)
+        ENDIF()
+
+        MATH(EXPR INDEX "${INDEX} + 1")
+    ENDFOREACH()
+ELSEIF(STM32_FAMILY STREQUAL "F1")
+    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c icu pal pwm rtc sdc serial spi st uart usb)
+    SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES
+      STM32F1xx
+      LLD/CANv1
+      LLD/DACv1
+      LLD/EXTIv1
+      LLD/TIMv1
+      LLD/I2Cv1
+      LLD/TIMv1
+      LLD/GPIOv1
+      LLD/TIMv1
+      LLD/RTCv1
+      LLD/SDIOv1
+      LLD/USARTv1
+      LLD/SPIv1
+      LLD/TIMv1
+      LLD/USARTv1
+      LLD/USBv1
+    )
+
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH
+        ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv1
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1
+    )
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS
+        hal_lld.h
+        stm32_dma.h
+        nvic.h
+        st_lld.h
+    )
+    SET(CHIBIOS_hal_PLATFORM_SOURCES
+        hal_lld.c
+        stm32_dma.c
+        nvic.c
+        st_lld.c
+    )
+    SET(INDEX 0)
+    FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES})
+        LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path)
+
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path})
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h)
+        SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c)
+
+        IF(${module} STREQUAL ext)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F1xx)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h)
+            SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c)
+        ENDIF()
+
+        MATH(EXPR INDEX "${INDEX} + 1")
+    ENDFOREACH()
+ELSEIF(STM32_FAMILY STREQUAL "F4")
+    SET(CHIBIOS_HAL_PLATFORM_MODULES adc can dac ext gpt i2c i2s icu mac pal pwm rtc sdc serial spi st uart usb)
+    SET(CHIBIOS_HAL_PLATFORM_MODULES_PATHES
+      LLD/ADCv2
+      LLD/CANv1
+      LLD/DACv1
+      LLD/EXTIv1
+      LLD/TIMv1
+      LLD/I2Cv1
+      LLD/SPIv1
+      LLD/TIMv1
+      LLD/MACv1
+      LLD/GPIOv2
+      LLD/TIMv1
+      LLD/RTCv2
+      LLD/SDIOv1
+      LLD/USARTv1
+      LLD/SPIv1
+      LLD/TIMv1
+      LLD/USARTv1
+      LLD/OTGv1
+    )
+
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_PATH
+        ${CHIBIOS_ROOT}/os/hal/ports/common/ARMCMx
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/TIMv1
+        ${CHIBIOS_ROOT}/os/hal/ports/STM32/LLD/DMAv2
+    )
+    SET(CHIBIOS_hal_PLATFORM_SEARCH_HEADERS
+        hal_lld.h
+        stm32_dma.h
+        nvic.h
+        st_lld.h
+    )
+    SET(CHIBIOS_hal_PLATFORM_SOURCES
+        hal_lld.c
+        stm32_dma.c
+        nvic.c
+        st_lld.c
+    )
+    SET(INDEX 0)
+    FOREACH(module ${CHIBIOS_HAL_PLATFORM_MODULES})
+        LIST(GET CHIBIOS_HAL_PLATFORM_MODULES_PATHES ${INDEX} path)
+
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ROOT}/os/hal/ports/STM32/${path})
+        SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${module}_lld.h)
+        SET(CHIBIOS_${module}_PLATFORM_SOURCES ${module}_lld.c)
+
+        IF(${module} STREQUAL ext)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_PATH ${CHIBIOS_ext_PLATFORM_SEARCH_PATH} ${CHIBIOS_ROOT}/os/hal/ports/STM32/STM32F4xx)
+            SET(CHIBIOS_${module}_PLATFORM_SEARCH_HEADERS ${CHIBIOS_ext_PLATFORM_SEARCH_HEADERS} ext_lld_isr.h)
+            SET(CHIBIOS_${module}_PLATFORM_SOURCES ${CHIBIOS_ext_PLATFORM_SOURCES} ext_lld_isr.c)
+        ENDIF()
+
+        MATH(EXPR INDEX "${INDEX} + 1")
+    ENDFOREACH()
+ENDIF()

+ 38 - 0
cmake/ChibiOS16_LD.cmake

@@ -0,0 +1,38 @@
+IF(NOT CHIBIOS_PROCESS_STACK_SIZE)
+ SET(CHIBIOS_PROCESS_STACK_SIZE 0x400)
+ MESSAGE(STATUS "No CHIBIOS_PROCESS_STACK_SIZE specified, using default: ${CHIBIOS_PROCESS_STACK_SIZE}")
+ENDIF()
+
+IF(NOT CHIBIOS_MAIN_STACK_SIZE)
+ SET(CHIBIOS_MAIN_STACK_SIZE 0x400)
+ MESSAGE(STATUS "No CHIBIOS_MAIN_STACK_SIZE specified, using default: ${CHIBIOS_MAIN_STACK_SIZE}")
+ENDIF()
+
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L\"${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC\"")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__process_stack_size__=${CHIBIOS_PROCESS_STACK_SIZE}")
+SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--defsym=__main_stack_size__=${CHIBIOS_MAIN_STACK_SIZE}")
+
+# Auto-generate linker script
+IF(NOT ChibiOS_LINKER_SCRIPT)
+   FILE(WRITE ${CMAKE_BINARY_DIR}/chibios_link.ld.in
+     "MEMORY\n"
+     "{\n"
+     "  flash : org = 0x08000000, len = \${STM32_FLASH_SIZE}\n"
+     "  ram0 : org = 0x20000000, len = \${STM32_RAM_SIZE}\n"
+     "  ram1 : org = 0x00000000, len = 0\n"
+     "  ram2 : org = 0x00000000, len = 0\n"
+     "  ram3 : org = 0x00000000, len = 0\n"
+     "  ram4 : org = \${STM32_CCRAM_ORIGIN}, len = \${STM32_CCRAM_SIZE}\n"
+     "  ram5 : org = 0x00000000, len = 0\n"
+     "  ram6 : org = 0x00000000, len = 0\n"
+     "  ram7 : org = 0x00000000, len = 0\n"
+     "}\n"
+     "REGION_ALIAS(\"MAIN_STACK_RAM\", ram0);\n"
+     "REGION_ALIAS(\"PROCESS_STACK_RAM\", ram0);\n"
+     "REGION_ALIAS(\"DATA_RAM\", ram0);\n"
+     "REGION_ALIAS(\"BSS_RAM\", ram0);\n"
+     "REGION_ALIAS(\"HEAP_RAM\", ram0);\n"
+     "INCLUDE rules.ld\n"
+   )
+   SET(ChibiOS_LINKER_SCRIPT ${CMAKE_BINARY_DIR}/chibios_link.ld.in)
+ENDIF()

+ 57 - 0
cmake/ChibiOS16_NIL.cmake

@@ -0,0 +1,57 @@
+SET(CHIBIOS_nil_SEARCH_PATH 
+  ${CHIBIOS_ROOT}/os/nil/src
+  ${CHIBIOS_ROOT}/os/nil/include
+  ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx
+  ${CHIBIOS_ROOT}/os/nil/ports/ARMCMx/compilers/GCC
+  ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC
+  ${CHIBIOS_ROOT}/os/nil/src
+)
+SET(CHIBIOS_nil_SEARCH_HEADERS
+  nil.h
+  nilcore.h
+  niltypes.h
+)
+SET(CHIBIOS_nil_SOURCES  
+  crt1.c
+  vectors.c
+  nilcore.c
+  nil.c
+)
+
+IF(STM32_FAMILY STREQUAL "F0")
+  SET(CHIBIOS_nil_SOURCES  ${CHIBIOS_nil_SOURCES} crt0_v6m.s nilcore_v6m.c nilcoreasm_v6m.s)
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH
+    ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F0xx/
+  )
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS
+    core_cm0.h
+    stm32f0xx.h
+    cmparams.h
+  )
+ELSEIF(STM32_FAMILY STREQUAL "F1")
+  SET(CHIBIOS_nil_SOURCES  ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s)
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH
+    ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F1xx/
+  )
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS
+    core_cm3.h
+    stm32f1xx.h
+    cmparams.h
+  )
+ELSEIF(STM32_FAMILY STREQUAL "F4")
+  SET(CHIBIOS_nil_SOURCES  ${CHIBIOS_nil_SOURCES} crt0_v7m.s nilcore_v7m.c nilcoreasm_v7m.s)
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_PATH
+    ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F4xx/
+  )
+  SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS
+    core_cm4.h
+    stm32f4xx.h
+    cmparams.h
+  )
+ENDIF()

+ 77 - 0
cmake/ChibiOS16_RT.cmake

@@ -0,0 +1,77 @@
+SET(CHIBIOS_rt_SEARCH_PATH
+  ${CHIBIOS_ROOT}/os/rt/src
+  ${CHIBIOS_ROOT}/os/rt/include
+  ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx
+  ${CHIBIOS_ROOT}/os/rt/ports/ARMCMx/compilers/GCC
+  ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/compilers/GCC
+  ${CHIBIOS_ROOT}/os/rt/src
+)
+
+SET(CHIBIOS_rt_SEARCH_HEADERS
+  ch.h
+  chcore.h
+  chtypes.h
+)
+
+SET(CHIBIOS_rt_SOURCES
+  crt1.c
+  vectors.c
+  chcore.c
+  chsys.c
+  chdebug.c
+  chvt.c
+  chschd.c
+  chthreads.c
+  chtm.c
+  chstats.c
+  chdynamic.c
+  chregistry.c
+  chsem.c
+  chmtx.c
+  chcond.c
+  chevents.c
+  chmsg.c
+  chmboxes.c
+  chqueues.c
+  chmemcore.c
+  chheap.c
+  chmempools.c
+)
+
+IF(STM32_FAMILY STREQUAL "F0")
+  SET(CHIBIOS_rt_SOURCES  ${CHIBIOS_rt_SOURCES} crt0_v6m.s chcore_v6m.c chcoreasm_v6m.s)
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH
+          ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F0xx
+          ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+          ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F0xx/
+          )
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS
+          core_cm0.h
+          stm32f0xx.h
+          cmparams.h
+          )
+ELSEIF(STM32_FAMILY STREQUAL "F1")
+  SET(CHIBIOS_rt_SOURCES  ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s)
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH
+    ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F1xx
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F1xx/
+  )
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS
+    core_cm3.h
+    stm32f1xx.h
+    cmparams.h
+  )
+ELSEIF(STM32_FAMILY STREQUAL "F4")
+  SET(CHIBIOS_rt_SOURCES  ${CHIBIOS_rt_SOURCES} crt0_v7m.s chcore_v7m.c chcoreasm_v7m.s)
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_PATH
+    ${CHIBIOS_ROOT}/os/common/ports/ARMCMx/devices/STM32F4xx
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/include
+    ${CHIBIOS_ROOT}/os/ext/CMSIS/ST/STM32F4xx/
+  )
+  SET(CHIBIOS_rt_PLATFORM_SEARCH_HEADERS
+    core_cm4.h
+    stm32f4xx.h
+    cmparams.h
+  )
+ENDIF()

+ 12 - 0
cmake/ChibiOS16_Various.cmake

@@ -0,0 +1,12 @@
+SET(CHIBIOS_VARIOUS_MODULES evtimer shell syscalls)
+
+SET(CHIBIOS_evtimer_SEARCH_PATH ${CHIBIOS_ROOT}/os/various)
+SET(CHIBIOS_evtimer_SOURCES evtimer.c)
+SET(CHIBIOS_evtimer_SEARCH_HEADERS evtimer.h)
+
+SET(CHIBIOS_shell_SEARCH_PATH ${CHIBIOS_ROOT}/os/various)
+SET(CHIBIOS_shell_SOURCES shell.c)
+SET(CHIBIOS_shell_SEARCH_HEADERS shell.h)
+
+SET(CHIBIOS_syscalls_SEARCH_PATH ${CHIBIOS_ROOT}/os/various)
+SET(CHIBIOS_syscalls_SOURCES syscalls.c)

+ 2 - 2
cmake/ChibiOS3_NIL.cmake

@@ -26,8 +26,8 @@ IF(STM32_FAMILY STREQUAL "F0")
     ${CHIBIOS_ROOT}/os/ext/CMSIS/ST
   )
   SET(CHIBIOS_nil_PLATFORM_SEARCH_HEADERS
-    core_cm3.h
-    stm32f10x.h
+    core_cm0.h
+    stm32f0xx.h
     cmparams.h
   )
 ELSEIF(STM32_FAMILY STREQUAL "F1")

+ 8 - 1
cmake/FindChibiOS.cmake

@@ -3,8 +3,13 @@ IF(NOT CHIBIOS_ROOT)
     MESSAGE(STATUS "No CHIBIOS_ROOT specified, using default: ${CHIBIOS_ROOT}")
 ENDIF()
 
+
+MESSAGE(STATUS "Chibios version:" ${ChibiOS_FIND_VERSION_MAJOR})
+
 IF(ChibiOS_FIND_VERSION_MAJOR EQUAL 2)
   MESSAGE(FATAL_ERROR "ChibiOS v2.x.x is not supported. Use older version of stm32-cmake")
+ELSEIF((ChibiOS_FIND_VERSION_MAJOR EQUAL 16))
+  INCLUDE(ChibiOS16)
 ELSEIF((NOT ChibiOS_FIND_VERSION_MAJOR) OR (ChibiOS_FIND_VERSION_MAJOR EQUAL 3))
   INCLUDE(ChibiOS3)
 ENDIF()
@@ -13,4 +18,6 @@ LIST(REMOVE_DUPLICATES ChibiOS_INCLUDE_DIRS)
 LIST(REMOVE_DUPLICATES ChibiOS_SOURCES)
 
 INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ChibiOS DEFAULT_MSG ChibiOS_SOURCES ChibiOS_INCLUDE_DIRS ChibiOS_LINKER_SCRIPT)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(ChibiOS DEFAULT_MSG ChibiOS_SOURCES ChibiOS_INCLUDE_DIRS ChibiOS_LINKER_SCRIPT)
+
+

+ 2 - 2
stm32-chibios-template/chibios-nil-f4-template/CMakeLists.txt

@@ -8,9 +8,9 @@ project(chibios-nil-f4-template)
 ENABLE_LANGUAGE(ASM)
 
 # test build all available ChibiOS COMPONENTS for F4 chip
-#FIND_PACKAGE(ChibiOS COMPONENTS nil hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb memstreams nullstreams REQUIRED)
+FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb memstreams nullstreams REQUIRED)
 
-FIND_PACKAGE(ChibiOS COMPONENTS nil hal pal  REQUIRED)
+#FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal pal  REQUIRED)
 
 INCLUDE_DIRECTORIES(
         ${CMAKE_CURRENT_SOURCE_DIR}

+ 338 - 0
stm32-chibios-template/chibios-rt-f0-template/.idea/chibios-rt-f0-template.iml

@@ -0,0 +1,338 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="CPP_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/compilers/GCC/crt1.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/compilers/GCC/crt1.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/compilers/GCC/vectors.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/compilers/GCC/vectors.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/chprintf.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/chprintf.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/memstreams.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/memstreams.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/nullstreams.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/nullstreams.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/osal/rt/osal.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/osal/rt/osal.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/ADCv1/adc_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/ADCv1/adc_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/CANv1/can_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/CANv1/can_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DACv1/dac_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DACv1/dac_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/EXTIv1/ext_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/EXTIv1/ext_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/MACv1/mac_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/MACv1/mac_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SDMMCv1/sdc_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SDMMCv1/sdc_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv2/spi_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv2/spi_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/pwm_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/pwm_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/serial_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/serial_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USBv1/usb_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USBv1/usb_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/ext_lld_isr.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/ext_lld_isr.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/hal_lld.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/hal_lld.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/common/ARMCMx/nvic.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/common/ARMCMx/nvic.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/adc.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/adc.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/can.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/can.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/dac.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/dac.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/ext.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/ext.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/gpt.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/gpt.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/hal.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/hal.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/hal_queues.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/hal_queues.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/i2c.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/i2c.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/i2s.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/i2s.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/icu.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/icu.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/mac.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/mac.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/mmc_spi.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/mmc_spi.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/pal.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/pal.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/pwm.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/pwm.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/rtc.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/rtc.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/sdc.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/sdc.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/serial.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/serial.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/serial_usb.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/serial_usb.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/spi.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/spi.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/st.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/st.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/uart.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/uart.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/usb.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/src/usb.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore_v6m.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore_v6m.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chcond.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chcond.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chdebug.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chdebug.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chdynamic.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chdynamic.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chevents.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chevents.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chheap.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chheap.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmboxes.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmboxes.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmemcore.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmemcore.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmempools.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmempools.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmsg.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmsg.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmtx.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chmtx.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chqueues.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chqueues.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chregistry.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chregistry.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chschd.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chschd.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chsem.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chsem.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chstats.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chstats.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chsys.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chsys.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chthreads.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chthreads.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chtm.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chtm.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chvt.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/src/chvt.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/evtimer.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/evtimer.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/shell.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/shell.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/syscalls.c">
+      <sourceFolder url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/syscalls.c" isTestSource="false" />
+    </content>
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/work/test.c" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/work/test.h" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/CMakeLists.txt" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/main.c" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/config/chconf.h" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/config/halconf.h" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/config/mcuconf.h" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/board/board.c" isTestSource="false" />
+      <sourceFolder url="file://$MODULE_DIR$/board/board.h" isTestSource="false" />
+    </content>
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module-library">
+      <library name="Header Search Paths">
+        <CLASSES>
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/ext/CMSIS/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/ext/CMSIS/ST/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/common/ARMCMx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/GPIOv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DACv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DMAv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/CANv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/ADCv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/RTCv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/I2Cv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/EXTIv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USBv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SDMMCv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/MACv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/osal/rt" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/devices/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/arm-none-eabi/include" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/lib/gcc/arm-none-eabi/5.2.1/include" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/lib/gcc/arm-none-eabi/5.2.1/include-fixed" />
+        </CLASSES>
+        <SOURCES>
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/ext/CMSIS/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/ext/CMSIS/ST/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/common/ARMCMx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/GPIOv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DACv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DMAv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/CANv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/ADCv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/RTCv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/I2Cv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/EXTIv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USBv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SDMMCv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/MACv1" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/osal/rt" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/include" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/common/ports/ARMCMx/devices/STM32F0xx" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/arm-none-eabi/include" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/lib/gcc/arm-none-eabi/5.2.1/include" />
+          <root url="file://$MODULE_DIR$/../../../gcc-arm-none-eabi-5_2-2015q4/lib/gcc/arm-none-eabi/5.2.1/include-fixed" />
+        </SOURCES>
+        <excluded>
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/nullstreams.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/memstreams.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/lib/streams/chprintf.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/common/ARMCMx/nvic.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/hal_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/STM32F0xx/ext_lld_isr.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/GPIOv2/pal_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DACv1/dac_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/DMAv1/stm32_dma.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/CANv1/can_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv2/spi_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SPIv1/i2s_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/ADCv1/adc_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/RTCv2/rtc_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/I2Cv2/i2c_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/EXTIv1/ext_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/gpt_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/st_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/icu_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/TIMv1/pwm_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USBv1/usb_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/SDMMCv1/sdc_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/serial_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/USARTv2/uart_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/ports/STM32/LLD/MACv1/mac_lld.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/hal/osal/rt/osal.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore_v6m.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/rt/ports/ARMCMx/chcore.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/evtimer.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/syscalls.c" />
+          <root url="file://$MODULE_DIR$/../../../ChibiOS_16.1.2/os/various/shell.c" />
+        </excluded>
+      </library>
+    </orderEntry>
+  </component>
+</module>

+ 6 - 0
stm32-chibios-template/chibios-rt-f0-template/.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 19 - 0
stm32-chibios-template/chibios-rt-f0-template/.idea/misc.xml

@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
+  <component name="CidrRootsConfiguration">
+    <sourceRoots />
+    <libraryRoots />
+    <excludeRoots />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+</project>

+ 8 - 0
stm32-chibios-template/chibios-rt-f0-template/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/chibios-rt-f0-template.iml" filepath="$PROJECT_DIR$/.idea/chibios-rt-f0-template.iml" />
+    </modules>
+  </component>
+</project>

+ 178 - 0
stm32-chibios-template/chibios-rt-f0-template/.idea/workspace.xml

@@ -0,0 +1,178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CMakeRunConfigurationManager" shouldGenerate="true" assignedExecutableTargets="true" buildAllGenerated="true">
+    <generated>
+      <config projectName="chibios-rt-f0-template" targetName="chibios-rt-f0-template.elf" />
+      <config projectName="chibios-rt-f0-template" targetName="chibios-rt-f0-template.elf.hex" />
+      <config projectName="chibios-rt-f0-template" targetName="chibios-rt-f0-template.elf.bin" />
+    </generated>
+  </component>
+  <component name="CMakeSettings" AUTO_RELOAD="false" GENERATION_OPTIONS="-DTOOLCHAIN_PREFIX=/Users/nova/STM32/tools/gcc-arm-none-eabi-5_2-2015q4 -DCHIBIOS_ROOT=/Users/nova/STM32/tools/ChibiOS_16.1.2 -DCMAKE_MODULE_PATH=/Users/nova/STM32/tools/stm32-cmake/cmake -DCMAKE_TOOLCHAIN_FILE=/Users/nova/STM32/tools/stm32-cmake/cmake/gcc_stm32.cmake -DCMAKE_BUILD_TYPE=Debug" GENERATION_PASS_SYSTEM_ENVIRONMENT="true">
+    <ADDITIONAL_GENERATION_ENVIRONMENT>
+      <envs />
+    </ADDITIONAL_GENERATION_ENVIRONMENT>
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="95cd25a2-1418-45e6-9c9b-cd4486e5173b" name="Default" comment="" />
+    <ignored path="chibios-rt-f0-template.iws" />
+    <ignored path=".idea/workspace.xml" />
+    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
+    <option name="TRACKING_ENABLED" value="true" />
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
+  <component name="CreatePatchCommitExecutor">
+    <option name="PATCH_PATH" value="" />
+  </component>
+  <component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
+  <component name="FavoritesManager">
+    <favorites_list name="chibios-rt-f0-template" />
+  </component>
+  <component name="JsBuildToolGruntFileManager" detection-done="true" />
+  <component name="JsBuildToolPackageJson" detection-done="true" />
+  <component name="JsGulpfileManager">
+    <detection-done>true</detection-done>
+  </component>
+  <component name="ProjectFrameBounds">
+    <option name="x" value="1032" />
+    <option name="y" value="23" />
+    <option name="width" value="1528" />
+    <option name="height" value="1023" />
+  </component>
+  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
+    <OptionsSetting value="true" id="Add" />
+    <OptionsSetting value="true" id="Remove" />
+    <OptionsSetting value="true" id="Checkout" />
+    <OptionsSetting value="true" id="Update" />
+    <OptionsSetting value="true" id="Status" />
+    <OptionsSetting value="true" id="Edit" />
+    <ConfirmationsSetting value="0" id="Add" />
+    <ConfirmationsSetting value="0" id="Remove" />
+  </component>
+  <component name="ProjectView">
+    <navigator currentView="ProjectPane" proportions="" version="1">
+      <flattenPackages />
+      <showMembers />
+      <showModules />
+      <showLibraryContents />
+      <hideEmptyPackages />
+      <abbreviatePackageNames />
+      <autoscrollToSource />
+      <autoscrollFromSource />
+      <sortByType />
+      <manualOrder />
+      <foldersAlwaysOnTop value="true" />
+    </navigator>
+    <panes>
+      <pane id="ProjectPane">
+        <subPane>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chibios-rt-f0-template" />
+              <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
+            </PATH_ELEMENT>
+          </PATH>
+          <PATH>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chibios-rt-f0-template" />
+              <option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
+            </PATH_ELEMENT>
+            <PATH_ELEMENT>
+              <option name="myItemId" value="chibios-rt-f0-template" />
+              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewModuleNode" />
+            </PATH_ELEMENT>
+          </PATH>
+        </subPane>
+      </pane>
+    </panes>
+  </component>
+  <component name="PropertiesComponent">
+    <property name="settings.editor.selected.configurable" value="CMakeSettings" />
+    <property name="settings.editor.splitter.proportion" value="0.2" />
+    <property name="WebServerToolWindowFactoryState" value="false" />
+  </component>
+  <component name="RunManager" selected="Application.Build All">
+    <configuration default="true" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="chibios-rt-f0-template" TARGET_NAME="chibios-rt-f0-template.elf" CONFIG_NAME="Debug">
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="false" name="Build All" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" CONFIG_NAME="Debug" EXPLICIT_BUILD_TARGET_NAME="all">
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="false" name="chibios-rt-f0-template.elf" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="chibios-rt-f0-template" TARGET_NAME="chibios-rt-f0-template.elf" CONFIG_NAME="Debug" RUN_TARGET_PROJECT_NAME="chibios-rt-f0-template" RUN_TARGET_NAME="chibios-rt-f0-template.elf">
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="false" name="chibios-rt-f0-template.elf.bin" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="chibios-rt-f0-template" TARGET_NAME="chibios-rt-f0-template.elf.bin" CONFIG_NAME="Debug">
+      <envs />
+      <method />
+    </configuration>
+    <configuration default="false" name="chibios-rt-f0-template.elf.hex" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="chibios-rt-f0-template" TARGET_NAME="chibios-rt-f0-template.elf.hex" CONFIG_NAME="Debug">
+      <envs />
+      <method />
+    </configuration>
+    <list size="4">
+      <item index="0" class="java.lang.String" itemvalue="Application.Build All" />
+      <item index="1" class="java.lang.String" itemvalue="Application.chibios-rt-f0-template.elf" />
+      <item index="2" class="java.lang.String" itemvalue="Application.chibios-rt-f0-template.elf.bin" />
+      <item index="3" class="java.lang.String" itemvalue="Application.chibios-rt-f0-template.elf.hex" />
+    </list>
+  </component>
+  <component name="ShelveChangesManager" show_recycled="false">
+    <option name="remove_strategy" value="false" />
+  </component>
+  <component name="SvnConfiguration">
+    <configuration />
+  </component>
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="95cd25a2-1418-45e6-9c9b-cd4486e5173b" name="Default" comment="" />
+      <created>1454253712955</created>
+      <option name="number" value="Default" />
+      <updated>1454253712955</updated>
+    </task>
+    <servers />
+  </component>
+  <component name="ToolWindowManager">
+    <frame x="1032" y="23" width="1528" height="1023" extended-state="0" />
+    <editor active="false" />
+    <layout>
+      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.24950232" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
+      <window_info id="CMake" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.32975295" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
+      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
+      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
+      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
+      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
+      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
+      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
+      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
+      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
+    </layout>
+  </component>
+  <component name="Vcs.Log.UiProperties">
+    <option name="RECENTLY_FILTERED_USER_GROUPS">
+      <collection />
+    </option>
+    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
+      <collection />
+    </option>
+  </component>
+  <component name="VcsContentAnnotationSettings">
+    <option name="myLimit" value="2678400000" />
+  </component>
+  <component name="XDebuggerManager">
+    <breakpoint-manager />
+    <watches-manager />
+  </component>
+</project>

+ 2 - 2
stm32-chibios-template/chibios-rt-f0-template/CMakeLists.txt

@@ -8,9 +8,9 @@ project(chibios-rt-f0-template)
 ENABLE_LANGUAGE(ASM)
 
 # test build all available ChibiOS COMPONENTS for F4 chip
-#FIND_PACKAGE(ChibiOS COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
+FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
 
-FIND_PACKAGE(ChibiOS COMPONENTS rt hal pal  REQUIRED)
+#FIND_PACKAGE(ChibiOS 16  COMPONENTS rt hal pal  REQUIRED)
 
 INCLUDE_DIRECTORIES(
         ${CMAKE_CURRENT_SOURCE_DIR}

+ 2 - 2
stm32-chibios-template/chibios-rt-f1-template/CMakeLists.txt

@@ -8,9 +8,9 @@ project(chibios-rt-f1-template)
 ENABLE_LANGUAGE(ASM)
 
 # test build all available ChibiOS COMPONENTS for F4 chip
-#FIND_PACKAGE(ChibiOS COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
+FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc dac can dac ext gpt i2c i2s icu mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
 
-FIND_PACKAGE(ChibiOS COMPONENTS rt hal pal  REQUIRED)
+#FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal pal  REQUIRED)
 
 INCLUDE_DIRECTORIES(
         ${CMAKE_CURRENT_SOURCE_DIR}

+ 2 - 2
stm32-chibios-template/chibios-rt-f4-template/CMakeLists.txt

@@ -8,9 +8,9 @@ project(chibios-rt-f4-template)
 ENABLE_LANGUAGE(ASM)
 
 # test build all available ChibiOS COMPONENTS for F4 chip
-#FIND_PACKAGE(ChibiOS COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
+FIND_PACKAGE(ChibiOS 16 COMPONENTS rt hal adc can dac ext gpt i2c i2s icu mac mmc_spi pal pwm rtc sdc serial serial_usb spi st uart usb chprintf memstreams nullstreams evtimer shell syscalls REQUIRED)
 
-FIND_PACKAGE(ChibiOS COMPONENTS rt hal pal  REQUIRED)
+#FIND_PACKAGE(ChibiOS COMPONENTS rt hal pal  REQUIRED)
 
 INCLUDE_DIRECTORIES(
         ${CMAKE_CURRENT_SOURCE_DIR}

+ 2 - 0
stm32-chibios/CMakeLists.txt

@@ -4,6 +4,8 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
 ENABLE_LANGUAGE(ASM)
 
 FIND_PACKAGE(ChibiOS COMPONENTS nil hal pal serial REQUIRED)
+# For use ChibiOS v16.x.x use this string
+#FIND_PACKAGE(ChibiOS 16 COMPONENTS nil hal pal serial REQUIRED)
 
 INCLUDE_DIRECTORIES(
     ${CMAKE_CURRENT_SOURCE_DIR}