1
0
Эх сурвалжийг харах

Merge branch 'master' into linkage

Alexander Voronov 6 жил өмнө
parent
commit
83519f9ae4
5 өөрчлөгдсөн 156 нэмэгдсэн , 6 устгасан
  1. 58 0
      .travis.yml
  2. 8 5
      Makefile
  3. 87 0
      demo/stm32f373xc.ld
  4. 1 1
      inc/usb_dfu.h
  5. 2 0
      readme.md

+ 58 - 0
.travis.yml

@@ -0,0 +1,58 @@
+
+language: c
+
+matrix:
+  include:
+    - os: linux
+      install:
+      - export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-linux.tar.bz2?revision=c34d758a-be0c-476e-a2de-af8c6e16a8a2?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Linux,8-2019-q3-update
+      - pushd $HOME
+      - mkdir arm-gcc-toolchain
+      - wget -O $HOME/arm-gcc-toolchain/gcc.tar.bz2 $GCC_URL
+      - cd arm-gcc-toolchain
+      - tar -jxf gcc.tar.bz2 --strip=1
+      - export PATH=$HOME/arm-gcc-toolchain/bin:$PATH
+      - export GMAKE=make
+      - popd
+
+    - os: windows
+      install:
+      - export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-win32.zip?revision=2f0fd855-d015-423c-9c76-c953ae7e730b?product=GNU%20Arm%20Embedded%20Toolchain,ZIP,,Windows,8-2019-q3-update
+      - pushd $HOME
+      - mkdir arm-gcc-toolchain
+      - wget --no-check-certificate -O arm-gcc.zip $GCC_URL
+      - 7z x arm-gcc.zip -oarm-gcc-toolchain -r -y
+      - export PATH=$HOME/arm-gcc-toolchain/bin:$PATH
+      - export GMAKE="mingw32-make SHELL=cmd"
+      - popd
+
+    - os: osx
+      install:
+      - export GCC_URL=https://developer.arm.com/-/media/Files/downloads/gnu-rm/8-2019q3/RC1.1/gcc-arm-none-eabi-8-2019-q3-update-mac.tar.bz2?revision=6a06dd2b-bb98-4708-adac-f4c630c33f4f?product=GNU%20Arm%20Embedded%20Toolchain,64-bit,,Mac%20OS%20X,8-2019-q3-update
+      - pushd $HOME
+      - mkdir arm-gcc-toolchain
+      - wget -O ./arm-gcc-toolchain/gcc.tar.bz2 $GCC_URL
+      - cd arm-gcc-toolchain
+      - tar -jxf gcc.tar.bz2 --strip=1
+      - export PATH=$HOME/arm-gcc-toolchain/bin:$PATH
+      - export GMAKE=make
+      - popd
+
+before_script:
+  - $GMAKE -v
+  - arm-none-eabi-gcc --version
+
+script:
+  - $GMAKE cmsis
+  - $GMAKE stm32f103x6
+  - $GMAKE stm32f303xe
+  - $GMAKE stm32f105xb
+  - $GMAKE stm32l052x8
+  - $GMAKE stm32l100xc
+  - $GMAKE stm32l476xg
+  - $GMAKE stm32f429xi
+  - $GMAKE stm32l433cc
+  - $GMAKE stm32f070xb
+  - $GMAKE stm32g431xb
+  - $GMAKE stm32f446xc
+  - $GMAKE stm32f373xc

+ 8 - 5
Makefile

@@ -72,10 +72,13 @@ 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
+cmsis: $(CMSISDEV)/ST
+
+$(CMSISDEV)/ST: $(CMSIS)
+	@git clone --recurse-submodules --depth 1 https://github.com/dmitrystu/stm32h.git $@
+
+$(CMSIS):
+	@git clone --depth 1 https://github.com/ARM-software/CMSIS_5.git $@
 
 $(OBJDIR):
 	@mkdir $@
@@ -128,7 +131,7 @@ $(OBJDIR)/%.o: %.s
 	@echo assembling $<
 	@$(CC) $(CFLAGS2) $(addprefix -D, $(DEFINES)) $(addprefix -I, $(INCLUDES)) -c $< -o $@
 
-.PHONY: module doc demo clean program help all program_stcube
+.PHONY: module doc demo clean program help all program_stcube cmsis
 
 stm32f103x6 bluepill: clean
 	@$(MAKE) demo STARTUP='$(CMSISDEV)/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103x6.s' \

