Explorar el Código

Merge pull request #61 from a-v-v/make-cmsis

Makefile rule for downloading requirements
Dmitry Filimonchuk hace 6 años
padre
commit
1b38350fc2
Se han modificado 2 ficheros con 11 adiciones y 3 borrados
  1. 8 2
      Makefile
  2. 3 1
      readme.md

+ 8 - 2
Makefile

@@ -1,4 +1,4 @@
-CMSIS       ?=../../CMSIS
+CMSIS       ?= CMSIS
 CMSISDEV    ?= $(CMSIS)/Device
 CMSISCORE   ?= $(CMSIS)/CMSIS/Include $(CMSIS)/CMSIS/Core/Include
 FLASH       ?= st-flash
@@ -53,6 +53,7 @@ help all:
 	@echo '  stm32l052x8   CDC loopback demo for STM32L052x8 based boards'
 	@echo '  32f429zi-nucleo'
 	@echo '  stm32f429xi   CDC loopback demo for STM32F429xI based boards'
+	@echo '  cmsis         Download CMSIS 5 and stm32.h into a $$(CMSIS) directory'
 	@echo '  doc           DOXYGEN documentation'
 	@echo '  module        static library module using following envars (defaults)'
 	@echo '                MODULE  module name ($(MODULE))'
@@ -71,6 +72,11 @@ help all:
 	@echo '  make bluepill program'
 	@echo '  make module MODULE="usbd.a" CFLAGS="-mcpu=cotrex-m4" DEFINES="STM32L4 STM32L476xx USBD_VBUS_DETECT"'
 
+.PHONY: cmsis
+cmsis:
+	@git clone --depth 1 https://github.com/ARM-software/CMSIS_5.git $(CMSIS)
+	@git clone --recurse-submodules --depth 1 https://github.com/dmitrystu/stm32h.git $(CMSISDEV)/ST
+
 $(OBJDIR):
 	@mkdir $@
 
@@ -207,4 +213,4 @@ stm32f373xc: clean
 	@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F3xx/Source/Templates/gcc/startup_stm32f373xc.s' \
 						LDSCRIPT='demo/stm32f373xc.ld' \
 						DEFINES='STM32F3 STM32F373xC USBD_SOF_DISABLED USBD_ASM_DRIVER' \
-						CFLAGS='-mcpu=cortex-m4'
+						CFLAGS='-mcpu=cortex-m4'

+ 3 - 1
readme.md

@@ -8,9 +8,11 @@
 ### Requirements ###
 
 + [CMSIS V4](https://github.com/ARM-software/CMSIS) or [CMSIS V5](https://github.com/ARM-software/CMSIS_5).
-+ Device peripheral access layer header files for STM32. See [Vendor Template](https://github.com/ARM-software/CMSIS/tree/master/Device/_Template_Vendor) for details.
 + [stm32.h](https://github.com/dmitrystu/stm32h) STM32 universal header
 
+All requirements can be downloaded into a directory specified in environment variable `CMSIS` using
+`make cmsis` command.
+
 ### Supported hardware ###
 
 <table>