+ 87 - 0
demo/stm32f373xc.ld

@@ -0,0 +1,87 @@
+ENTRY(Reset_Handler)
+MEMORY
+{
+    ROM   (rx): ORIGIN = 0x08000000, LENGTH = 256K
+    RAM  (rwx): ORIGIN = 0x20000000, LENGTH = 32K
+}
+SECTIONS
+{
+    .text :
+    {
+        KEEP(*(.isr_vector))
+        *(.text*)
+        KEEP(*(.init))  KEEP(*(.fini))
+        *crtbegin.o(.ctors)
+        *crtbegin?.o(.ctors)
+        *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors)
+        *(SORT(.ctors.*))
+        *(.ctors)
+        *crtbegin.o(.dtors)
+        *crtbegin?.o(.dtors)
+        *(EXCLUDE_FILE(*crtend?.o *crtend.o).dtors)
+        *(SORT(.dtors.*))
+        *(.dtors)
+        *(.rodata*)
+        KEEP(*(.eh_frame*))
+    } > ROM
+    .ARM.extab :
+    {
+        *(.ARM.extab* .gnu.linkonce.armextab.*)
+    } > ROM
+    __exidx_start = .;
+    .ARM.exidx :
+    {
+        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
+    } > ROM
+    __exidx_end = .;
+    __etext = .;
+    .data : AT (__etext)
+    {
+        __data_start__ = .;
+        *(vtable)
+        *(.data*)
+        . = ALIGN(4);
+        PROVIDE_HIDDEN (__preinit_array_start = .);
+        KEEP(*(.preinit_array))
+        PROVIDE_HIDDEN (__preinit_array_end = .);
+        . = ALIGN(4);
+        PROVIDE_HIDDEN (__init_array_start = .);
+        KEEP(*(SORT(.init_array.*)))
+        KEEP(*(.init_array))
+        PROVIDE_HIDDEN (__init_array_end = .);
+        . = ALIGN(4);
+        PROVIDE_HIDDEN (__fini_array_start = .);
+        KEEP(*(SORT(.fini_array.*)))
+        KEEP(*(.fini_array))
+        PROVIDE_HIDDEN (__fini_array_end = .);
+        . = ALIGN(4);
+        __data_end__ = .;
+    } > RAM
+    .bss (NOLOAD) :
+    {
+        __bss_start__ = .;
+        *(.bss*)
+        *(COMMON)
+        __bss_end__ = .;
+    } > RAM
+    .heap (NOLOAD) :
+    {
+        __end__ = .;
+        *(.heap*)
+        __HeapLimit = .;
+    } > RAM
+    .stack_dummy (NOLOAD) :
+    {
+        *(.stack)
+    } > RAM
+    __StackTop = ORIGIN(RAM) + LENGTH(RAM);
+    __StackLimit = __StackTop - SIZEOF(.stack_dummy);
+    PROVIDE(__stack = __StackTop);
+    ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
+    PROVIDE(_estack = __stack);
+    PROVIDE(_sidata = __etext);
+    PROVIDE(_sdata = __data_start__);
+    PROVIDE(_edata = __data_end__);
+    PROVIDE(_sbss = __bss_start__);
+    PROVIDE(_ebss = __bss_end__);
+}

+ 1 - 1
inc/usb_dfu.h

@@ -47,7 +47,7 @@
                                                  * solicit firmware from the device.*/
 #define USB_DFU_GETSTATUS               0x03    /**<\brief The host employs this request to facilitate
                                                  * synchronization with the device.*/
-#define USB_DFU_CLRSTATAUS              0x04    /**<\brief This request resets DFU machine state to
+#define USB_DFU_CLRSTATUS               0x04    /**<\brief This request resets DFU machine state to
                                                  * DFU_IDLE.*/
 #define USB_DFU_GETSTATE                0x05    /**<\brief This request solicits a report about the
                                                  * state of the device.*/

+ 2 - 0
readme.md

@@ -1,3 +1,5 @@
+![Travis (.org) branch](https://img.shields.io/travis/dmitrystu/libusb_stm32/master?logo=travis)
+
 ### Lightweight USB Device Stack ###
 
 + Lightweight and fast