From 31aa77a85b1d985e500d047ef49d1ab459298511 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 12:35:17 +0700 Subject: add lpc55 to ci --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ec29686a..77903d65e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,6 +37,7 @@ jobs: family: # Alphabetical order - 'imxrt' + - 'lpc55' - 'nrf' - 'rp2040' - 'samd11' -- cgit v1.3.1 From c222f6f1119667f69da4d45df110da5b5cda5427 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 20:25:55 +0700 Subject: try to fetch needed mcu submodule while running make --- .github/workflows/build.yml | 7 ++++--- examples/make.mk | 23 +++++++++++------------ examples/rules.mk | 7 +++++++ hw/bsp/imxrt/family.mk | 1 + hw/bsp/nrf/family.mk | 1 + 5 files changed, 24 insertions(+), 15 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 77903d65e..635884674 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -62,13 +62,14 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 with: - submodules: 'true' + submodules: 'false' - name: Checkout Sub-Submodules run: | + # Clone all submodules in lib + git submodule update --init --recursive lib # some submodule has it own submodules that need to be fetched as well - git submodule update --init --recursive hw/mcu/microchip - git submodule update --init --recursive lib/FreeRTOS + #git submodule update --init --recursive hw/mcu/microchip - name: Build run: python3 tools/build_family.py ${{ matrix.family }} diff --git a/examples/make.mk b/examples/make.mk index 5387a4ec4..c981d0de4 100644 --- a/examples/make.mk +++ b/examples/make.mk @@ -15,20 +15,8 @@ check_defined = \ __check_defined = \ $(if $(value $1),, \ $(error Undefined make flag: $1$(if $2, ($2)))) - -# TODO Check if submodule haven't checkout yet -fetch_submodule_if_empty = \ - ifeq ($(wildcard $(TOP)/$1/*),) \ - $(info $(shell git -C $(TOP) submodule update --init)) \ - endif #-------------- Select the board to build for. ------------ -#BOARD_LIST = $(sort $(subst /.,,$(subst $(TOP)/hw/bsp/,,$(wildcard $(TOP)/hw/bsp/*/.)))) -#ifeq ($(filter $(BOARD),$(BOARD_LIST)),) -# $(info You must provide a BOARD parameter with 'BOARD=', supported boards are:) -# $(foreach b,$(BOARD_LIST),$(info - $(b))) -# $(error Invalid BOARD specified) -#endif # Board without family BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD))) @@ -42,6 +30,7 @@ ifeq ($(BOARD_PATH),) endif ifeq ($(BOARD_PATH),) + $(info You must provide a BOARD parameter with 'BOARD=') $(error Invalid BOARD specified) endif @@ -56,6 +45,16 @@ endif #TODO $(call fetch_submodule_if_empty,lib/sct_neopixel) +# Fetch submodules depended by family +fetch_submodule_if_empty = \ + ifeq ($(wildcard $(TOP)/$1/*),) \ + $(info $(shell git -C $(TOP) submodule update --init $1)) \ + endif + +ifdef FAMILY_SUBMODULES + $(foreach s,$(FAMILY_SUBMODULES),:$(call fetch_submodule_if_empty,$(s))) +endif + #-------------- Cross Compiler ------------ # Can be set by board, default to ARM GCC CROSS_COMPILE ?= arm-none-eabi- diff --git a/examples/rules.mk b/examples/rules.mk index d248ed247..1d5a190fe 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -6,7 +6,9 @@ .DEFAULT_GOAL := all ifeq ($(FAMILY),esp32s2) +# --------------------------------------- # Espressif IDF use CMake build system, this add wrapper target to call idf.py +# --------------------------------------- .PHONY: all clean flash @@ -44,6 +46,9 @@ $(BUILD)/$(PROJECT).uf2: $(BUILD)/$(PROJECT).bin $(PYTHON) $(TOP)/tools/uf2/utils/uf2conv.py -f $(UF2_FAMILY_ID) -b 0x0 -c -o $@ $^ else ifeq ($(FAMILY),rp2040) +# --------------------------------------- +# RP2040 CMake +# --------------------------------------- ifeq ($(DEBUG), 1) CMAKE_DEFSYM += -DCMAKE_BUILD_TYPE=Debug @@ -62,7 +67,9 @@ flash: @$(CP) $(BUILD)/$(PROJECT).uf2 /media/$(USER)/RPI-RP2 else +# --------------------------------------- # GNU Make build system +# --------------------------------------- # libc LIBS += -lgcc -lm -lnosys diff --git a/hw/bsp/imxrt/family.mk b/hw/bsp/imxrt/family.mk index 3311768bd..91298d400 100644 --- a/hw/bsp/imxrt/family.mk +++ b/hw/bsp/imxrt/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x4fb2d5bd +FAMILY_SUBMODULES = hw/mcu/nxp include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/nrf/family.mk b/hw/bsp/nrf/family.mk index c7dff1d0c..16c912dc4 100644 --- a/hw/bsp/nrf/family.mk +++ b/hw/bsp/nrf/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0xADA52840 +FAMILY_SUBMODULES = hw/mcu/nordic/nrfx include $(TOP)/$(BOARD_PATH)/board.mk -- cgit v1.3.1 From 9bc921b3425edd527ba61956b36fe975e8717c24 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 20:48:30 +0700 Subject: update family submodule temporarily disable other orphaned and esp32s2 build --- .github/workflows/build.yml | 104 -------------------------------------------- hw/bsp/lpc55/family.mk | 1 + hw/bsp/rp2040/family.mk | 1 + hw/bsp/samd11/family.mk | 1 + hw/bsp/samd21/family.mk | 1 + hw/bsp/samd51/family.mk | 1 + hw/bsp/stm32f4/family.mk | 1 + hw/bsp/stm32f7/family.mk | 1 + 8 files changed, 7 insertions(+), 104 deletions(-) create mode 100644 hw/bsp/rp2040/family.mk (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 635884674..a927ad4cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,108 +96,4 @@ jobs: asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_content_type: application/zip - # Build all no-family (opharned) boards - build-board: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - example: - # Alphabetical order - - 'device/audio_test' - - 'device/board_test' - - 'device/cdc_dual_ports' - - 'device/cdc_msc' - - 'device/cdc_msc_freertos' - - 'device/dfu_runtime' - - 'device/hid_composite' - - 'device/hid_composite_freertos' - - 'device/hid_generic_inout' - - 'device/hid_multiple_interface' - - 'device/midi_test' - - 'device/msc_dual_lun' - - 'device/net_lwip_webserver' - - 'device/uac2_headset' - - 'device/usbtmc' - - 'device/webusb_serial' - - 'host/cdc_msc_hid' - - steps: - - name: Setup Python - uses: actions/setup-python@v2 - - - name: Setup Node.js - uses: actions/setup-node@v1 - - - name: Checkout TinyUSB - uses: actions/checkout@v2 - with: - submodules: 'true' - - - name: Checkout Sub-Submodules - run: | - # some submodule has it own submodules that need to be fetched as well - git submodule update --init --recursive hw/mcu/microchip - git submodule update --init --recursive lib/FreeRTOS - - # Add msp430-gcc url to env - echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 - - - name: Cache MSP430-GCC - uses: actions/cache@v2 - id: cache-msp430 - with: - path: ~/cache/ - key: ${{ runner.os }}-21-01-26-${{ env.MSP430_GCC_URL }} - - - name: Install MSP430-GCC - if: steps.cache-msp430.outputs.cache-hit != 'true' - run: | - # MSP430 GCC - mkdir -p ~/cache/msp430-gcc - wget --progress=dot:mega $MSP430_GCC_URL -O msp430-gcc.tar.bz2 - tar -C ~/cache/msp430-gcc -xaf msp430-gcc.tar.bz2 - - name: Install Toolchains - run: | - # ARM & RISC-V GCC from xpack - npm install --global xpm - xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest - xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH - - # TI MSP430 GCC - echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin` - - - name: Build - run: python3 tools/build_board.py ${{ matrix.example }} - - # Build ESP32S2 - build-esp32s2: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - board: - # Alphabetical order - - 'adafruit_feather_esp32s2' - - 'adafruit_magtag_29gray' - - 'adafruit_metro_esp32s2' - - 'espressif_kaluga_1' - - 'espressif_saola_1' - - steps: - - name: Setup Python - uses: actions/setup-python@v2 - - - name: Pull ESP-IDF docker - run: docker pull espressif/idf:latest - - - name: Checkout TinyUSB - uses: actions/checkout@v2 - with: - submodules: 'false' - - - name: Build - run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }} diff --git a/hw/bsp/lpc55/family.mk b/hw/bsp/lpc55/family.mk index f5949b875..d7bb444db 100644 --- a/hw/bsp/lpc55/family.mk +++ b/hw/bsp/lpc55/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x2abc77ec +FAMILY_SUBMODULES = hw/mcu/nxp include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/rp2040/family.mk b/hw/bsp/rp2040/family.mk new file mode 100644 index 000000000..8e30e7eb6 --- /dev/null +++ b/hw/bsp/rp2040/family.mk @@ -0,0 +1 @@ +FAMILY_SUBMODULES = hw/mcu/raspberrypi/pico-sdk diff --git a/hw/bsp/samd11/family.mk b/hw/bsp/samd11/family.mk index 4f01db8d7..9faa246d4 100644 --- a/hw/bsp/samd11/family.mk +++ b/hw/bsp/samd11/family.mk @@ -1,3 +1,4 @@ +FAMILY_SUBMODULES = hw/mcu/microchip include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/samd21/family.mk b/hw/bsp/samd21/family.mk index e2bba494a..d49d44630 100644 --- a/hw/bsp/samd21/family.mk +++ b/hw/bsp/samd21/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x68ed2b88 +FAMILY_SUBMODULES = hw/mcu/microchip include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/samd51/family.mk b/hw/bsp/samd51/family.mk index bb895dfc4..75dfb9ade 100644 --- a/hw/bsp/samd51/family.mk +++ b/hw/bsp/samd51/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x55114460 +FAMILY_SUBMODULES = hw/mcu/microchip include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/stm32f4/family.mk b/hw/bsp/stm32f4/family.mk index 384e7b1c2..c974dc109 100644 --- a/hw/bsp/stm32f4/family.mk +++ b/hw/bsp/stm32f4/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x57755a57 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_f4 hw/mcu/st/stm32f4xx_hal_driver include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/stm32f7/family.mk b/hw/bsp/stm32f7/family.mk index b09d8143b..680fd3b14 100644 --- a/hw/bsp/stm32f7/family.mk +++ b/hw/bsp/stm32f7/family.mk @@ -1,4 +1,5 @@ UF2_FAMILY_ID = 0x53b80f00 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_f7 hw/mcu/st/stm32f7xx_hal_driver include $(TOP)/$(BOARD_PATH)/board.mk -- cgit v1.3.1 From 168993d04d0627caa64faf82c3291c1ac2a19c82 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 21:45:48 +0700 Subject: re-enable all build --- .github/workflows/build.yml | 111 +++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 6 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a927ad4cb..0698e6385 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -64,12 +64,8 @@ jobs: with: submodules: 'false' - - name: Checkout Sub-Submodules - run: | - # Clone all submodules in lib - git submodule update --init --recursive lib - # some submodule has it own submodules that need to be fetched as well - #git submodule update --init --recursive hw/mcu/microchip + - name: Checkout Submodules in lib + run: git submodule update --init --recursive lib - name: Build run: python3 tools/build_family.py ${{ matrix.family }} @@ -96,4 +92,107 @@ jobs: asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_content_type: application/zip + # Build all no-family (opharned) boards + build-board: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + example: + # Alphabetical order + - 'device/audio_test' + - 'device/board_test' + - 'device/cdc_dual_ports' + - 'device/cdc_msc' + - 'device/cdc_msc_freertos' + - 'device/dfu_runtime' + - 'device/hid_composite' + - 'device/hid_composite_freertos' + - 'device/hid_generic_inout' + - 'device/hid_multiple_interface' + - 'device/midi_test' + - 'device/msc_dual_lun' + - 'device/net_lwip_webserver' + - 'device/uac2_headset' + - 'device/usbtmc' + - 'device/webusb_serial' + - 'host/cdc_msc_hid' + + steps: + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + + - name: Checkout TinyUSB + uses: actions/checkout@v2 + with: + submodules: 'true' + + - name: Checkout Sub-Submodules + run: | + # some submodule has it own submodules that need to be fetched as well + git submodule update --init --recursive lib/FreeRTOS + + # Add msp430-gcc url to env + echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 + + - name: Cache MSP430-GCC + uses: actions/cache@v2 + id: cache-msp430 + with: + path: ~/cache/ + key: ${{ runner.os }}-21-01-26-${{ env.MSP430_GCC_URL }} + + - name: Install MSP430-GCC + if: steps.cache-msp430.outputs.cache-hit != 'true' + run: | + # MSP430 GCC + mkdir -p ~/cache/msp430-gcc + wget --progress=dot:mega $MSP430_GCC_URL -O msp430-gcc.tar.bz2 + tar -C ~/cache/msp430-gcc -xaf msp430-gcc.tar.bz2 + + - name: Install Toolchains + run: | + # ARM & RISC-V GCC from xpack + npm install --global xpm + xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest + xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest + echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH + echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH + # TI MSP430 GCC + echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin` + + - name: Build + run: python3 tools/build_board.py ${{ matrix.example }} + + # Build ESP32S2 + build-esp32s2: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + # Alphabetical order + - 'adafruit_feather_esp32s2' + - 'adafruit_magtag_29gray' + - 'adafruit_metro_esp32s2' + - 'espressif_kaluga_1' + - 'espressif_saola_1' + + steps: + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Pull ESP-IDF docker + run: docker pull espressif/idf:latest + + - name: Checkout TinyUSB + uses: actions/checkout@v2 + with: + submodules: 'false' + + - name: Build + run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }} -- cgit v1.3.1 From 7ff14a652ba1348f863338479eb3347a06fcc80a Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 1 Mar 2021 22:13:21 +0700 Subject: add submodule lib/FreeRTOS-Kernel --- .github/workflows/build.yml | 5 +-- .gitmodules | 3 ++ examples/device/cdc_msc_freertos/Makefile | 2 +- .../ses/lpc175x_6x/lpc175x_6x.emProject | 50 +++++++++++----------- .../cdc_msc_freertos/ses/nrf5x/nrf5x.emProject | 48 ++++++++++----------- .../cdc_msc_freertos/ses/samd21/samd21.emProject | 48 ++++++++++----------- .../cdc_msc_freertos/ses/samd51/samd51.emProject | 48 ++++++++++----------- .../device/cdc_msc_freertos/src/freertos_hook.c | 2 +- examples/device/hid_composite_freertos/Makefile | 2 +- .../hid_composite_freertos/src/freertos_hook.c | 2 +- lib/FreeRTOS-Kernel | 1 + 11 files changed, 106 insertions(+), 105 deletions(-) create mode 160000 lib/FreeRTOS-Kernel (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0698e6385..b63a9a031 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -130,11 +130,8 @@ jobs: with: submodules: 'true' - - name: Checkout Sub-Submodules + - name: Setup Env run: | - # some submodule has it own submodules that need to be fetched as well - git submodule update --init --recursive lib/FreeRTOS - # Add msp430-gcc url to env echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 diff --git a/.gitmodules b/.gitmodules index 1ec196a48..e33532c4e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -114,3 +114,6 @@ url = https://github.com/raspberrypi/pico-sdk.git fetchRecurseSubmodules = false +[submodule "lib/FreeRTOS-Kernel"] + path = lib/FreeRTOS-Kernel + url = https://github.com/FreeRTOS/FreeRTOS-Kernel.git diff --git a/examples/device/cdc_msc_freertos/Makefile b/examples/device/cdc_msc_freertos/Makefile index 3570daa41..36174b5e1 100644 --- a/examples/device/cdc_msc_freertos/Makefile +++ b/examples/device/cdc_msc_freertos/Makefile @@ -1,7 +1,7 @@ include ../../../tools/top.mk include ../../make.mk -FREERTOS_SRC = lib/FreeRTOS/FreeRTOS/Source +FREERTOS_SRC = lib/FreeRTOS-Kernel INC += \ src \ diff --git a/examples/device/cdc_msc_freertos/ses/lpc175x_6x/lpc175x_6x.emProject b/examples/device/cdc_msc_freertos/ses/lpc175x_6x/lpc175x_6x.emProject index 4dc111f2e..691f8c3b0 100644 --- a/examples/device/cdc_msc_freertos/ses/lpc175x_6x/lpc175x_6x.emProject +++ b/examples/device/cdc_msc_freertos/ses/lpc175x_6x/lpc175x_6x.emProject @@ -20,7 +20,7 @@ arm_target_interface_type="SWD" build_treat_warnings_as_errors="No" c_preprocessor_definitions="LPC175x_6x;__LPC1700_FAMILY;__LPC176x_SUBFAMILY;ARM_MATH_CM3;FLASH_PLACEMENT=1;CORE_M3;CFG_TUSB_MCU=OPT_MCU_LPC175X_6X" - c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(rootDir)/hw/mcu/nxp/lpc_driver/lpc_chip_175x_6x/inc;$(rootDir)/lib/FreeRTOS/Source/include;$(rootDir)/lib/FreeRTOS/Source/portable/GCC/ARM_CM3" + c_user_include_directories=".;../../src;$(rootDir)/hw;$(rootDir)/src;$(rootDir)/hw/mcu/nxp/lpc_driver/lpc_chip_175x_6x/inc;$(rootDir)/lib/FreeRTOS-Kernel/include;$(rootDir)/lib/FreeRTOS-Kernel/portable/GCC/ARM_CM3" debug_register_definition_file="LPC176x5x_Registers.xml" debug_target_connection="J-Link" gcc_enable_all_warnings="Yes" @@ -92,39 +92,39 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + diff --git a/examples/device/cdc_msc_freertos/ses/nrf5x/nrf5x.emProject b/examples/device/cdc_msc_freertos/ses/nrf5x/nrf5x.emProject index f01b26d23..e964d6fb5 100644 --- a/examples/device/cdc_msc_freertos/ses/nrf5x/nrf5x.emProject +++ b/examples/device/cdc_msc_freertos/ses/nrf5x/nrf5x.emProject @@ -107,39 +107,39 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + diff --git a/examples/device/cdc_msc_freertos/ses/samd21/samd21.emProject b/examples/device/cdc_msc_freertos/ses/samd21/samd21.emProject index b8b099b68..b3db856d3 100644 --- a/examples/device/cdc_msc_freertos/ses/samd21/samd21.emProject +++ b/examples/device/cdc_msc_freertos/ses/samd21/samd21.emProject @@ -100,39 +100,39 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + diff --git a/examples/device/cdc_msc_freertos/ses/samd51/samd51.emProject b/examples/device/cdc_msc_freertos/ses/samd51/samd51.emProject index d84d070c0..77ff38b62 100644 --- a/examples/device/cdc_msc_freertos/ses/samd51/samd51.emProject +++ b/examples/device/cdc_msc_freertos/ses/samd51/samd51.emProject @@ -104,39 +104,39 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - + + - + - - - - + + + + diff --git a/examples/device/cdc_msc_freertos/src/freertos_hook.c b/examples/device/cdc_msc_freertos/src/freertos_hook.c index 423bad4d3..df15a8de7 100644 --- a/examples/device/cdc_msc_freertos/src/freertos_hook.c +++ b/examples/device/cdc_msc_freertos/src/freertos_hook.c @@ -37,7 +37,7 @@ void vApplicationMallocFailedHook(void) TU_ASSERT(false, ); } -void vApplicationStackOverflowHook(xTaskHandle pxTask, signed char *pcTaskName) +void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName) { (void) pxTask; (void) pcTaskName; diff --git a/examples/device/hid_composite_freertos/Makefile b/examples/device/hid_composite_freertos/Makefile index cef1af5a6..db7dfd345 100644 --- a/examples/device/hid_composite_freertos/Makefile +++ b/examples/device/hid_composite_freertos/Makefile @@ -1,7 +1,7 @@ include ../../../tools/top.mk include ../../make.mk -FREERTOS_SRC = lib/FreeRTOS/FreeRTOS/Source +FREERTOS_SRC = lib/FreeRTOS-Kernel INC += \ src \ diff --git a/examples/device/hid_composite_freertos/src/freertos_hook.c b/examples/device/hid_composite_freertos/src/freertos_hook.c index 423bad4d3..df15a8de7 100644 --- a/examples/device/hid_composite_freertos/src/freertos_hook.c +++ b/examples/device/hid_composite_freertos/src/freertos_hook.c @@ -37,7 +37,7 @@ void vApplicationMallocFailedHook(void) TU_ASSERT(false, ); } -void vApplicationStackOverflowHook(xTaskHandle pxTask, signed char *pcTaskName) +void vApplicationStackOverflowHook(xTaskHandle pxTask, char *pcTaskName) { (void) pxTask; (void) pcTaskName; diff --git a/lib/FreeRTOS-Kernel b/lib/FreeRTOS-Kernel new file mode 160000 index 000000000..2a604f4a2 --- /dev/null +++ b/lib/FreeRTOS-Kernel @@ -0,0 +1 @@ +Subproject commit 2a604f4a2818b8354b5e1a39e388eb5e16cfbc1f -- cgit v1.3.1 From 7afaae7ffc71094363a54dc92ab7982d0cb84d7b Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 2 Mar 2021 10:18:44 +0700 Subject: remove submodule lib/CMSIS_5 --- .github/workflows/build.yml | 2 +- .gitmodules | 3 --- docs/getting_started.md | 6 +++--- lib/CMSIS_5 | 1 - 4 files changed, 4 insertions(+), 8 deletions(-) delete mode 160000 lib/CMSIS_5 (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b63a9a031..f90a6843d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: submodules: 'false' - name: Checkout Submodules in lib - run: git submodule update --init --recursive lib + run: git submodule update --init lib - name: Build run: python3 tools/build_family.py ${{ matrix.family }} diff --git a/.gitmodules b/.gitmodules index 209b6ea95..664e32c59 100644 --- a/.gitmodules +++ b/.gitmodules @@ -100,9 +100,6 @@ [submodule "hw/mcu/st/stm32l5xx_hal_driver"] path = hw/mcu/st/stm32l5xx_hal_driver url = https://github.com/STMicroelectronics/stm32l5xx_hal_driver.git -[submodule "lib/CMSIS_5"] - path = lib/CMSIS_5 - url = https://github.com/ARM-software/CMSIS_5.git [submodule "lib/sct_neopixel"] path = lib/sct_neopixel url = https://github.com/gsteiert/sct_neopixel diff --git a/docs/getting_started.md b/docs/getting_started.md index dfdf02562..870491fe2 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -39,13 +39,13 @@ $ git clone https://github.com/hathach/tinyusb tinyusb $ cd tinyusb ``` -TinyUSB examples includes external repos aka submodules to provide low-level MCU peripheral's driver as well as external libraries such as FreeRTOS to compile with. Therefore we will firstly fetch those mcu driver repo by running this command in the top folder repo +Some TinyUSB examples also requires external submodule libraries in `/lib` such as FreeRTOS, Lightweight IP to build. Run following command to fetch them ``` -$ git submodule update --init --recursive +$ git submodule update --init lib ``` -It will takes a bit of time due to the number of supported MCUs, luckily we only need to do this once. Or if you only want to test with a specific mcu, you could only fetch its driver submodule. +In addition, MCU driver submodule is also needed to provide low-level MCU peripheral's driver. Luckily, it will be fetched if needed when you run the `make` to build your board. ### Build diff --git a/lib/CMSIS_5 b/lib/CMSIS_5 deleted file mode 160000 index b7b26f50d..000000000 --- a/lib/CMSIS_5 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b7b26f50d00072812aec8453f643e24bafedccb5 -- cgit v1.3.1 From 71313d934d2258802a850cccecaf18f0cdccf386 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 2 Mar 2021 11:50:57 +0700 Subject: update ci for msp430 family --- .github/workflows/build.yml | 69 ++++++++++++++++++++++++++++++++++----------- examples/rules.mk | 9 +++--- hw/bsp/msp430/family.mk | 7 +++-- 3 files changed, 61 insertions(+), 24 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f90a6843d..5da033cf8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,8 +61,6 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - with: - submodules: 'false' - name: Checkout Submodules in lib run: git submodule update --init lib @@ -130,8 +128,33 @@ jobs: with: submodules: 'true' - - name: Setup Env + - name: Install Toolchains run: | + # ARM & RISC-V GCC from xpack + npm install --global xpm + xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest + xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest + echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH + echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH + + - name: Build + run: python3 tools/build_board.py ${{ matrix.example }} + + # build all example for each family + build-msp430: + runs-on: ubuntu-latest + steps: + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Checkout TinyUSB + uses: actions/checkout@v2 + + - name: Checkout Submodules in lib + run: git submodule update --init lib + + - run: | + echo family=msp430 >> $GITHUB_ENV # Add msp430-gcc url to env echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 @@ -140,31 +163,43 @@ jobs: id: cache-msp430 with: path: ~/cache/ - key: ${{ runner.os }}-21-01-26-${{ env.MSP430_GCC_URL }} + key: ${{ runner.os }}-21-03-02-${{ env.MSP430_GCC_URL }} - name: Install MSP430-GCC if: steps.cache-msp430.outputs.cache-hit != 'true' run: | - # MSP430 GCC mkdir -p ~/cache/msp430-gcc wget --progress=dot:mega $MSP430_GCC_URL -O msp430-gcc.tar.bz2 tar -C ~/cache/msp430-gcc -xaf msp430-gcc.tar.bz2 - - name: Install Toolchains - run: | - # ARM & RISC-V GCC from xpack - npm install --global xpm - xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest - xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH - - # TI MSP430 GCC - echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin` + - name: Set Toolchain Path + run: echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin` - name: Build - run: python3 tools/build_board.py ${{ matrix.example }} + run: python3 tools/build_family.py ${{ env.family }} + + - uses: actions/upload-artifact@v2 + with: + name: ${{ env.family }}-tinyusb-examples + path: _bin/ + - name: Create Release Asset + if: ${{ github.event_name == 'release' }} + run: | + cd _bin/ + zip -r ../${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip * + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name == 'release' }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_name: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_content_type: application/zip + # Build ESP32S2 build-esp32s2: runs-on: ubuntu-latest diff --git a/examples/rules.mk b/examples/rules.mk index 1d5a190fe..2b28a4714 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -100,12 +100,11 @@ INC += $(TOP)/src CFLAGS += $(addprefix -I,$(INC)) -# TODO Skip nanolib for MSP430 -ifeq ($(BOARD), msp_exp430f5529lp) - LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -else - LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nosys.specs -specs=nano.specs +LDFLAGS += $(CFLAGS) -fshort-enums -Wl,-T,$(TOP)/$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections +ifneq ($(SKIP_NANOLIB), 1) +LDFLAGS += -specs=nosys.specs -specs=nano.specs endif + ASFLAGS += $(CFLAGS) # Assembly files can be name with upper case .S, convert it to .s diff --git a/hw/bsp/msp430/family.mk b/hw/bsp/msp430/family.mk index 870b27165..a982c2866 100644 --- a/hw/bsp/msp430/family.mk +++ b/hw/bsp/msp430/family.mk @@ -1,3 +1,7 @@ +CROSS_COMPILE = msp430-elf- +FAMILY_SUBMODULES = hw/mcu/ti +SKIP_NANOLIB = 1 + CFLAGS += \ -D__MSP430F5529__ \ -DCFG_TUSB_MCU=OPT_MCU_MSP430x5xx \ @@ -6,8 +10,7 @@ CFLAGS += \ #-mmcu=msp430f5529 -# Cross Compiler for MSP430 -CROSS_COMPILE = msp430-elf- + # All source paths should be relative to the top level. LD_FILE = hw/mcu/ti/msp430/msp430-gcc-support-files/include/msp430f5529.ld -- cgit v1.3.1 From b066fdc2c69591412d2b7c9111a122266cd9f87a Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 2 Mar 2021 12:24:12 +0700 Subject: move fomu to its own family, update ci with build risv --- .github/workflows/build.yml | 150 +++++++++++++++++++++++++++------------ examples/make.mk | 4 +- hw/bsp/fomu/board.mk | 35 --------- hw/bsp/fomu/boards/fomu/board.h | 40 +++++++++++ hw/bsp/fomu/boards/fomu/board.mk | 1 + hw/bsp/fomu/family.mk | 32 +++++++++ 6 files changed, 182 insertions(+), 80 deletions(-) delete mode 100644 hw/bsp/fomu/board.mk create mode 100644 hw/bsp/fomu/boards/fomu/board.h create mode 100644 hw/bsp/fomu/boards/fomu/board.mk create mode 100644 hw/bsp/fomu/family.mk (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5da033cf8..a3ea0d978 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,8 +28,10 @@ jobs: cd test ceedling test:all - # build all example for each family - build-family: + # --------------------------------------- + # Build ARM family + # --------------------------------------- + build-arm: runs-on: ubuntu-latest strategy: fail-fast: false @@ -90,32 +92,17 @@ jobs: asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_content_type: application/zip - # Build all no-family (opharned) boards - build-board: + # --------------------------------------- + # Build RISC-V family + # --------------------------------------- + build-riscv: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - example: + family: # Alphabetical order - - 'device/audio_test' - - 'device/board_test' - - 'device/cdc_dual_ports' - - 'device/cdc_msc' - - 'device/cdc_msc_freertos' - - 'device/dfu_runtime' - - 'device/hid_composite' - - 'device/hid_composite_freertos' - - 'device/hid_generic_inout' - - 'device/hid_multiple_interface' - - 'device/midi_test' - - 'device/msc_dual_lun' - - 'device/net_lwip_webserver' - - 'device/uac2_headset' - - 'device/usbtmc' - - 'device/webusb_serial' - - 'host/cdc_msc_hid' - + - 'fomu' steps: - name: Setup Python uses: actions/setup-python@v2 @@ -125,22 +112,76 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - with: - submodules: 'true' - - name: Install Toolchains + - name: Checkout Submodules in lib + run: git submodule update --init lib + + - name: Install Toolchain run: | - # ARM & RISC-V GCC from xpack + # RISC-V GCC from xpack npm install --global xpm - xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH - name: Build - run: python3 tools/build_board.py ${{ matrix.example }} + run: python3 tools/build_family.py ${{ matrix.family }} + + - uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.family }}-tinyusb-examples + path: _bin/ + + - name: Create Release Asset + if: ${{ github.event_name == 'release' }} + run: | + cd _bin/ + zip -r ../${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip * + + - name: Upload Release Asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event_name == 'release' }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_content_type: application/zip + + # --------------------------------------- + # Build ESP32S2 family + # --------------------------------------- + build-esp32s2: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + board: + # Alphabetical order + - 'adafruit_feather_esp32s2' + - 'adafruit_magtag_29gray' + - 'adafruit_metro_esp32s2' + - 'espressif_kaluga_1' + - 'espressif_saola_1' + + steps: + - name: Setup Python + uses: actions/setup-python@v2 + + - name: Pull ESP-IDF docker + run: docker pull espressif/idf:latest + + - name: Checkout TinyUSB + uses: actions/checkout@v2 + with: + submodules: 'false' + + - name: Build + run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }} - # build all example for each family + # --------------------------------------- + # Build msp430 family + # --------------------------------------- build-msp430: runs-on: ubuntu-latest steps: @@ -199,32 +240,53 @@ jobs: asset_path: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_name: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_content_type: application/zip - - # Build ESP32S2 - build-esp32s2: + + # --------------------------------------- + # Build all no-family (opharned) boards + # --------------------------------------- + build-board: runs-on: ubuntu-latest strategy: fail-fast: false matrix: - board: + example: # Alphabetical order - - 'adafruit_feather_esp32s2' - - 'adafruit_magtag_29gray' - - 'adafruit_metro_esp32s2' - - 'espressif_kaluga_1' - - 'espressif_saola_1' + - 'device/audio_test' + - 'device/board_test' + - 'device/cdc_dual_ports' + - 'device/cdc_msc' + - 'device/cdc_msc_freertos' + - 'device/dfu_runtime' + - 'device/hid_composite' + - 'device/hid_composite_freertos' + - 'device/hid_generic_inout' + - 'device/hid_multiple_interface' + - 'device/midi_test' + - 'device/msc_dual_lun' + - 'device/net_lwip_webserver' + - 'device/uac2_headset' + - 'device/usbtmc' + - 'device/webusb_serial' + - 'host/cdc_msc_hid' steps: - name: Setup Python uses: actions/setup-python@v2 - - name: Pull ESP-IDF docker - run: docker pull espressif/idf:latest + - name: Setup Node.js + uses: actions/setup-node@v1 - name: Checkout TinyUSB uses: actions/checkout@v2 with: - submodules: 'false' + submodules: 'true' + + - name: Install Toolchains + run: | + # ARM GCC from xpack + npm install --global xpm + xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest + echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH - name: Build - run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }} + run: python3 tools/build_board.py ${{ matrix.example }} \ No newline at end of file diff --git a/examples/make.mk b/examples/make.mk index c981d0de4..173f5598a 100644 --- a/examples/make.mk +++ b/examples/make.mk @@ -19,8 +19,10 @@ __check_defined = \ #-------------- Select the board to build for. ------------ # Board without family -BOARD_PATH := $(subst $(TOP)/,,$(wildcard $(TOP)/hw/bsp/$(BOARD))) +ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),) +BOARD_PATH := hw/bsp/$(BOARD) FAMILY := +endif # Board within family ifeq ($(BOARD_PATH),) diff --git a/hw/bsp/fomu/board.mk b/hw/bsp/fomu/board.mk deleted file mode 100644 index f31dfec2a..000000000 --- a/hw/bsp/fomu/board.mk +++ /dev/null @@ -1,35 +0,0 @@ -CFLAGS += \ - -flto \ - -march=rv32i \ - -mabi=ilp32 \ - -nostdlib \ - -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI - -# Cross Compiler for RISC-V -CROSS_COMPILE = riscv-none-embed- - -MCU_DIR = hw/mcu/fomu -BSP_DIR = hw/bsp/fomu - -# All source paths should be relative to the top level. -LD_FILE = hw/bsp/$(BOARD)/fomu.ld - -SRC_S += hw/bsp/$(BOARD)/crt0-vexriscv.S - -INC += \ - $(TOP)/$(BSP_DIR)/include - -# For TinyUSB port source -VENDOR = valentyusb -CHIP_FAMILY = eptri - -# For freeRTOS port source -FREERTOS_PORT = RISC-V - -# flash using dfu-util -$(BUILD)/$(PROJECT).dfu: $(BUILD)/$(PROJECT).bin - @echo "Create $@" - python $(TOP)/hw/bsp/$(BOARD)/dfu.py -b $^ -D 0x1209:0x5bf0 $@ - -flash: $(BUILD)/$(PROJECT).dfu - dfu-util -D $^ diff --git a/hw/bsp/fomu/boards/fomu/board.h b/hw/bsp/fomu/boards/fomu/board.h new file mode 100644 index 000000000..666ba1d98 --- /dev/null +++ b/hw/bsp/fomu/boards/fomu/board.h @@ -0,0 +1,40 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef BOARD_H_ +#define BOARD_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +// Place holder only + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/hw/bsp/fomu/boards/fomu/board.mk b/hw/bsp/fomu/boards/fomu/board.mk new file mode 100644 index 000000000..8ced11412 --- /dev/null +++ b/hw/bsp/fomu/boards/fomu/board.mk @@ -0,0 +1 @@ +# place holder \ No newline at end of file diff --git a/hw/bsp/fomu/family.mk b/hw/bsp/fomu/family.mk new file mode 100644 index 000000000..f615216be --- /dev/null +++ b/hw/bsp/fomu/family.mk @@ -0,0 +1,32 @@ +CFLAGS += \ + -flto \ + -march=rv32i \ + -mabi=ilp32 \ + -nostdlib \ + -DCFG_TUSB_MCU=OPT_MCU_VALENTYUSB_EPTRI + +# Cross Compiler for RISC-V +CROSS_COMPILE = riscv-none-embed- + +# All source paths should be relative to the top level. +LD_FILE = $(FAMILY_PATH)/fomu.ld + +SRC_S += $(FAMILY_PATH)/crt0-vexriscv.S + +INC += \ + $(TOP)/$(FAMILY_PATH)/include + +# For TinyUSB port source +VENDOR = valentyusb +CHIP_FAMILY = eptri + +# For freeRTOS port source +FREERTOS_PORT = RISC-V + +# flash using dfu-util +$(BUILD)/$(PROJECT).dfu: $(BUILD)/$(PROJECT).bin + @echo "Create $@" + python $(TOP)/hw/bsp/$(BOARD)/dfu.py -b $^ -D 0x1209:0x5bf0 $@ + +flash: $(BUILD)/$(PROJECT).dfu + dfu-util -D $^ -- cgit v1.3.1 From e1966f8d9116d42efdaf16932bbbffdaaac430bc Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 3 Mar 2021 17:29:30 +0700 Subject: mcb1800 and lpc18s37 work well with both device and host demo --- .github/workflows/build.yml | 1 + hw/bsp/lpc18/boards/lpcxpresso18s37/board.h | 77 +++++ hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk | 6 + hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld | 404 +++++++++++++++++++++++++ hw/bsp/lpc18/boards/mcb1800/board.h | 50 ++- hw/bsp/lpc18/boards/mcb1800/board.mk | 3 + hw/bsp/lpc18/boards/mcb1800/lpc1857.ld | 58 ++-- hw/bsp/lpc18/family.c | 45 +-- hw/bsp/lpc18/family.mk | 3 - 9 files changed, 567 insertions(+), 80 deletions(-) create mode 100644 hw/bsp/lpc18/boards/lpcxpresso18s37/board.h create mode 100644 hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk create mode 100644 hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a3ea0d978..2413eaf54 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,7 @@ jobs: family: # Alphabetical order - 'imxrt' + - 'lpc18' - 'lpc55' - 'nrf' - 'rp2040' diff --git a/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h b/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h new file mode 100644 index 000000000..b3a7bc44f --- /dev/null +++ b/hw/bsp/lpc18/boards/lpcxpresso18s37/board.h @@ -0,0 +1,77 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef BOARD_H_ +#define BOARD_H_ + +// Note: For USB Host demo, install JP4 +// WARNING: don't install JP4 when running as device + +#ifdef __cplusplus + extern "C" { +#endif + +// LED Red +#define LED_PORT 3 +#define LED_PIN 7 + +// ISP Button +#define BUTTON_PORT 0 +#define BUTTON_PIN 7 + +#define UART_DEV LPC_USART0 + +static inline void board_lpc18_pinmux(void) +{ + const PINMUX_GRP_T pinmuxing[] = + { + // LEDs + { 0x6, 9 , SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 }, + { 0x6, 11, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0 }, + + // Button + { 0x2, 7, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC0 }, + + // UART + { 0x06, 4, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 }, + { 0x02, 1, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC1 }, + + // USB0 + //{ 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function + + //{ 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function + //{ 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION + {0x2, 5, SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC4 }, + }; + + Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T)); +} + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk b/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk new file mode 100644 index 000000000..29b129130 --- /dev/null +++ b/hw/bsp/lpc18/boards/lpcxpresso18s37/board.mk @@ -0,0 +1,6 @@ +LD_FILE = $(BOARD_PATH)/lpc1837.ld + +# For flash-jlink target +JLINK_DEVICE = LPC18S37 + +flash: flash-jlink diff --git a/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld b/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld new file mode 100644 index 000000000..51fd1539d --- /dev/null +++ b/hw/bsp/lpc18/boards/lpcxpresso18s37/lpc1837.ld @@ -0,0 +1,404 @@ +/* + * GENERATED FILE - DO NOT EDIT + * Copyright (c) 2008-2013 Code Red Technologies Ltd, + * Copyright 2015, 2018-2019 NXP + * (c) NXP Semiconductors 2013-2021 + * Generated linker script file for LPC1837 + * Created from linkscript.ldt by FMCreateLinkLibraries + * Using Freemarker v2.3.23 + * MCUXpresso IDE v11.2.0 [Build 4120] [2020-07-09] on Mar 3, 2021 4:22:49 PM + */ + +MEMORY +{ + /* Define each memory region */ + MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes (alias Flash) */ + MFlashB512 (rx) : ORIGIN = 0x1b000000, LENGTH = 0x80000 /* 512K bytes (alias Flash2) */ + RamLoc32 (rwx) : ORIGIN = 0x10000000, LENGTH = 0x8000 /* 32K bytes (alias RAM) */ + RamLoc40 (rwx) : ORIGIN = 0x10080000, LENGTH = 0xa000 /* 40K bytes (alias RAM2) */ + RamAHB32 (rwx) : ORIGIN = 0x20000000, LENGTH = 0x8000 /* 32K bytes (alias RAM3) */ + RamAHB16 (rwx) : ORIGIN = 0x20008000, LENGTH = 0x4000 /* 16K bytes (alias RAM4) */ + RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */ +} + +/* Define a symbol for the top of each memory region */ +__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */ +__base_Flash = 0x1a000000 ; /* Flash */ +__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */ +__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */ +__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */ +__base_Flash2 = 0x1b000000 ; /* Flash2 */ +__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */ +__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */ +__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */ +__base_RAM = 0x10000000 ; /* RAM */ +__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */ +__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */ +__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */ +__base_RAM2 = 0x10080000 ; /* RAM2 */ +__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */ +__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */ +__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */ +__base_RAM3 = 0x20000000 ; /* RAM3 */ +__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */ +__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */ +__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */ +__base_RAM4 = 0x20008000 ; /* RAM4 */ +__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */ +__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */ +__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */ +__base_RAM5 = 0x2000c000 ; /* RAM5 */ +__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */ +__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */ + +ENTRY(ResetISR) + +SECTIONS +{ + .text_Flash2 : ALIGN(4) + { + FILL(0xff) + *(.text_Flash2) /* for compatibility with previous releases */ + *(.text_MFlashB512) /* for compatibility with previous releases */ + *(.text.$Flash2) + *(.text.$MFlashB512) + *(.text_Flash2.*) /* for compatibility with previous releases */ + *(.text_MFlashB512.*) /* for compatibility with previous releases */ + *(.text.$Flash2.*) + *(.text.$MFlashB512.*) + *(.rodata.$Flash2) + *(.rodata.$MFlashB512) + *(.rodata.$Flash2.*) + *(.rodata.$MFlashB512.*) } > MFlashB512 + + /* MAIN TEXT SECTION */ + .text : ALIGN(4) + { + FILL(0xff) + __vectors_start__ = ABSOLUTE(.) ; + KEEP(*(.isr_vector)) + /* Global Section Table */ + . = ALIGN(4) ; + __section_table_start = .; + __data_section_table = .; + LONG(LOADADDR(.data)); + LONG( ADDR(.data)); + LONG( SIZEOF(.data)); + LONG(LOADADDR(.data_RAM2)); + LONG( ADDR(.data_RAM2)); + LONG( SIZEOF(.data_RAM2)); + LONG(LOADADDR(.data_RAM3)); + LONG( ADDR(.data_RAM3)); + LONG( SIZEOF(.data_RAM3)); + LONG(LOADADDR(.data_RAM4)); + LONG( ADDR(.data_RAM4)); + LONG( SIZEOF(.data_RAM4)); + LONG(LOADADDR(.data_RAM5)); + LONG( ADDR(.data_RAM5)); + LONG( SIZEOF(.data_RAM5)); + __data_section_table_end = .; + __bss_section_table = .; + LONG( ADDR(.bss)); + LONG( SIZEOF(.bss)); + LONG( ADDR(.bss_RAM2)); + LONG( SIZEOF(.bss_RAM2)); + LONG( ADDR(.bss_RAM3)); + LONG( SIZEOF(.bss_RAM3)); + LONG( ADDR(.bss_RAM4)); + LONG( SIZEOF(.bss_RAM4)); + LONG( ADDR(.bss_RAM5)); + LONG( SIZEOF(.bss_RAM5)); + __bss_section_table_end = .; + __section_table_end = . ; + /* End of Global Section Table */ + + *(.after_vectors*) + + } > MFlashA512 + + .text : ALIGN(4) + { + *(.text*) + *(.rodata .rodata.* .constdata .constdata.*) + . = ALIGN(4); + } > MFlashA512 + /* + * for exception handling/unwind - some Newlib functions (in common + * with C++ and STDC++) use this. + */ + .ARM.extab : ALIGN(4) + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > MFlashA512 + + .ARM.exidx : ALIGN(4) + { + __exidx_start = .; + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + __exidx_end = .; + } > MFlashA512 + + _etext = .; + + /* DATA section for RamLoc40 */ + + .data_RAM2 : ALIGN(4) + { + FILL(0xff) + PROVIDE(__start_data_RAM2 = .) ; + PROVIDE(__start_data_RamLoc40 = .) ; + *(.ramfunc.$RAM2) + *(.ramfunc.$RamLoc40) + *(.data.$RAM2) + *(.data.$RamLoc40) + *(.data.$RAM2.*) + *(.data.$RamLoc40.*) + . = ALIGN(4) ; + PROVIDE(__end_data_RAM2 = .) ; + PROVIDE(__end_data_RamLoc40 = .) ; + } > RamLoc40 AT>MFlashA512 + + /* DATA section for RamAHB32 */ + + .data_RAM3 : ALIGN(4) + { + FILL(0xff) + PROVIDE(__start_data_RAM3 = .) ; + PROVIDE(__start_data_RamAHB32 = .) ; + *(.ramfunc.$RAM3) + *(.ramfunc.$RamAHB32) + *(.data.$RAM3) + *(.data.$RamAHB32) + *(.data.$RAM3.*) + *(.data.$RamAHB32.*) + . = ALIGN(4) ; + PROVIDE(__end_data_RAM3 = .) ; + PROVIDE(__end_data_RamAHB32 = .) ; + } > RamAHB32 AT>MFlashA512 + + /* DATA section for RamAHB16 */ + + .data_RAM4 : ALIGN(4) + { + FILL(0xff) + PROVIDE(__start_data_RAM4 = .) ; + PROVIDE(__start_data_RamAHB16 = .) ; + *(.ramfunc.$RAM4) + *(.ramfunc.$RamAHB16) + *(.data.$RAM4) + *(.data.$RamAHB16) + *(.data.$RAM4.*) + *(.data.$RamAHB16.*) + . = ALIGN(4) ; + PROVIDE(__end_data_RAM4 = .) ; + PROVIDE(__end_data_RamAHB16 = .) ; + } > RamAHB16 AT>MFlashA512 + + /* DATA section for RamAHB_ETB16 */ + + .data_RAM5 : ALIGN(4) + { + FILL(0xff) + PROVIDE(__start_data_RAM5 = .) ; + PROVIDE(__start_data_RamAHB_ETB16 = .) ; + *(.ramfunc.$RAM5) + *(.ramfunc.$RamAHB_ETB16) + *(.data.$RAM5) + *(.data.$RamAHB_ETB16) + *(.data.$RAM5.*) + *(.data.$RamAHB_ETB16.*) + . = ALIGN(4) ; + PROVIDE(__end_data_RAM5 = .) ; + PROVIDE(__end_data_RamAHB_ETB16 = .) ; + } > RamAHB_ETB16 AT>MFlashA512 + + /* MAIN DATA SECTION */ + .uninit_RESERVED (NOLOAD) : ALIGN(4) + { + _start_uninit_RESERVED = .; + KEEP(*(.bss.$RESERVED*)) + . = ALIGN(4) ; + _end_uninit_RESERVED = .; + } > RamLoc32 AT> RamLoc32 + + /* Main DATA section (RamLoc32) */ + .data : ALIGN(4) + { + FILL(0xff) + _data = . ; + PROVIDE(__start_data_RAM = .) ; + PROVIDE(__start_data_RamLoc32 = .) ; + *(vtable) + *(.ramfunc*) + KEEP(*(CodeQuickAccess)) + KEEP(*(DataQuickAccess)) + *(RamFunction) + *(.data*) + . = ALIGN(4) ; + _edata = . ; + PROVIDE(__end_data_RAM = .) ; + PROVIDE(__end_data_RamLoc32 = .) ; + } > RamLoc32 AT>MFlashA512 + + /* BSS section for RamLoc40 */ + .bss_RAM2 : ALIGN(4) + { + PROVIDE(__start_bss_RAM2 = .) ; + PROVIDE(__start_bss_RamLoc40 = .) ; + *(.bss.$RAM2) + *(.bss.$RamLoc40) + *(.bss.$RAM2.*) + *(.bss.$RamLoc40.*) + . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ + PROVIDE(__end_bss_RAM2 = .) ; + PROVIDE(__end_bss_RamLoc40 = .) ; + } > RamLoc40 AT> RamLoc40 + + /* BSS section for RamAHB32 */ + .bss_RAM3 : ALIGN(4) + { + PROVIDE(__start_bss_RAM3 = .) ; + PROVIDE(__start_bss_RamAHB32 = .) ; + *(.bss.$RAM3) + *(.bss.$RamAHB32) + *(.bss.$RAM3.*) + *(.bss.$RamAHB32.*) + . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ + PROVIDE(__end_bss_RAM3 = .) ; + PROVIDE(__end_bss_RamAHB32 = .) ; + } > RamAHB32 AT> RamAHB32 + + /* BSS section for RamAHB16 */ + .bss_RAM4 : ALIGN(4) + { + PROVIDE(__start_bss_RAM4 = .) ; + PROVIDE(__start_bss_RamAHB16 = .) ; + *(.bss.$RAM4) + *(.bss.$RamAHB16) + *(.bss.$RAM4.*) + *(.bss.$RamAHB16.*) + . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ + PROVIDE(__end_bss_RAM4 = .) ; + PROVIDE(__end_bss_RamAHB16 = .) ; + } > RamAHB16 AT> RamAHB16 + + /* BSS section for RamAHB_ETB16 */ + .bss_RAM5 : ALIGN(4) + { + PROVIDE(__start_bss_RAM5 = .) ; + PROVIDE(__start_bss_RamAHB_ETB16 = .) ; + *(.bss.$RAM5) + *(.bss.$RamAHB_ETB16) + *(.bss.$RAM5.*) + *(.bss.$RamAHB_ETB16.*) + . = ALIGN (. != 0 ? 4 : 1) ; /* avoid empty segment */ + PROVIDE(__end_bss_RAM5 = .) ; + PROVIDE(__end_bss_RamAHB_ETB16 = .) ; + } > RamAHB_ETB16 AT> RamAHB_ETB16 + + /* MAIN BSS SECTION */ + .bss : ALIGN(4) + { + _bss = .; + PROVIDE(__start_bss_RAM = .) ; + PROVIDE(__start_bss_RamLoc32 = .) ; + *(.bss*) + *(COMMON) + . = ALIGN(4) ; + _ebss = .; + PROVIDE(__end_bss_RAM = .) ; + PROVIDE(__end_bss_RamLoc32 = .) ; + PROVIDE(end = .); + } > RamLoc32 AT> RamLoc32 + + /* NOINIT section for RamLoc40 */ + .noinit_RAM2 (NOLOAD) : ALIGN(4) + { + PROVIDE(__start_noinit_RAM2 = .) ; + PROVIDE(__start_noinit_RamLoc40 = .) ; + *(.noinit.$RAM2) + *(.noinit.$RamLoc40) + *(.noinit.$RAM2.*) + *(.noinit.$RamLoc40.*) + . = ALIGN(4) ; + PROVIDE(__end_noinit_RAM2 = .) ; + PROVIDE(__end_noinit_RamLoc40 = .) ; + } > RamLoc40 AT> RamLoc40 + + /* NOINIT section for RamAHB32 */ + .noinit_RAM3 (NOLOAD) : ALIGN(4) + { + PROVIDE(__start_noinit_RAM3 = .) ; + PROVIDE(__start_noinit_RamAHB32 = .) ; + *(.noinit.$RAM3) + *(.noinit.$RamAHB32) + *(.noinit.$RAM3.*) + *(.noinit.$RamAHB32.*) + . = ALIGN(4) ; + PROVIDE(__end_noinit_RAM3 = .) ; + PROVIDE(__end_noinit_RamAHB32 = .) ; + } > RamAHB32 AT> RamAHB32 + + /* NOINIT section for RamAHB16 */ + .noinit_RAM4 (NOLOAD) : ALIGN(4) + { + PROVIDE(__start_noinit_RAM4 = .) ; + PROVIDE(__start_noinit_RamAHB16 = .) ; + *(.noinit.$RAM4) + *(.noinit.$RamAHB16) + *(.noinit.$RAM4.*) + *(.noinit.$RamAHB16.*) + . = ALIGN(4) ; + PROVIDE(__end_noinit_RAM4 = .) ; + PROVIDE(__end_noinit_RamAHB16 = .) ; + } > RamAHB16 AT> RamAHB16 + + /* NOINIT section for RamAHB_ETB16 */ + .noinit_RAM5 (NOLOAD) : ALIGN(4) + { + PROVIDE(__start_noinit_RAM5 = .) ; + PROVIDE(__start_noinit_RamAHB_ETB16 = .) ; + *(.noinit.$RAM5) + *(.noinit.$RamAHB_ETB16) + *(.noinit.$RAM5.*) + *(.noinit.$RamAHB_ETB16.*) + . = ALIGN(4) ; + PROVIDE(__end_noinit_RAM5 = .) ; + PROVIDE(__end_noinit_RamAHB_ETB16 = .) ; + } > RamAHB_ETB16 AT> RamAHB_ETB16 + + /* DEFAULT NOINIT SECTION */ + .noinit (NOLOAD): ALIGN(4) + { + _noinit = .; + PROVIDE(__start_noinit_RAM = .) ; + PROVIDE(__start_noinit_RamLoc32 = .) ; + *(.noinit*) + . = ALIGN(4) ; + _end_noinit = .; + PROVIDE(__end_noinit_RAM = .) ; + PROVIDE(__end_noinit_RamLoc32 = .) ; + } > RamLoc32 AT> RamLoc32 + PROVIDE(_pvHeapStart = DEFINED(__user_heap_base) ? __user_heap_base : .); + PROVIDE(_vStackTop = DEFINED(__user_stack_top) ? __user_stack_top : __top_RamLoc32 - 0); + + /* ## Create checksum value (used in startup) ## */ + PROVIDE(__valid_user_code_checksum = 0 - + (_vStackTop + + (ResetISR + 1) + + (NMI_Handler + 1) + + (HardFault_Handler + 1) + + (( DEFINED(MemManage_Handler) ? MemManage_Handler : 0 ) + 1) /* MemManage_Handler may not be defined */ + + (( DEFINED(BusFault_Handler) ? BusFault_Handler : 0 ) + 1) /* BusFault_Handler may not be defined */ + + (( DEFINED(UsageFault_Handler) ? UsageFault_Handler : 0 ) + 1) /* UsageFault_Handler may not be defined */ + ) ); + + /* Provide basic symbols giving location and size of main text + * block, including initial values of RW data sections. Note that + * these will need extending to give a complete picture with + * complex images (e.g multiple Flash banks). + */ + _image_start = LOADADDR(.text); + _image_end = LOADADDR(.data) + SIZEOF(.data); + _image_size = _image_end - _image_start; +} \ No newline at end of file diff --git a/hw/bsp/lpc18/boards/mcb1800/board.h b/hw/bsp/lpc18/boards/mcb1800/board.h index d690b69d9..6111da975 100644 --- a/hw/bsp/lpc18/boards/mcb1800/board.h +++ b/hw/bsp/lpc18/boards/mcb1800/board.h @@ -39,11 +39,53 @@ #define BUTTON_PORT 2 #define BUTTON_PIN 0 -#define UART_DEV LPC_USART3 -#define UART_PORT 0x02 -#define UART_PIN_TX 3 -#define UART_PIN_RX 4 +#define UART_DEV LPC_USART3 +static inline void board_lpc18_pinmux(void) +{ + const PINMUX_GRP_T pinmuxing[] = + { + // LEDs + { 0xD, 10, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4) }, + { 0xD, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, + { 0xD, 12, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, + { 0xD, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, + { 0xD, 14, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, + { 0x9, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, + { 0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, + { 0x9, 2, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, + + // Button + { 0x4, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP) }, + + // UART + { 2, 3, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 }, + { 2, 4, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, + + // USB0 + { 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function + + { 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function + { 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION + }; + + Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T)); + + /* Pin clock mux values, re-used structure, value in first index is meaningless */ + const PINMUX_GRP_T pinclockmuxing[] = + { + { 0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, + { 0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, + { 0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, + { 0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, + }; + + /* Clock pins only, group field not used */ + for (uint32_t i = 0; i < (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++) + { + Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc); + } +} #ifdef __cplusplus } diff --git a/hw/bsp/lpc18/boards/mcb1800/board.mk b/hw/bsp/lpc18/boards/mcb1800/board.mk index d601c5773..0307a21d6 100644 --- a/hw/bsp/lpc18/boards/mcb1800/board.mk +++ b/hw/bsp/lpc18/boards/mcb1800/board.mk @@ -2,3 +2,6 @@ LD_FILE = $(BOARD_PATH)/lpc1857.ld # For flash-jlink target JLINK_DEVICE = LPC1857 + +# flash using jlink +flash: flash-jlink diff --git a/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld b/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld index 983b41eb0..9a308e342 100644 --- a/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld +++ b/hw/bsp/lpc18/boards/mcb1800/lpc1857.ld @@ -20,35 +20,35 @@ MEMORY RamAHB_ETB16 (rwx) : ORIGIN = 0x2000c000, LENGTH = 0x4000 /* 16K bytes (alias RAM5) */ } - /* Define a symbol for the top of each memory region */ - __base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */ - __base_Flash = 0x1a000000 ; /* Flash */ - __top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */ - __top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */ - __base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */ - __base_Flash2 = 0x1b000000 ; /* Flash2 */ - __top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */ - __top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */ - __base_RamLoc32 = 0x10000000 ; /* RamLoc32 */ - __base_RAM = 0x10000000 ; /* RAM */ - __top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */ - __top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */ - __base_RamLoc40 = 0x10080000 ; /* RamLoc40 */ - __base_RAM2 = 0x10080000 ; /* RAM2 */ - __top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */ - __top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */ - __base_RamAHB32 = 0x20000000 ; /* RamAHB32 */ - __base_RAM3 = 0x20000000 ; /* RAM3 */ - __top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */ - __top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */ - __base_RamAHB16 = 0x20008000 ; /* RamAHB16 */ - __base_RAM4 = 0x20008000 ; /* RAM4 */ - __top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */ - __top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */ - __base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */ - __base_RAM5 = 0x2000c000 ; /* RAM5 */ - __top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */ - __top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */ +/* Define a symbol for the top of each memory region */ +__base_MFlashA512 = 0x1a000000 ; /* MFlashA512 */ +__base_Flash = 0x1a000000 ; /* Flash */ +__top_MFlashA512 = 0x1a000000 + 0x80000 ; /* 512K bytes */ +__top_Flash = 0x1a000000 + 0x80000 ; /* 512K bytes */ +__base_MFlashB512 = 0x1b000000 ; /* MFlashB512 */ +__base_Flash2 = 0x1b000000 ; /* Flash2 */ +__top_MFlashB512 = 0x1b000000 + 0x80000 ; /* 512K bytes */ +__top_Flash2 = 0x1b000000 + 0x80000 ; /* 512K bytes */ +__base_RamLoc32 = 0x10000000 ; /* RamLoc32 */ +__base_RAM = 0x10000000 ; /* RAM */ +__top_RamLoc32 = 0x10000000 + 0x8000 ; /* 32K bytes */ +__top_RAM = 0x10000000 + 0x8000 ; /* 32K bytes */ +__base_RamLoc40 = 0x10080000 ; /* RamLoc40 */ +__base_RAM2 = 0x10080000 ; /* RAM2 */ +__top_RamLoc40 = 0x10080000 + 0xa000 ; /* 40K bytes */ +__top_RAM2 = 0x10080000 + 0xa000 ; /* 40K bytes */ +__base_RamAHB32 = 0x20000000 ; /* RamAHB32 */ +__base_RAM3 = 0x20000000 ; /* RAM3 */ +__top_RamAHB32 = 0x20000000 + 0x8000 ; /* 32K bytes */ +__top_RAM3 = 0x20000000 + 0x8000 ; /* 32K bytes */ +__base_RamAHB16 = 0x20008000 ; /* RamAHB16 */ +__base_RAM4 = 0x20008000 ; /* RAM4 */ +__top_RamAHB16 = 0x20008000 + 0x4000 ; /* 16K bytes */ +__top_RAM4 = 0x20008000 + 0x4000 ; /* 16K bytes */ +__base_RamAHB_ETB16 = 0x2000c000 ; /* RamAHB_ETB16 */ +__base_RAM5 = 0x2000c000 ; /* RAM5 */ +__top_RamAHB_ETB16 = 0x2000c000 + 0x4000 ; /* 16K bytes */ +__top_RAM5 = 0x2000c000 + 0x4000 ; /* 16K bytes */ ENTRY(ResetISR) diff --git a/hw/bsp/lpc18/family.c b/hw/bsp/lpc18/family.c index 441e98028..d74ebcd33 100644 --- a/hw/bsp/lpc18/family.c +++ b/hw/bsp/lpc18/family.c @@ -62,41 +62,6 @@ void USB1_IRQHandler(void) const uint32_t OscRateIn = 12000000; const uint32_t ExtRateIn = 0; -static const PINMUX_GRP_T pinmuxing[] = -{ - // LEDs - { 0xD, 10, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4) }, - { 0xD, 11, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, - { 0xD, 12, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, - { 0xD, 13, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, - { 0xD, 14, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC4 | SCU_MODE_PULLDOWN) }, - { 0x9, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, - { 0x9, 1, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, - { 0x9, 2, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLDOWN) }, - - // Button - { 0x4, 0, (SCU_MODE_INBUFF_EN | SCU_MODE_INACT | SCU_MODE_FUNC0 | SCU_MODE_PULLUP) }, - - // UART - { UART_PORT, UART_PIN_TX, SCU_MODE_PULLDOWN | SCU_MODE_FUNC2 }, - { UART_PORT, UART_PIN_RX, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, - - // USB0 - { 0x6, 3, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC1 }, // P6_3 USB0_PWR_EN, USB0 VBus function - - { 0x9, 5, SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_FUNC2 }, // P9_5 USB1_VBUS_EN, USB1 VBus function - { 0x2, 5, SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC2 }, // P2_5 USB1_VBUS, MUST CONFIGURE THIS SIGNAL FOR USB1 NORMAL OPERATION -}; - -/* Pin clock mux values, re-used structure, value in first index is meaningless */ -static const PINMUX_GRP_T pinclockmuxing[] = -{ - { 0, 0, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, - { 0, 1, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, - { 0, 2, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, - { 0, 3, (SCU_MODE_INACT | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_HIGHSPEEDSLEW_EN | SCU_MODE_FUNC0)}, -}; - // Invoked by startup code void SystemInit(void) { @@ -106,15 +71,7 @@ void SystemInit(void) *pSCB_VTOR = (unsigned int) g_pfnVectors; #endif - /* Setup system level pin muxing */ - Chip_SCU_SetPinMuxing(pinmuxing, sizeof(pinmuxing) / sizeof(PINMUX_GRP_T)); - - /* Clock pins only, group field not used */ - for (uint32_t i = 0; i < (sizeof(pinclockmuxing) / sizeof(pinclockmuxing[0])); i++) - { - Chip_SCU_ClockPinMuxSet(pinclockmuxing[i].pinnum, pinclockmuxing[i].modefunc); - } - + board_lpc18_pinmux(); Chip_SetupXtalClocking(); } diff --git a/hw/bsp/lpc18/family.mk b/hw/bsp/lpc18/family.mk index 9d10d4c7e..c9c4ce83a 100644 --- a/hw/bsp/lpc18/family.mk +++ b/hw/bsp/lpc18/family.mk @@ -36,6 +36,3 @@ CHIP_FAMILY = transdimension # For freeRTOS port source FREERTOS_PORT = ARM_CM3 - -# flash using jlink -flash: flash-jlink -- cgit v1.3.1 From 5d226ee733cd6de950a98f16238904ca6d351ca9 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 3 Mar 2021 20:22:55 +0700 Subject: add h745disco to family group --- .github/workflows/build.yml | 1 + hw/bsp/stm32h7/boards/stm32h745disco/board.h | 134 +++++++ hw/bsp/stm32h7/boards/stm32h745disco/board.mk | 17 + hw/bsp/stm32h7/family.c | 7 +- hw/bsp/stm32h745disco/STM32H74xXIHx_FLASH.ld | 173 --------- hw/bsp/stm32h745disco/board.mk | 58 ---- hw/bsp/stm32h745disco/stm32h745disco.c | 398 --------------------- hw/bsp/stm32h745disco/stm32h7xx_hal_conf.h | 482 -------------------------- 8 files changed, 157 insertions(+), 1113 deletions(-) create mode 100644 hw/bsp/stm32h7/boards/stm32h745disco/board.h create mode 100644 hw/bsp/stm32h7/boards/stm32h745disco/board.mk delete mode 100644 hw/bsp/stm32h745disco/STM32H74xXIHx_FLASH.ld delete mode 100644 hw/bsp/stm32h745disco/board.mk delete mode 100644 hw/bsp/stm32h745disco/stm32h745disco.c delete mode 100644 hw/bsp/stm32h745disco/stm32h7xx_hal_conf.h (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2413eaf54..771a49417 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,7 @@ jobs: - 'samd51' - 'stm32f4' - 'stm32f7' + - 'stm32h7' steps: - name: Setup Python uses: actions/setup-python@v2 diff --git a/hw/bsp/stm32h7/boards/stm32h745disco/board.h b/hw/bsp/stm32h7/boards/stm32h745disco/board.h new file mode 100644 index 000000000..30a7a9ff6 --- /dev/null +++ b/hw/bsp/stm32h7/boards/stm32h745disco/board.h @@ -0,0 +1,134 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2021, Ha Thach (tinyusb.org) + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * This file is part of the TinyUSB stack. + */ + +#ifndef BOARD_H_ +#define BOARD_H_ + +#ifdef __cplusplus + extern "C" { +#endif + +#define LED_PORT GPIOJ +#define LED_PIN GPIO_PIN_2 +#define LED_STATE_ON 1 + +// Blue push-button +#define BUTTON_PORT GPIOC +#define BUTTON_PIN GPIO_PIN_13 +#define BUTTON_STATE_ACTIVE 1 + +// UART +#define UART_DEV USART3 +#define UART_CLK_EN __HAL_RCC_USART3_CLK_ENABLE +#define UART_GPIO_PORT GPIOB +#define UART_GPIO_AF GPIO_AF7_USART3 +#define UART_TX_PIN GPIO_PIN_10 +#define UART_RX_PIN GPIO_PIN_11 + +// VBUS Sense detection +#define OTG_FS_VBUS_SENSE 1 +#define OTG_HS_VBUS_SENSE 0 + +//--------------------------------------------------------------------+ +// RCC Clock +//--------------------------------------------------------------------+ +static inline void board_stm32h7_clock_init(void) +{ + RCC_ClkInitTypeDef RCC_ClkInitStruct; + RCC_OscInitTypeDef RCC_OscInitStruct; + RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; + + /*!< Supply configuration update enable */ + /* For STM32H750XB, use "HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);" */ + HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY); + + /* The voltage scaling allows optimizing the power consumption when the + device is clocked below the maximum system frequency, to update the + voltage scaling value regarding system frequency refer to product + datasheet. */ + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); + + while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) {} + + /* Enable HSE Oscillator and activate PLL with HSE as source */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.HSIState = RCC_HSI_OFF; + RCC_OscInitStruct.CSIState = RCC_CSI_OFF; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + + /* PLL1 for System Clock */ + RCC_OscInitStruct.PLL.PLLM = 5; + RCC_OscInitStruct.PLL.PLLN = 160; + RCC_OscInitStruct.PLL.PLLFRACN = 0; + RCC_OscInitStruct.PLL.PLLP = 2; + RCC_OscInitStruct.PLL.PLLR = 2; + RCC_OscInitStruct.PLL.PLLQ = 4; + + RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; + RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2; + HAL_RCC_OscConfig(&RCC_OscInitStruct); + + /* PLL3 for USB Clock */ + PeriphClkInitStruct.PLL3.PLL3M = 25; + PeriphClkInitStruct.PLL3.PLL3N = 336; + PeriphClkInitStruct.PLL3.PLL3FRACN = 0; + PeriphClkInitStruct.PLL3.PLL3P = 2; + PeriphClkInitStruct.PLL3.PLL3R = 2; + PeriphClkInitStruct.PLL3.PLL3Q = 7; + + PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; + PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3; + HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); + + /* Select PLL as system clock source and configure bus clocks dividers */ + RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | \ + RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1); + + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; + RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; + RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; + RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1; + HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); + + /*activate CSI clock mondatory for I/O Compensation Cell*/ + __HAL_RCC_CSI_ENABLE() ; + + /* Enable SYSCFG clock mondatory for I/O Compensation Cell */ + __HAL_RCC_SYSCFG_CLK_ENABLE() ; + + /* Enables the I/O Compensation Cell */ + HAL_EnableCompensationCell(); +} + +#ifdef __cplusplus + } +#endif + +#endif diff --git a/hw/bsp/stm32h7/boards/stm32h745disco/board.mk b/hw/bsp/stm32h7/boards/stm32h745disco/board.mk new file mode 100644 index 000000000..384065bde --- /dev/null +++ b/hw/bsp/stm32h7/boards/stm32h745disco/board.mk @@ -0,0 +1,17 @@ +# STM32H745I-DISCO uses OTG_FS +# FIXME: Reset enumerates, un/replug USB plug does not enumerate + +CFLAGS += -DSTM32H745xx -DCORE_CM7 -DHSE_VALUE=25000000 + +# Default is FulSpeed port +PORT ?= 0 + +SRC_S += $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h745xx.s +LD_FILE = $(ST_CMSIS)/Source/Templates/gcc/linker/stm32h745xx_flash_CM7.ld + +# For flash-jlink target +JLINK_DEVICE = stm32h745xi_m7 + +# flash target using on-board stlink +flash: flash-stlink + diff --git a/hw/bsp/stm32h7/family.c b/hw/bsp/stm32h7/family.c index ad17bb9ed..e94e5c974 100644 --- a/hw/bsp/stm32h7/family.c +++ b/hw/bsp/stm32h7/family.c @@ -1,8 +1,10 @@ /* * The MIT License (MIT) * - * Copyright (c) 2019 William D. Jones (thor0505@comcast.net), - * Ha Thach (tinyusb.org) + * Copyright (c) 2019 + * William D. Jones (thor0505@comcast.net), + * Ha Thach (tinyusb.org) + * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -68,6 +70,7 @@ void board_init(void) __HAL_RCC_GPIOG_CLK_ENABLE(); __HAL_RCC_GPIOH_CLK_ENABLE(); // USB ULPI NXT __HAL_RCC_GPIOI_CLK_ENABLE(); // USB ULPI NXT + __HAL_RCC_GPIOJ_CLK_ENABLE(); UART_CLK_EN(); diff --git a/hw/bsp/stm32h745disco/STM32H74xXIHx_FLASH.ld b/hw/bsp/stm32h745disco/STM32H74xXIHx_FLASH.ld deleted file mode 100644 index 59b9ff4df..000000000 --- a/hw/bsp/stm32h745disco/STM32H74xXIHx_FLASH.ld +++ /dev/null @@ -1,173 +0,0 @@ -/* -***************************************************************************** -** - -** File : LinkerScript.ld -** -** Abstract : Linker script for STM32H743XIHx Device with -** 2048KByte FLASH, 128KByte RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -** (c)Copyright Ac6. -** You may use this file as-is or modify it according to the needs of your -** project. Distribution of this file (unmodified or modified) is not -** permitted. Ac6 permit registered System Workbench for MCU users the -** rights to distribute the assembled, compiled & linked contents of this -** file as part of an application binary file, provided that it is built -** using the System Workbench for MCU toolchain. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20020000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K -RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K -RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K -ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 2048K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >DTCMRAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >DTCMRAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >DTCMRAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/hw/bsp/stm32h745disco/board.mk b/hw/bsp/stm32h745disco/board.mk deleted file mode 100644 index 78f22a5a2..000000000 --- a/hw/bsp/stm32h745disco/board.mk +++ /dev/null @@ -1,58 +0,0 @@ -# STM32H745I-DISCO uses OTG_FS -# FIXME: Reset enumerates, un/replug USB plug does not enumerate - -CFLAGS += \ - -flto \ - -mthumb \ - -mabi=aapcs \ - -mcpu=cortex-m7 \ - -mfloat-abi=hard \ - -mfpu=fpv5-d16 \ - -nostdlib -nostartfiles \ - -DSTM32H745xx \ - -DCORE_CM7 \ - -DCFG_TUSB_MCU=OPT_MCU_STM32H7 \ - -DBOARD_DEVICE_RHPORT_NUM=0 \ - -DBOARD_DEVICE_RHPORT_SPEED=OPT_MODE_FULL_SPEED - -# suppress warning caused by vendor mcu driver -CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align - -ST_FAMILY = h7 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - -# All source paths should be relative to the top level. -LD_FILE = hw/bsp/$(BOARD)/STM32H74xXIHx_FLASH.ld - -SRC_C += \ - $(ST_CMSIS)/Source/Templates/system_stm32$(ST_FAMILY)xx.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_cortex.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_rcc_ex.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_gpio.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_uart.c \ - $(ST_HAL_DRIVER)/Src/stm32$(ST_FAMILY)xx_hal_pwr_ex.c - -SRC_S += \ - $(ST_CMSIS)/Source/Templates/gcc/startup_stm32h745xx.s - -INC += \ - $(TOP)/lib/CMSIS_5/CMSIS/Core/Include \ - $(TOP)/$(ST_CMSIS)/Include \ - $(TOP)/$(ST_HAL_DRIVER)/Inc \ - $(TOP)/hw/bsp/$(BOARD) - -# For TinyUSB port source -VENDOR = st -CHIP_FAMILY = synopsys - -# For freeRTOS port source -FREERTOS_PORT = ARM_CM7/r0p1 - -# For flash-jlink target -JLINK_DEVICE = stm32h745xi - -# flash target using on-board stlink -flash: flash-stlink diff --git a/hw/bsp/stm32h745disco/stm32h745disco.c b/hw/bsp/stm32h745disco/stm32h745disco.c deleted file mode 100644 index d4fcdbfc0..000000000 --- a/hw/bsp/stm32h745disco/stm32h745disco.c +++ /dev/null @@ -1,398 +0,0 @@ -/* - * The MIT License (MIT) - * - * Copyright (c) 2019 William D. Jones (thor0505@comcast.net), - * Ha Thach (tinyusb.org) - * Uwe Bonnes (bon@elektron.ikp.physik.tu-darmstadt.de - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * This file is part of the TinyUSB stack. - */ - -#include "../board.h" - -#include "stm32h7xx_hal.h" - -//--------------------------------------------------------------------+ -// Forward USB interrupt events to TinyUSB IRQ Handler -//--------------------------------------------------------------------+ - -// Despite being call USB2_OTG -// OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port -void OTG_FS_IRQHandler(void) -{ - tud_int_handler(0); -} - -// Despite being call USB2_OTG -// OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port -void OTG_HS_IRQHandler(void) -{ - tud_int_handler(1); -} - - -//--------------------------------------------------------------------+ -// MACRO TYPEDEF CONSTANT ENUM -//--------------------------------------------------------------------+ - -#define LED_PORT GPIOJ -#define LED_PIN GPIO_PIN_2 -#define LED_STATE_ON 1 - -// Blue push-button -#define BUTTON_PORT GPIOC -#define BUTTON_PIN GPIO_PIN_13 -#define BUTTON_STATE_ACTIVE 1 - -// UART -#define UARTx USART3 -#define UART_GPIO_PORT GPIOB -#define UART_GPIO_AF GPIO_AF7_USART3 -#define UART_TX_PIN GPIO_PIN_10 -#define UART_RX_PIN GPIO_PIN_11 - -UART_HandleTypeDef UartHandle; - -// enable all LED, Button, Uart, USB clock -static void all_rcc_clk_enable(void) -{ - __HAL_RCC_GPIOA_CLK_ENABLE(); // OTG_FS - __HAL_RCC_GPIOB_CLK_ENABLE(); // USART3 (VCP - __HAL_RCC_GPIOC_CLK_ENABLE(); // Button - __HAL_RCC_GPIOJ_CLK_ENABLE(); // LED - __HAL_RCC_USART3_CLK_ENABLE(); // Uart module -} - -/* PWR, RCC, GPIO (All): AHB4 (D3 domain) - USB{1,2} OTG_{H,F}S: AHB1 (D2 domain) -*/ - -/** - * @brief System Clock Configuration - * The system Clock is configured as follow : - * System Clock source = PLL (HSE) - * SYSCLK(Hz) = 400000000 (CPU Clock) - * HCLK(Hz) = 200000000 (AXI and AHBs Clock) - * AHB Prescaler = 2 - * D1 APB3 Prescaler = 2 (APB3 Clock 100MHz) - * D2 APB1 Prescaler = 2 (APB1 Clock 100MHz) - * D2 APB2 Prescaler = 2 (APB2 Clock 100MHz) - * D3 APB4 Prescaler = 2 (APB4 Clock 100MHz) - * HSE Frequency(Hz) = 25000000 - * PLL_M = 5 - * PLL_N = 160 - * PLL_P = 2 - * PLL_Q = 4 - * PLL_R = 2 - * PLL3_M = 25 - * PLL3_N = 336 - * PLL3_P = 2 - * PLL3_Q = 7 - * PLL3_R = 2 - * VDD(V) = 3.3 - * Flash Latency(WS) = 4 - * @param None - * @retval None - */ - -void SystemClock_Config(void) -{ - RCC_ClkInitTypeDef RCC_ClkInitStruct; - RCC_OscInitTypeDef RCC_OscInitStruct; - RCC_PeriphCLKInitTypeDef PeriphClkInitStruct; - - /*!< Supply configuration update enable */ - /* For STM32H750XB, use "HAL_PWREx_ConfigSupply(PWR_LDO_SUPPLY);" */ - HAL_PWREx_ConfigSupply(PWR_DIRECT_SMPS_SUPPLY); - - /* The voltage scaling allows optimizing the power consumption when the - device is clocked below the maximum system frequency, to update the - voltage scaling value regarding system frequency refer to product - datasheet. */ - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); - - while ((PWR->D3CR & (PWR_D3CR_VOSRDY)) != PWR_D3CR_VOSRDY) {} - - /* Enable HSE Oscillator and activate PLL with HSE as source */ - RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; - RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; - RCC_OscInitStruct.HSIState = RCC_HSI_OFF; - RCC_OscInitStruct.CSIState = RCC_CSI_OFF; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; - - /* PLL1 for System Clock */ - RCC_OscInitStruct.PLL.PLLM = 5; - RCC_OscInitStruct.PLL.PLLN = 160; - RCC_OscInitStruct.PLL.PLLFRACN = 0; - RCC_OscInitStruct.PLL.PLLP = 2; - RCC_OscInitStruct.PLL.PLLR = 2; - RCC_OscInitStruct.PLL.PLLQ = 4; - - RCC_OscInitStruct.PLL.PLLVCOSEL = RCC_PLL1VCOMEDIUM; - RCC_OscInitStruct.PLL.PLLRGE = RCC_PLL1VCIRANGE_2; - HAL_RCC_OscConfig(&RCC_OscInitStruct); - - /* PLL3 for USB Clock */ - PeriphClkInitStruct.PLL3.PLL3M = 25; - PeriphClkInitStruct.PLL3.PLL3N = 336; - PeriphClkInitStruct.PLL3.PLL3FRACN = 0; - PeriphClkInitStruct.PLL3.PLL3P = 2; - PeriphClkInitStruct.PLL3.PLL3R = 2; - PeriphClkInitStruct.PLL3.PLL3Q = 7; - - PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USB; - PeriphClkInitStruct.UsbClockSelection = RCC_USBCLKSOURCE_PLL3; - HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct); - - /* Select PLL as system clock source and configure bus clocks dividers */ - RCC_ClkInitStruct.ClockType = (RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_D1PCLK1 | RCC_CLOCKTYPE_PCLK1 | \ - RCC_CLOCKTYPE_PCLK2 | RCC_CLOCKTYPE_D3PCLK1); - - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.SYSCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.AHBCLKDivider = RCC_HCLK_DIV2; - RCC_ClkInitStruct.APB1CLKDivider = RCC_APB1_DIV2; - RCC_ClkInitStruct.APB2CLKDivider = RCC_APB2_DIV2; - RCC_ClkInitStruct.APB3CLKDivider = RCC_APB3_DIV1; - HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_4); - - /*activate CSI clock mondatory for I/O Compensation Cell*/ - __HAL_RCC_CSI_ENABLE() ; - - /* Enable SYSCFG clock mondatory for I/O Compensation Cell */ - __HAL_RCC_SYSCFG_CLK_ENABLE() ; - - /* Enables the I/O Compensation Cell */ - HAL_EnableCompensationCell(); -} - -void board_init(void) -{ - SystemClock_Config(); - all_rcc_clk_enable(); - - // 1ms tick timer - SysTick_Config(SystemCoreClock / 1000); - -#if CFG_TUSB_OS == OPT_OS_FREERTOS - // If freeRTOS is used, IRQ priority is limit by max syscall ( smaller is higher ) - NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); - NVIC_SetPriority(OTG_HS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY ); -#endif - - GPIO_InitTypeDef GPIO_InitStruct; - - // LED - GPIO_InitStruct.Pin = LED_PIN; - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - HAL_GPIO_Init(LED_PORT, &GPIO_InitStruct); - - // Button - GPIO_InitStruct.Pin = BUTTON_PIN; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - HAL_GPIO_Init(BUTTON_PORT, &GPIO_InitStruct); - - // Uart - GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = UART_GPIO_AF; - HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct); - - UartHandle.Instance = UARTx; - UartHandle.Init.BaudRate = CFG_BOARD_UART_BAUDRATE; - UartHandle.Init.WordLength = UART_WORDLENGTH_8B; - UartHandle.Init.StopBits = UART_STOPBITS_1; - UartHandle.Init.Parity = UART_PARITY_NONE; - UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE; - UartHandle.Init.Mode = UART_MODE_TX_RX; - UartHandle.Init.OverSampling = UART_OVERSAMPLING_16; - HAL_UART_Init(&UartHandle); - -#if BOARD_DEVICE_RHPORT_NUM == 0 - // Despite being call USB2_OTG - // OTG_FS is marked as RHPort0 by TinyUSB to be consistent across stm32 port - // PA9 VUSB, PA10 ID, PA11 DM, PA12 DP - - __HAL_RCC_GPIOA_CLK_ENABLE(); - - /* Configure DM DP Pins */ - GPIO_InitStruct.Pin = GPIO_PIN_11 | GPIO_PIN_12; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* Configure VBUS Pin */ - GPIO_InitStruct.Pin = GPIO_PIN_9; - GPIO_InitStruct.Mode = GPIO_MODE_INPUT; - GPIO_InitStruct.Pull = GPIO_NOPULL; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* This for ID line debug */ - GPIO_InitStruct.Pin = GPIO_PIN_10; - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG1_FS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - // https://community.st.com/s/question/0D50X00009XkYZLSA3/stm32h7-nucleo-usb-fs-cdc - HAL_PWREx_EnableUSBVoltageDetector(); - __HAL_RCC_USB2_OTG_FS_CLK_ENABLE(); - - // Enable VBUS sense (B device) via pin PA9 - USB_OTG_FS->GCCFG |= USB_OTG_GCCFG_VBDEN; - -#elif BOARD_DEVICE_RHPORT_NUM == 1 - - // Despite being call USB2_OTG - // OTG_HS is marked as RHPort1 by TinyUSB to be consistent across stm32 port - __GPIOA_CLK_ENABLE(); - __GPIOB_CLK_ENABLE(); - __GPIOC_CLK_ENABLE(); - __GPIOH_CLK_ENABLE(); - __GPIOI_CLK_ENABLE(); - - /* CLK */ - GPIO_InitStruct.Pin = GPIO_PIN_5; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* D0 */ - GPIO_InitStruct.Pin = GPIO_PIN_3; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOA, &GPIO_InitStruct); - - /* D1 D2 D3 D4 D5 D6 D7 */ - GPIO_InitStruct.Pin = GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_5 | GPIO_PIN_10 | GPIO_PIN_11 | GPIO_PIN_12 | GPIO_PIN_13; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOB, &GPIO_InitStruct); - - /* STP */ - GPIO_InitStruct.Pin = GPIO_PIN_0; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); - - /* NXT */ - GPIO_InitStruct.Pin = GPIO_PIN_4; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOH, &GPIO_InitStruct); - - /* DIR */ - GPIO_InitStruct.Pin = GPIO_PIN_11; - GPIO_InitStruct.Mode = GPIO_MODE_AF_PP; - GPIO_InitStruct.Pull = GPIO_NOPULL; - GPIO_InitStruct.Alternate = GPIO_AF10_OTG2_HS; - HAL_GPIO_Init(GPIOI, &GPIO_InitStruct); - - // Enable ULPI clock - __HAL_RCC_USB1_OTG_HS_ULPI_CLK_ENABLE(); - - /* Enable USB HS Clocks */ - __HAL_RCC_USB1_OTG_HS_CLK_ENABLE(); - - // No VBUS sense - USB_OTG_HS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; - - // B-peripheral session valid override enable - USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOEN; - USB_OTG_HS->GOTGCTL |= USB_OTG_GOTGCTL_BVALOVAL; - - // Force device mode - USB_OTG_HS->GUSBCFG &= ~USB_OTG_GUSBCFG_FHMOD; - USB_OTG_HS->GUSBCFG |= USB_OTG_GUSBCFG_FDMOD; - - HAL_PWREx_EnableUSBVoltageDetector(); -#endif // rhport = 1 - -} - -//--------------------------------------------------------------------+ -// Board porting API -//--------------------------------------------------------------------+ - -void board_led_write(bool state) -{ - HAL_GPIO_WritePin(LED_PORT, LED_PIN, state); -} - -uint32_t board_button_read(void) -{ - return (BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN)) ? 1 : 0; -} - -int board_uart_read(uint8_t* buf, int len) -{ - (void) buf; (void) len; - return 0; -} - -int board_uart_write(void const * buf, int len) -{ - HAL_UART_Transmit(&UartHandle, (uint8_t*) buf, len, 0xffff); - return len; -} - - -#if CFG_TUSB_OS == OPT_OS_NONE -volatile uint32_t system_ticks = 0; -void SysTick_Handler (void) -{ - system_ticks++; -} - -uint32_t board_millis(void) -{ - return system_ticks; -} -#endif - -void HardFault_Handler (void) -{ - asm("bkpt"); -} - -// Required by __libc_init_array in startup code if we are compiling using -// -nostdlib/-nostartfiles. -void _init(void) -{ - -} diff --git a/hw/bsp/stm32h745disco/stm32h7xx_hal_conf.h b/hw/bsp/stm32h745disco/stm32h7xx_hal_conf.h deleted file mode 100644 index b9fa348ec..000000000 --- a/hw/bsp/stm32h745disco/stm32h7xx_hal_conf.h +++ /dev/null @@ -1,482 +0,0 @@ -/** - ****************************************************************************** - * @file stm32h7xx_hal_conf_template.h - * @brief HAL configuration template file. - * This file should be copied to the application folder and renamed - * to stm32h7xx_hal_conf.h. - ****************************************************************************** - * @attention - * - *

© COPYRIGHT(c) 2019 STMicroelectronics

- * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - ****************************************************************************** - */ - -/* Define to prevent recursive inclusion -------------------------------------*/ -#ifndef __STM32H7xx_HAL_CONF_H -#define __STM32H7xx_HAL_CONF_H - -#ifdef __cplusplus - extern "C" { -#endif - -/* Exported types ------------------------------------------------------------*/ -/* Exported constants --------------------------------------------------------*/ - -/* ########################## Module Selection ############################## */ -/** - * @brief This is the list of modules to be used in the HAL driver - */ -#define HAL_MODULE_ENABLED -#define HAL_ADC_MODULE_ENABLED -/* #define HAL_CEC_MODULE_ENABLED */ -/* #define HAL_COMP_MODULE_ENABLED */ -#define HAL_CORTEX_MODULE_ENABLED -/* #define HAL_CRC_MODULE_ENABLED */ -/* #define HAL_CRYP_MODULE_ENABLED */ -/* #define HAL_DAC_MODULE_ENABLED */ -/* #define HAL_DCMI_MODULE_ENABLED */ -/* #define HAL_DFSDM_MODULE_ENABLED */ -#define HAL_DMA_MODULE_ENABLED -/* #define HAL_DMA2D_MODULE_ENABLED */ -/* #define HAL_ETH_MODULE_ENABLED */ -/* #define HAL_EXTI_MODULE_ENABLED */ -/* #define HAL_FDCAN_MODULE_ENABLED */ -#define HAL_FLASH_MODULE_ENABLED -#define HAL_GPIO_MODULE_ENABLED -/* #define HAL_HASH_MODULE_ENABLED */ -/* #define HAL_HCD_MODULE_ENABLED */ -/* #define HAL_HRTIM_MODULE_ENABLED */ -/* #define HAL_HSEM_MODULE_ENABLED */ -/* #define HAL_I2C_MODULE_ENABLED */ -/* #define HAL_I2S_MODULE_ENABLED */ -/* #define HAL_IRDA_MODULE_ENABLED */ -/* #define HAL_IWDG_MODULE_ENABLED */ -/* #define HAL_JPEG_MODULE_ENABLED */ -/* #define HAL_LPTIM_MODULE_ENABLED */ -/* #define HAL_LTDC_MODULE_ENABLED */ -/* #define HAL_MDIOS_MODULE_ENABLED */ -/* #define HAL_MDMA_MODULE_ENABLED */ -/* #define HAL_MMC_MODULE_ENABLED */ -/* #define HAL_NAND_MODULE_ENABLED */ -/* #define HAL_NOR_MODULE_ENABLED */ -/* #define HAL_OPAMP_MODULE_ENABLED */ -/* #define HAL_PCD_MODULE_ENABLED */ -#define HAL_PWR_MODULE_ENABLED -/* #define HAL_QSPI_MODULE_ENABLED */ -/* #define HAL_RAMECC_MODULE_ENABLED */ -#define HAL_RCC_MODULE_ENABLED -/* #define HAL_RNG_MODULE_ENABLED */ -/* #define HAL_RTC_MODULE_ENABLED */ -/* #define HAL_SAI_MODULE_ENABLED */ -/* #define HAL_SD_MODULE_ENABLED */ -/* #define HAL_SDRAM_MODULE_ENABLED */ -/* #define HAL_SMARTCARD_MODULE_ENABLED */ -/* #define HAL_SMBUS_MODULE_ENABLED */ -/* #define HAL_SPDIFRX_MODULE_ENABLED */ -#define HAL_SPI_MODULE_ENABLED -/* #define HAL_SRAM_MODULE_ENABLED */ -/* #define HAL_SWPMI_MODULE_ENABLED */ -/* #define HAL_TIM_MODULE_ENABLED */ -#define HAL_UART_MODULE_ENABLED -/* #define HAL_USART_MODULE_ENABLED */ -/* #define HAL_WWDG_MODULE_ENABLED */ - -/* ########################## Oscillator Values adaptation ####################*/ -/** - * @brief Adjust the value of External High Speed oscillator (HSE) used in your application. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSE is used as system clock source, directly or through the PLL). - */ -#if !defined (HSE_VALUE) -#define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */ -#endif /* HSE_VALUE */ - -#if !defined (HSE_STARTUP_TIMEOUT) - #define HSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for HSE start up, in ms */ -#endif /* HSE_STARTUP_TIMEOUT */ - -/** - * @brief Internal oscillator (CSI) default value. - * This value is the default CSI value after Reset. - */ -#if !defined (CSI_VALUE) - #define CSI_VALUE ((uint32_t)4000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* CSI_VALUE */ - -/** - * @brief Internal High Speed oscillator (HSI) value. - * This value is used by the RCC HAL module to compute the system frequency - * (when HSI is used as system clock source, directly or through the PLL). - */ -#if !defined (HSI_VALUE) - #define HSI_VALUE ((uint32_t)64000000) /*!< Value of the Internal oscillator in Hz*/ -#endif /* HSI_VALUE */ - -/** - * @brief External Low Speed oscillator (LSE) value. - * This value is used by the UART, RTC HAL module to compute the system frequency - */ -#if !defined (LSE_VALUE) - #define LSE_VALUE ((uint32_t)32768) /*!< Value of the External oscillator in Hz*/ -#endif /* LSE_VALUE */ - - -#if !defined (LSE_STARTUP_TIMEOUT) - #define LSE_STARTUP_TIMEOUT ((uint32_t)5000) /*!< Time out for LSE start up, in ms */ -#endif /* LSE_STARTUP_TIMEOUT */ - -#if !defined (LSI_VALUE) - #define LSI_VALUE ((uint32_t)32000) /*!< LSI Typical Value in Hz*/ -#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz - The real value may vary depending on the variations - in voltage and temperature.*/ - -/** - * @brief External clock source for I2S peripheral - * This value is used by the I2S HAL module to compute the I2S clock source - * frequency, this source is inserted directly through I2S_CKIN pad. - */ -#if !defined (EXTERNAL_CLOCK_VALUE) - #define EXTERNAL_CLOCK_VALUE 12288000U /*!< Value of the External clock in Hz*/ -#endif /* EXTERNAL_CLOCK_VALUE */ - -/* Tip: To avoid modifying this file each time you need to use different HSE, - === you can define the HSE value in your toolchain compiler preprocessor. */ - -/* ########################### System Configuration ######################### */ -/** - * @brief This is the HAL system configuration section - */ -#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */ -#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */ -#define USE_RTOS 0 -#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */ -#define USE_SPI_CRC 1U /*!< use CRC in SPI */ - -#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */ -#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */ -#define USE_HAL_COMP_REGISTER_CALLBACKS 0U /* COMP register callback disabled */ -#define USE_HAL_CRYP_REGISTER_CALLBACKS 0U /* CRYP register callback disabled */ -#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */ -#define USE_HAL_DCMI_REGISTER_CALLBACKS 0U /* DCMI register callback disabled */ -#define USE_HAL_DFSDM_REGISTER_CALLBACKS 0U /* DFSDM register callback disabled */ -#define USE_HAL_DMA2D_REGISTER_CALLBACKS 0U /* DMA2D register callback disabled */ -#define USE_HAL_DSI_REGISTER_CALLBACKS 0U /* DSI register callback disabled */ -#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */ -#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0U /* FDCAN register callback disabled */ -#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */ -#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */ -#define USE_HAL_SDRAM_REGISTER_CALLBACKS 0U /* SDRAM register callback disabled */ -#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */ -#define USE_HAL_HASH_REGISTER_CALLBACKS 0U /* HASH register callback disabled */ -#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */ -#define USE_HAL_HRTIM_REGISTER_CALLBACKS 0U /* HRTIM register callback disabled */ -#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */ -#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */ -#define USE_HAL_JPEG_REGISTER_CALLBACKS 0U /* JPEG register callback disabled */ -#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0U /* LPTIM register callback disabled */ -#define USE_HAL_LTDC_REGISTER_CALLBACKS 0U /* LTDC register callback disabled */ -#define USE_HAL_MDIOS_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ -#define USE_HAL_OPAMP_REGISTER_CALLBACKS 0U /* MDIO register callback disabled */ -#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */ -#define USE_HAL_QSPI_REGISTER_CALLBACKS 0U /* QSPI register callback disabled */ -#define USE_HAL_RNG_REGISTER_CALLBACKS 0U /* RNG register callback disabled */ -#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */ -#define USE_HAL_SAI_REGISTER_CALLBACKS 0U /* SAI register callback disabled */ -#define USE_HAL_SPDIFRX_REGISTER_CALLBACKS 0U /* SPDIFRX register callback disabled */ -#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0U /* SMBUS register callback disabled */ -#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */ -#define USE_HAL_SWPMI_REGISTER_CALLBACKS 0U /* SWPMI register callback disabled */ -#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */ -#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */ -#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */ -#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */ - -/* ########################### Ethernet Configuration ######################### */ -#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */ -#define ETH_RX_DESC_CNT 4 /* number of Ethernet Rx DMA descriptors */ - -#define ETH_MAC_ADDR0 ((uint8_t)0x02) -#define ETH_MAC_ADDR1 ((uint8_t)0x00) -#define ETH_MAC_ADDR2 ((uint8_t)0x00) -#define ETH_MAC_ADDR3 ((uint8_t)0x00) -#define ETH_MAC_ADDR4 ((uint8_t)0x00) -#define ETH_MAC_ADDR5 ((uint8_t)0x00) - -/* ########################## Assert Selection ############################## */ -/** - * @brief Uncomment the line below to expanse the "assert_param" macro in the - * HAL drivers code - */ -/* #define USE_FULL_ASSERT 1 */ - - -/* Includes ------------------------------------------------------------------*/ -/** - * @brief Include module's header file - */ - -#ifdef HAL_RCC_MODULE_ENABLED - #include "stm32h7xx_hal_rcc.h" -#endif /* HAL_RCC_MODULE_ENABLED */ - -#ifdef HAL_GPIO_MODULE_ENABLED - #include "stm32h7xx_hal_gpio.h" -#endif /* HAL_GPIO_MODULE_ENABLED */ - -#ifdef HAL_DMA_MODULE_ENABLED - #include "stm32h7xx_hal_dma.h" -#endif /* HAL_DMA_MODULE_ENABLED */ - -#ifdef HAL_MDMA_MODULE_ENABLED - #include "stm32h7xx_hal_mdma.h" -#endif /* HAL_MDMA_MODULE_ENABLED */ - -#ifdef HAL_HASH_MODULE_ENABLED - #include "stm32h7xx_hal_hash.h" -#endif /* HAL_HASH_MODULE_ENABLED */ - -#ifdef HAL_DCMI_MODULE_ENABLED - #include "stm32h7xx_hal_dcmi.h" -#endif /* HAL_DCMI_MODULE_ENABLED */ - -#ifdef HAL_DMA2D_MODULE_ENABLED - #include "stm32h7xx_hal_dma2d.h" -#endif /* HAL_DMA2D_MODULE_ENABLED */ - -#ifdef HAL_DSI_MODULE_ENABLED - #include "stm32h7xx_hal_dsi.h" -#endif /* HAL_DSI_MODULE_ENABLED */ - -#ifdef HAL_DFSDM_MODULE_ENABLED - #include "stm32h7xx_hal_dfsdm.h" -#endif /* HAL_DFSDM_MODULE_ENABLED */ - -#ifdef HAL_ETH_MODULE_ENABLED - #include "stm32h7xx_hal_eth.h" -#endif /* HAL_ETH_MODULE_ENABLED */ - -#ifdef HAL_EXTI_MODULE_ENABLED - #include "stm32h7xx_hal_exti.h" -#endif /* HAL_EXTI_MODULE_ENABLED */ - -#ifdef HAL_CORTEX_MODULE_ENABLED - #include "stm32h7xx_hal_cortex.h" -#endif /* HAL_CORTEX_MODULE_ENABLED */ - -#ifdef HAL_ADC_MODULE_ENABLED - #include "stm32h7xx_hal_adc.h" -#endif /* HAL_ADC_MODULE_ENABLED */ - -#ifdef HAL_FDCAN_MODULE_ENABLED - #include "stm32h7xx_hal_fdcan.h" -#endif /* HAL_FDCAN_MODULE_ENABLED */ - -#ifdef HAL_CEC_MODULE_ENABLED - #include "stm32h7xx_hal_cec.h" -#endif /* HAL_CEC_MODULE_ENABLED */ - -#ifdef HAL_COMP_MODULE_ENABLED - #include "stm32h7xx_hal_comp.h" -#endif /* HAL_COMP_MODULE_ENABLED */ - -#ifdef HAL_CRC_MODULE_ENABLED - #include "stm32h7xx_hal_crc.h" -#endif /* HAL_CRC_MODULE_ENABLED */ - -#ifdef HAL_CRYP_MODULE_ENABLED - #include "stm32h7xx_hal_cryp.h" -#endif /* HAL_CRYP_MODULE_ENABLED */ - -#ifdef HAL_DAC_MODULE_ENABLED - #include "stm32h7xx_hal_dac.h" -#endif /* HAL_DAC_MODULE_ENABLED */ - -#ifdef HAL_FLASH_MODULE_ENABLED - #include "stm32h7xx_hal_flash.h" -#endif /* HAL_FLASH_MODULE_ENABLED */ - -#ifdef HAL_HRTIM_MODULE_ENABLED - #include "stm32h7xx_hal_hrtim.h" -#endif /* HAL_HRTIM_MODULE_ENABLED */ - -#ifdef HAL_HSEM_MODULE_ENABLED - #include "stm32h7xx_hal_hsem.h" -#endif /* HAL_HSEM_MODULE_ENABLED */ - -#ifdef HAL_SRAM_MODULE_ENABLED - #include "stm32h7xx_hal_sram.h" -#endif /* HAL_SRAM_MODULE_ENABLED */ - -#ifdef HAL_NOR_MODULE_ENABLED - #include "stm32h7xx_hal_nor.h" -#endif /* HAL_NOR_MODULE_ENABLED */ - -#ifdef HAL_NAND_MODULE_ENABLED - #include "stm32h7xx_hal_nand.h" -#endif /* HAL_NAND_MODULE_ENABLED */ - -#ifdef HAL_I2C_MODULE_ENABLED - #include "stm32h7xx_hal_i2c.h" -#endif /* HAL_I2C_MODULE_ENABLED */ - -#ifdef HAL_I2S_MODULE_ENABLED - #include "stm32h7xx_hal_i2s.h" -#endif /* HAL_I2S_MODULE_ENABLED */ - -#ifdef HAL_IWDG_MODULE_ENABLED - #include "stm32h7xx_hal_iwdg.h" -#endif /* HAL_IWDG_MODULE_ENABLED */ - -#ifdef HAL_JPEG_MODULE_ENABLED - #include "stm32h7xx_hal_jpeg.h" -#endif /* HAL_JPEG_MODULE_ENABLED */ - -#ifdef HAL_MDIOS_MODULE_ENABLED - #include "stm32h7xx_hal_mdios.h" -#endif /* HAL_MDIOS_MODULE_ENABLED */ - -#ifdef HAL_MMC_MODULE_ENABLED - #include "stm32h7xx_hal_mmc.h" -#endif /* HAL_MMC_MODULE_ENABLED */ - -#ifdef HAL_LPTIM_MODULE_ENABLED -#include "stm32h7xx_hal_lptim.h" -#endif /* HAL_LPTIM_MODULE_ENABLED */ - -#ifdef HAL_LTDC_MODULE_ENABLED -#include "stm32h7xx_hal_ltdc.h" -#endif /* HAL_LTDC_MODULE_ENABLED */ - -#ifdef HAL_OPAMP_MODULE_ENABLED -#include "stm32h7xx_hal_opamp.h" -#endif /* HAL_OPAMP_MODULE_ENABLED */ - -#ifdef HAL_PWR_MODULE_ENABLED - #include "stm32h7xx_hal_pwr.h" -#endif /* HAL_PWR_MODULE_ENABLED */ - -#ifdef HAL_QSPI_MODULE_ENABLED - #include "stm32h7xx_hal_qspi.h" -#endif /* HAL_QSPI_MODULE_ENABLED */ - -#ifdef HAL_RAMECC_MODULE_ENABLED - #include "stm32h7xx_hal_ramecc.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -#ifdef HAL_RNG_MODULE_ENABLED - #include "stm32h7xx_hal_rng.h" -#endif /* HAL_RNG_MODULE_ENABLED */ - -#ifdef HAL_RTC_MODULE_ENABLED - #include "stm32h7xx_hal_rtc.h" -#endif /* HAL_RTC_MODULE_ENABLED */ - -#ifdef HAL_SAI_MODULE_ENABLED - #include "stm32h7xx_hal_sai.h" -#endif /* HAL_SAI_MODULE_ENABLED */ - -#ifdef HAL_SD_MODULE_ENABLED - #include "stm32h7xx_hal_sd.h" -#endif /* HAL_SD_MODULE_ENABLED */ - -#ifdef HAL_SDRAM_MODULE_ENABLED - #include "stm32h7xx_hal_sdram.h" -#endif /* HAL_SDRAM_MODULE_ENABLED */ - -#ifdef HAL_SPI_MODULE_ENABLED - #include "stm32h7xx_hal_spi.h" -#endif /* HAL_SPI_MODULE_ENABLED */ - -#ifdef HAL_SPDIFRX_MODULE_ENABLED - #include "stm32h7xx_hal_spdifrx.h" -#endif /* HAL_SPDIFRX_MODULE_ENABLED */ - -#ifdef HAL_SWPMI_MODULE_ENABLED - #include "stm32h7xx_hal_swpmi.h" -#endif /* HAL_SWPMI_MODULE_ENABLED */ - -#ifdef HAL_TIM_MODULE_ENABLED - #include "stm32h7xx_hal_tim.h" -#endif /* HAL_TIM_MODULE_ENABLED */ - -#ifdef HAL_UART_MODULE_ENABLED - #include "stm32h7xx_hal_uart.h" -#endif /* HAL_UART_MODULE_ENABLED */ - -#ifdef HAL_USART_MODULE_ENABLED - #include "stm32h7xx_hal_usart.h" -#endif /* HAL_USART_MODULE_ENABLED */ - -#ifdef HAL_IRDA_MODULE_ENABLED - #include "stm32h7xx_hal_irda.h" -#endif /* HAL_IRDA_MODULE_ENABLED */ - -#ifdef HAL_SMARTCARD_MODULE_ENABLED - #include "stm32h7xx_hal_smartcard.h" -#endif /* HAL_SMARTCARD_MODULE_ENABLED */ - -#ifdef HAL_SMBUS_MODULE_ENABLED - #include "stm32h7xx_hal_smbus.h" -#endif /* HAL_SMBUS_MODULE_ENABLED */ - -#ifdef HAL_WWDG_MODULE_ENABLED - #include "stm32h7xx_hal_wwdg.h" -#endif /* HAL_WWDG_MODULE_ENABLED */ - -#ifdef HAL_PCD_MODULE_ENABLED - #include "stm32h7xx_hal_pcd.h" -#endif /* HAL_PCD_MODULE_ENABLED */ - -#ifdef HAL_HCD_MODULE_ENABLED - #include "stm32h7xx_hal_hcd.h" -#endif /* HAL_HCD_MODULE_ENABLED */ - -/* Exported macro ------------------------------------------------------------*/ -#ifdef USE_FULL_ASSERT -/** - * @brief The assert_param macro is used for function's parameters check. - * @param expr: If expr is false, it calls assert_failed function - * which reports the name of the source file and the source - * line number of the call that failed. - * If expr is true, it returns no value. - * @retval None - */ - #define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__)) -/* Exported functions ------------------------------------------------------- */ - void assert_failed(uint8_t *file, uint32_t line); -#else - #define assert_param(expr) ((void)0U) -#endif /* USE_FULL_ASSERT */ - -#ifdef __cplusplus -} -#endif - -#endif /* __STM32H7xx_HAL_CONF_H */ - - -/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ -- cgit v1.3.1 From 04e595dbdaf419683ea0b4afa5d45b612e97fcb5 Mon Sep 17 00:00:00 2001 From: Ha Thach Date: Wed, 3 Mar 2021 20:34:32 +0700 Subject: Delete porting.md --- .github/ISSUE_TEMPLATE/porting.md | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/porting.md (limited to '.github') diff --git a/.github/ISSUE_TEMPLATE/porting.md b/.github/ISSUE_TEMPLATE/porting.md deleted file mode 100644 index 9e4097ac2..000000000 --- a/.github/ISSUE_TEMPLATE/porting.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -name: Porting -about: Adding a new port for this project -title: '' -labels: Porting -assignees: '' - ---- - -**Description** -Describe which API you want to port (DCD/HCD/OSAL/BSP). It is also helpful to go through [porting.md](docs/porting.md) first if you haven't yet. -- cgit v1.3.1 From 515122669eccfcd6f56e9ca267cc591eddb3f14a Mon Sep 17 00:00:00 2001 From: Ha Thach Date: Wed, 3 Mar 2021 20:38:10 +0700 Subject: Create config.yml --- .github/ISSUE_TEMPLATE/config.yml | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/config.yml (limited to '.github') diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 000000000..735a5ef22 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: TinyUSB Discussion + url: https://github.com/hathach/tinyusb/discussions + about: If you have other questions or need help, post it here. -- cgit v1.3.1 From ce4da82ce93635f67664353ad7e534fd5fd7a2c9 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 20:22:16 +0700 Subject: cache all toolchains to speed up ci --- .github/workflows/build.yml | 124 ++++++++++++++++++++++++++++---------------- 1 file changed, 80 insertions(+), 44 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 771a49417..ce6a05a76 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,9 @@ on: - created jobs: + # --------------------------------------- # Unit testing with Ceedling + # --------------------------------------- unit-test: runs-on: ubuntu-latest steps: @@ -53,22 +55,32 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - - - name: Install Toolchains - run: | - # ARM GCC from xpack - npm install --global xpm - xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH - - name: Checkout TinyUSB uses: actions/checkout@v2 - name: Checkout Submodules in lib run: git submodule update --init lib + - name: Set Toolchain URL + run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz + + - name: Cache Toolchain + uses: actions/cache@v2 + id: cache-toolchain + with: + path: ~/cache/ + key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }} + + - name: Install Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' + run: | + mkdir -p ~/cache/toolchain + wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz + tar -C ~/cache/toolchain -xaf toolchain.tar.gz + + - name: Set Toolchain Path + run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` + - name: Build run: python3 tools/build_family.py ${{ matrix.family }} @@ -109,21 +121,31 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - - name: Checkout TinyUSB uses: actions/checkout@v2 - name: Checkout Submodules in lib run: git submodule update --init lib + - name: Set Toolchain URL + run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz + + - name: Cache Toolchain + uses: actions/cache@v2 + id: cache-toolchain + with: + path: ~/cache/ + key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }} + - name: Install Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | - # RISC-V GCC from xpack - npm install --global xpm - xpm install --global @xpack-dev-tools/riscv-none-embed-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/riscv-none-embed-gcc/*/.content/bin` >> $GITHUB_PATH + mkdir -p ~/cache/toolchain + wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz + tar -C ~/cache/toolchain -xaf toolchain.tar.gz + + - name: Set Toolchain Path + run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` - name: Build run: python3 tools/build_family.py ${{ matrix.family }} @@ -186,6 +208,12 @@ jobs: # --------------------------------------- build-msp430: runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + family: + # Alphabetical order + - 'msp430' steps: - name: Setup Python uses: actions/setup-python@v2 @@ -195,42 +223,40 @@ jobs: - name: Checkout Submodules in lib run: git submodule update --init lib - - - run: | - echo family=msp430 >> $GITHUB_ENV - # Add msp430-gcc url to env - echo >> $GITHUB_ENV MSP430_GCC_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 - - name: Cache MSP430-GCC + - name: Set Toolchain URL + run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 + + - name: Cache Toolchain uses: actions/cache@v2 - id: cache-msp430 + id: cache-toolchain with: path: ~/cache/ - key: ${{ runner.os }}-21-03-02-${{ env.MSP430_GCC_URL }} + key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }} - - name: Install MSP430-GCC - if: steps.cache-msp430.outputs.cache-hit != 'true' + - name: Install Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | - mkdir -p ~/cache/msp430-gcc - wget --progress=dot:mega $MSP430_GCC_URL -O msp430-gcc.tar.bz2 - tar -C ~/cache/msp430-gcc -xaf msp430-gcc.tar.bz2 + mkdir -p ~/cache/toolchain + wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.bz2 + tar -C ~/cache/toolchain -xaf toolchain.tar.bz2 - name: Set Toolchain Path - run: echo >> $GITHUB_PATH `echo ~/cache/msp430-gcc/msp430-gcc-*/bin` + run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` - name: Build - run: python3 tools/build_family.py ${{ env.family }} + run: python3 tools/build_family.py ${{ matrix.family }} - uses: actions/upload-artifact@v2 with: - name: ${{ env.family }}-tinyusb-examples + name: ${{ matrix.family }}-tinyusb-examples path: _bin/ - name: Create Release Asset if: ${{ github.event_name == 'release' }} run: | cd _bin/ - zip -r ../${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip * + zip -r ../${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip * - name: Upload Release Asset uses: actions/upload-release-asset@v1 @@ -239,8 +265,8 @@ jobs: if: ${{ github.event_name == 'release' }} with: upload_url: ${{ github.event.release.upload_url }} - asset_path: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip - asset_name: ${{ env.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_path: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip + asset_name: ${{ matrix.family }}-tinyusb-${{ github.event.release.tag_name }}-examples.zip asset_content_type: application/zip # --------------------------------------- @@ -275,20 +301,30 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 - - name: Setup Node.js - uses: actions/setup-node@v1 - - name: Checkout TinyUSB uses: actions/checkout@v2 with: submodules: 'true' - - name: Install Toolchains + - name: Set Toolchain URL + run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz + + - name: Cache Toolchain + uses: actions/cache@v2 + id: cache-toolchain + with: + path: ~/cache/ + key: ${{ runner.os }}-21-03-04-${{ env.TOOLCHAIN_URL }} + + - name: Install Toolchain + if: steps.cache-toolchain.outputs.cache-hit != 'true' run: | - # ARM GCC from xpack - npm install --global xpm - xpm install --global @xpack-dev-tools/arm-none-eabi-gcc@latest - echo `echo $HOME/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/*/.content/bin` >> $GITHUB_PATH + mkdir -p ~/cache/toolchain + wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.tar.gz + tar -C ~/cache/toolchain -xaf toolchain.tar.gz + + - name: Set Toolchain Path + run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin` - name: Build run: python3 tools/build_board.py ${{ matrix.example }} \ No newline at end of file -- cgit v1.3.1 From b846ded487c29e5ca5698f2ab7cb237a21eeb85b Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 4 Mar 2021 22:50:45 +0700 Subject: merge no-family example build specify FAMILY_SUBMODULES for all boards --- .github/workflows/build.yml | 27 ++++++++------------------- hw/bsp/d5035_01/board.mk | 1 + hw/bsp/da14695_dk_usb/board.mk | 2 +- hw/bsp/da1469x_dk_pro/board.mk | 2 +- hw/bsp/ea4088qs/board.mk | 2 ++ hw/bsp/ea4357/board.mk | 2 ++ hw/bsp/frdm_kl25z/board.mk | 2 ++ hw/bsp/lpcxpresso11u37/board.mk | 2 ++ hw/bsp/lpcxpresso11u68/board.mk | 2 ++ hw/bsp/lpcxpresso1347/board.mk | 2 ++ hw/bsp/lpcxpresso1549/board.mk | 2 ++ hw/bsp/lpcxpresso1769/board.mk | 2 ++ hw/bsp/lpcxpresso51u68/board.mk | 2 ++ hw/bsp/lpcxpresso54114/board.mk | 2 ++ hw/bsp/mbed1768/board.mk | 2 ++ hw/bsp/ngx4330/board.mk | 2 ++ hw/bsp/nutiny_nuc121s/board.mk | 2 ++ hw/bsp/nutiny_nuc125s/board.mk | 2 ++ hw/bsp/nutiny_nuc126v/board.mk | 2 ++ hw/bsp/nutiny_sdk_nuc120/board.mk | 2 ++ hw/bsp/nutiny_sdk_nuc505/board.mk | 2 ++ hw/bsp/same54xplainedpro/board.mk | 2 ++ hw/bsp/same70_xplained/board.mk | 2 ++ hw/bsp/samg55xplained/board.mk | 2 ++ hw/bsp/spresense/board.mk | 2 ++ hw/bsp/stm32f070rbnucleo/board.mk | 9 ++++++--- hw/bsp/stm32f072disco/board.mk | 10 ++++++---- hw/bsp/stm32f103bluepill/board.mk | 10 ++++++---- hw/bsp/stm32f207nucleo/board.mk | 11 ++++++----- hw/bsp/stm32f303disco/board.mk | 10 ++++++---- hw/bsp/stm32l0538disco/board.mk | 10 ++++++---- hw/bsp/stm32l476disco/board.mk | 10 ++++++---- hw/bsp/stm32l4r5nucleo/board.mk | 10 ++++++---- 33 files changed, 101 insertions(+), 53 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ce6a05a76..1263ef1c1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -278,24 +278,12 @@ jobs: fail-fast: false matrix: example: - # Alphabetical order - - 'device/audio_test' - - 'device/board_test' - - 'device/cdc_dual_ports' - - 'device/cdc_msc' - - 'device/cdc_msc_freertos' - - 'device/dfu_runtime' - - 'device/hid_composite' - - 'device/hid_composite_freertos' - - 'device/hid_generic_inout' - - 'device/hid_multiple_interface' - - 'device/midi_test' - - 'device/msc_dual_lun' + # Alphabetical order, a group of 4 + - 'device/audio_test device/board_test device/cdc_dual_ports device/cdc_msc' + - 'device/cdc_msc_freertos device/dfu_runtime device/hid_composite device/hid_composite_freertos' + - 'device/hid_generic_inout device/hid_multiple_interface device/midi_test device/msc_dual_lun' - 'device/net_lwip_webserver' - - 'device/uac2_headset' - - 'device/usbtmc' - - 'device/webusb_serial' - - 'host/cdc_msc_hid' + - 'device/uac2_headset device/usbtmc device/webusb_serial host/cdc_msc_hid' steps: - name: Setup Python @@ -303,8 +291,9 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - with: - submodules: 'true' + + - name: Checkout Submodules in lib + run: git submodule update --init lib - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz diff --git a/hw/bsp/d5035_01/board.mk b/hw/bsp/d5035_01/board.mk index 3340f79e9..2ca44c3aa 100644 --- a/hw/bsp/d5035_01/board.mk +++ b/hw/bsp/d5035_01/board.mk @@ -1,3 +1,4 @@ +FAMILY_SUBMODULES = hw/mcu/microchip HWREV ?= 1 CFLAGS += \ diff --git a/hw/bsp/da14695_dk_usb/board.mk b/hw/bsp/da14695_dk_usb/board.mk index 2e76012d2..58f3947cc 100644 --- a/hw/bsp/da14695_dk_usb/board.mk +++ b/hw/bsp/da14695_dk_usb/board.mk @@ -1,4 +1,4 @@ - CFLAGS += \ +CFLAGS += \ -flto \ -mthumb \ -mthumb-interwork \ diff --git a/hw/bsp/da1469x_dk_pro/board.mk b/hw/bsp/da1469x_dk_pro/board.mk index 52064e63c..5362498ea 100644 --- a/hw/bsp/da1469x_dk_pro/board.mk +++ b/hw/bsp/da1469x_dk_pro/board.mk @@ -1,4 +1,4 @@ - CFLAGS += \ +CFLAGS += \ -flto \ -mthumb \ -mthumb-interwork \ diff --git a/hw/bsp/ea4088qs/board.mk b/hw/bsp/ea4088qs/board.mk index 15e0bfb86..37cade022 100644 --- a/hw/bsp/ea4088qs/board.mk +++ b/hw/bsp/ea4088qs/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/ea4357/board.mk b/hw/bsp/ea4357/board.mk index f6c42e0cf..e70fa87e3 100644 --- a/hw/bsp/ea4357/board.mk +++ b/hw/bsp/ea4357/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/frdm_kl25z/board.mk b/hw/bsp/frdm_kl25z/board.mk index 9d86c4542..8a0200f8e 100644 --- a/hw/bsp/frdm_kl25z/board.mk +++ b/hw/bsp/frdm_kl25z/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -mthumb \ -mabi=aapcs \ diff --git a/hw/bsp/lpcxpresso11u37/board.mk b/hw/bsp/lpcxpresso11u37/board.mk index 441e5215d..a496d859b 100644 --- a/hw/bsp/lpcxpresso11u37/board.mk +++ b/hw/bsp/lpcxpresso11u37/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso11u68/board.mk b/hw/bsp/lpcxpresso11u68/board.mk index 53d809cfc..14529312a 100644 --- a/hw/bsp/lpcxpresso11u68/board.mk +++ b/hw/bsp/lpcxpresso11u68/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso1347/board.mk b/hw/bsp/lpcxpresso1347/board.mk index 915834ddf..af13044d4 100644 --- a/hw/bsp/lpcxpresso1347/board.mk +++ b/hw/bsp/lpcxpresso1347/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso1549/board.mk b/hw/bsp/lpcxpresso1549/board.mk index 27c3ca8d6..5514f6539 100644 --- a/hw/bsp/lpcxpresso1549/board.mk +++ b/hw/bsp/lpcxpresso1549/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso1769/board.mk b/hw/bsp/lpcxpresso1769/board.mk index 11da5f722..2b31e96a8 100644 --- a/hw/bsp/lpcxpresso1769/board.mk +++ b/hw/bsp/lpcxpresso1769/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso51u68/board.mk b/hw/bsp/lpcxpresso51u68/board.mk index e5ff8242d..0884391f8 100644 --- a/hw/bsp/lpcxpresso51u68/board.mk +++ b/hw/bsp/lpcxpresso51u68/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/lpcxpresso54114/board.mk b/hw/bsp/lpcxpresso54114/board.mk index 88f2bc734..eb75bdceb 100644 --- a/hw/bsp/lpcxpresso54114/board.mk +++ b/hw/bsp/lpcxpresso54114/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/mbed1768/board.mk b/hw/bsp/mbed1768/board.mk index 1b09a7f7a..c24731aa2 100644 --- a/hw/bsp/mbed1768/board.mk +++ b/hw/bsp/mbed1768/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/ngx4330/board.mk b/hw/bsp/ngx4330/board.mk index fe66fceb5..c6c5af370 100644 --- a/hw/bsp/ngx4330/board.mk +++ b/hw/bsp/ngx4330/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nxp + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/nutiny_nuc121s/board.mk b/hw/bsp/nutiny_nuc121s/board.mk index ce18a749c..a8dbdffda 100644 --- a/hw/bsp/nutiny_nuc121s/board.mk +++ b/hw/bsp/nutiny_nuc121s/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nuvoton + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/nutiny_nuc125s/board.mk b/hw/bsp/nutiny_nuc125s/board.mk index fe51b79d2..9ccdc2f71 100644 --- a/hw/bsp/nutiny_nuc125s/board.mk +++ b/hw/bsp/nutiny_nuc125s/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nuvoton + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/nutiny_nuc126v/board.mk b/hw/bsp/nutiny_nuc126v/board.mk index 30cb3df03..8a34b107f 100644 --- a/hw/bsp/nutiny_nuc126v/board.mk +++ b/hw/bsp/nutiny_nuc126v/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nuvoton + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/nutiny_sdk_nuc120/board.mk b/hw/bsp/nutiny_sdk_nuc120/board.mk index 0d3a3bff4..bc72db5b1 100644 --- a/hw/bsp/nutiny_sdk_nuc120/board.mk +++ b/hw/bsp/nutiny_sdk_nuc120/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nuvoton + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/nutiny_sdk_nuc505/board.mk b/hw/bsp/nutiny_sdk_nuc505/board.mk index 99103fc65..367cc3d3d 100644 --- a/hw/bsp/nutiny_sdk_nuc505/board.mk +++ b/hw/bsp/nutiny_sdk_nuc505/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/nuvoton + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/same54xplainedpro/board.mk b/hw/bsp/same54xplainedpro/board.mk index 9d2e4a74d..e6f623c1b 100644 --- a/hw/bsp/same54xplainedpro/board.mk +++ b/hw/bsp/same54xplainedpro/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/microchip + CONF_CPU_FREQUENCY ?= 120000000 CFLAGS += \ diff --git a/hw/bsp/same70_xplained/board.mk b/hw/bsp/same70_xplained/board.mk index 21f5350c3..d0927c2f1 100644 --- a/hw/bsp/same70_xplained/board.mk +++ b/hw/bsp/same70_xplained/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/microchip + CFLAGS += \ -mthumb \ -mabi=aapcs \ diff --git a/hw/bsp/samg55xplained/board.mk b/hw/bsp/samg55xplained/board.mk index b574a39e7..184407ae9 100644 --- a/hw/bsp/samg55xplained/board.mk +++ b/hw/bsp/samg55xplained/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/microchip + CFLAGS += \ -flto \ -mthumb \ diff --git a/hw/bsp/spresense/board.mk b/hw/bsp/spresense/board.mk index 245976235..09d000b44 100644 --- a/hw/bsp/spresense/board.mk +++ b/hw/bsp/spresense/board.mk @@ -1,3 +1,5 @@ +FAMILY_SUBMODULES = hw/mcu/sony/cxd56/spresense-exported-sdk + # Platforms are: Linux, Darwin, MSYS, CYGWIN PLATFORM := $(firstword $(subst _, ,$(shell uname -s 2>/dev/null))) diff --git a/hw/bsp/stm32f070rbnucleo/board.mk b/hw/bsp/stm32f070rbnucleo/board.mk index be2ce3b83..35556b89e 100644 --- a/hw/bsp/stm32f070rbnucleo/board.mk +++ b/hw/bsp/stm32f070rbnucleo/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = f0 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -12,9 +18,6 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -ST_FAMILY = f0 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/stm32F070rbtx_flash.ld diff --git a/hw/bsp/stm32f072disco/board.mk b/hw/bsp/stm32f072disco/board.mk index bbb7baf5a..fe900a5ad 100644 --- a/hw/bsp/stm32f072disco/board.mk +++ b/hw/bsp/stm32f072disco/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = f0 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -12,10 +18,6 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -ST_FAMILY = f0 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32F072RBTx_FLASH.ld diff --git a/hw/bsp/stm32f103bluepill/board.mk b/hw/bsp/stm32f103bluepill/board.mk index e1517cfaa..945c280f3 100644 --- a/hw/bsp/stm32f103bluepill/board.mk +++ b/hw/bsp/stm32f103bluepill/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = f1 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -11,10 +17,6 @@ CFLAGS += \ # mcu driver cause following warnings #CFLAGS += -Wno-error=unused-parameter -ST_FAMILY = f1 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32F103XB_FLASH.ld diff --git a/hw/bsp/stm32f207nucleo/board.mk b/hw/bsp/stm32f207nucleo/board.mk index 025c2d7b7..5ddddb15d 100644 --- a/hw/bsp/stm32f207nucleo/board.mk +++ b/hw/bsp/stm32f207nucleo/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = f2 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -11,11 +17,6 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=sign-compare -ST_FAMILY = f2 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32F207ZGTx_FLASH.ld diff --git a/hw/bsp/stm32f303disco/board.mk b/hw/bsp/stm32f303disco/board.mk index 3abaf5cec..835c7da01 100644 --- a/hw/bsp/stm32f303disco/board.mk +++ b/hw/bsp/stm32f303disco/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = f3 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -12,10 +18,6 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -ST_FAMILY = f3 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32F303VCTx_FLASH.ld diff --git a/hw/bsp/stm32l0538disco/board.mk b/hw/bsp/stm32l0538disco/board.mk index 2c9ffad69..e11403f91 100644 --- a/hw/bsp/stm32l0538disco/board.mk +++ b/hw/bsp/stm32l0538disco/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = l0 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -12,10 +18,6 @@ CFLAGS += \ # mcu driver cause following warnings CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized -ST_FAMILY = l0 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32L053C8Tx_FLASH.ld diff --git a/hw/bsp/stm32l476disco/board.mk b/hw/bsp/stm32l476disco/board.mk index 9e44598b0..6f3c47981 100644 --- a/hw/bsp/stm32l476disco/board.mk +++ b/hw/bsp/stm32l476disco/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = l4 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -12,10 +18,6 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align -ST_FAMILY = l4 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32L476VGTx_FLASH.ld diff --git a/hw/bsp/stm32l4r5nucleo/board.mk b/hw/bsp/stm32l4r5nucleo/board.mk index cee5ce86e..3a5b6c3db 100644 --- a/hw/bsp/stm32l4r5nucleo/board.mk +++ b/hw/bsp/stm32l4r5nucleo/board.mk @@ -1,3 +1,9 @@ +ST_FAMILY = l4 +FAMILY_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + +ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) +ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver + CFLAGS += \ -flto \ -mthumb \ @@ -13,10 +19,6 @@ CFLAGS += \ # suppress warning caused by vendor mcu driver CFLAGS += -Wno-error=maybe-uninitialized -Wno-error=cast-align -ST_FAMILY = l4 -ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) -ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver - # All source paths should be relative to the top level. LD_FILE = hw/bsp/$(BOARD)/STM32L4RXxI_FLASH.ld -- cgit v1.3.1 From 7d877e286ada097f2050103a2e9adeae7fe2f8ab Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 5 Mar 2021 22:24:03 +0700 Subject: update DEPS_SUBMODULES to optimize ci --- .github/workflows/build.yml | 16 ++++++++-------- hw/bsp/lpc55/family.mk | 2 +- hw/bsp/stm32f070rbnucleo/board.mk | 2 +- hw/bsp/stm32f072disco/board.mk | 2 +- hw/bsp/stm32f103bluepill/board.mk | 2 +- hw/bsp/stm32f207nucleo/board.mk | 2 +- hw/bsp/stm32f303disco/board.mk | 2 +- hw/bsp/stm32f4/family.mk | 2 +- hw/bsp/stm32f7/family.mk | 2 +- hw/bsp/stm32h7/family.mk | 2 +- hw/bsp/stm32l0538disco/board.mk | 2 +- hw/bsp/stm32l476disco/board.mk | 2 +- hw/bsp/stm32l4r5nucleo/board.mk | 2 +- 13 files changed, 20 insertions(+), 20 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1263ef1c1..ba6fa12fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,8 +58,8 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - - name: Checkout Submodules in lib - run: git submodule update --init lib + - name: Checkout common submodules in lib + run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz @@ -124,8 +124,8 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - - name: Checkout Submodules in lib - run: git submodule update --init lib + - name: Checkout common submodules in lib + run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz @@ -221,8 +221,8 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - - name: Checkout Submodules in lib - run: git submodule update --init lib + - name: Checkout common submodules in lib + run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 @@ -292,8 +292,8 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - - name: Checkout Submodules in lib - run: git submodule update --init lib + - name: Checkout common submodules in lib + run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz diff --git a/hw/bsp/lpc55/family.mk b/hw/bsp/lpc55/family.mk index 299975fb5..df2aa87b5 100644 --- a/hw/bsp/lpc55/family.mk +++ b/hw/bsp/lpc55/family.mk @@ -1,5 +1,5 @@ UF2_FAMILY_ID = 0x2abc77ec -DEPS_SUBMODULES = hw/mcu/nxp +DEPS_SUBMODULES = lib/sct_neopixel hw/mcu/nxp include $(TOP)/$(BOARD_PATH)/board.mk diff --git a/hw/bsp/stm32f070rbnucleo/board.mk b/hw/bsp/stm32f070rbnucleo/board.mk index ac5b0dc4d..0cf28b793 100644 --- a/hw/bsp/stm32f070rbnucleo/board.mk +++ b/hw/bsp/stm32f070rbnucleo/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = f0 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f072disco/board.mk b/hw/bsp/stm32f072disco/board.mk index 8aacdef3a..81fb0df89 100644 --- a/hw/bsp/stm32f072disco/board.mk +++ b/hw/bsp/stm32f072disco/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = f0 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f103bluepill/board.mk b/hw/bsp/stm32f103bluepill/board.mk index 60beff78d..e1cf26e88 100644 --- a/hw/bsp/stm32f103bluepill/board.mk +++ b/hw/bsp/stm32f103bluepill/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = f1 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f207nucleo/board.mk b/hw/bsp/stm32f207nucleo/board.mk index 0a77d76e3..4be6e250e 100644 --- a/hw/bsp/stm32f207nucleo/board.mk +++ b/hw/bsp/stm32f207nucleo/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = f2 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f303disco/board.mk b/hw/bsp/stm32f303disco/board.mk index 8ad1d0072..304fa9c5a 100644 --- a/hw/bsp/stm32f303disco/board.mk +++ b/hw/bsp/stm32f303disco/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = f3 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f4/family.mk b/hw/bsp/stm32f4/family.mk index cbda96e92..1bfb38151 100644 --- a/hw/bsp/stm32f4/family.mk +++ b/hw/bsp/stm32f4/family.mk @@ -1,6 +1,6 @@ UF2_FAMILY_ID = 0x57755a57 ST_FAMILY = f4 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32f7/family.mk b/hw/bsp/stm32f7/family.mk index c405973de..ed7670850 100644 --- a/hw/bsp/stm32f7/family.mk +++ b/hw/bsp/stm32f7/family.mk @@ -1,6 +1,6 @@ UF2_FAMILY_ID = 0x53b80f00 ST_FAMILY = f7 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32h7/family.mk b/hw/bsp/stm32h7/family.mk index 2ec032ed9..8e49604e1 100644 --- a/hw/bsp/stm32h7/family.mk +++ b/hw/bsp/stm32h7/family.mk @@ -1,6 +1,6 @@ UF2_FAMILY_ID = 0x6db66082 ST_FAMILY = h7 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32l0538disco/board.mk b/hw/bsp/stm32l0538disco/board.mk index 6c8e89247..5c1929aea 100644 --- a/hw/bsp/stm32l0538disco/board.mk +++ b/hw/bsp/stm32l0538disco/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = l0 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32l476disco/board.mk b/hw/bsp/stm32l476disco/board.mk index ec02e0c1d..fefcd6433 100644 --- a/hw/bsp/stm32l476disco/board.mk +++ b/hw/bsp/stm32l476disco/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = l4 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver diff --git a/hw/bsp/stm32l4r5nucleo/board.mk b/hw/bsp/stm32l4r5nucleo/board.mk index 8ff38594d..f9fccf9b1 100644 --- a/hw/bsp/stm32l4r5nucleo/board.mk +++ b/hw/bsp/stm32l4r5nucleo/board.mk @@ -1,5 +1,5 @@ ST_FAMILY = l4 -DEPS_SUBMODULES = hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver +DEPS_SUBMODULES = lib/CMSIS_5 hw/mcu/st/cmsis_device_$(ST_FAMILY) hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver ST_CMSIS = hw/mcu/st/cmsis_device_$(ST_FAMILY) ST_HAL_DRIVER = hw/mcu/st/stm32$(ST_FAMILY)xx_hal_driver -- cgit v1.3.1 From 7afe1d9e16732ed4129bce189450159cc0ecb45c Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 5 Mar 2021 22:49:29 +0700 Subject: clean up some how lpc55 ci cannot build without pre-checkout lib/sct_neopixel --- .github/workflows/build.yml | 6 ++---- hw/bsp/lpc55/family.mk | 9 +-------- 2 files changed, 3 insertions(+), 12 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ba6fa12fd..0f2b9ea3b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,7 +59,7 @@ jobs: uses: actions/checkout@v2 - name: Checkout common submodules in lib - run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip + run: git submodule update --init lib/FreeRTOS-Kernel lib/lwip lib/sct_neopixel - name: Set Toolchain URL run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v10.2.1-1.1/xpack-arm-none-eabi-gcc-10.2.1-1.1-linux-x64.tar.gz @@ -197,8 +197,6 @@ jobs: - name: Checkout TinyUSB uses: actions/checkout@v2 - with: - submodules: 'false' - name: Build run: docker run --rm -v $PWD:/project -w /project espressif/idf:latest python3 tools/build_esp32s2.py ${{ matrix.board }} @@ -213,7 +211,7 @@ jobs: matrix: family: # Alphabetical order - - 'msp430' + - 'msp430' steps: - name: Setup Python uses: actions/setup-python@v2 diff --git a/hw/bsp/lpc55/family.mk b/hw/bsp/lpc55/family.mk index df2aa87b5..8934cb422 100644 --- a/hw/bsp/lpc55/family.mk +++ b/hw/bsp/lpc55/family.mk @@ -41,7 +41,7 @@ SRC_C += \ $(MCU_DIR)/drivers/fsl_reset.c \ $(MCU_DIR)/drivers/fsl_usart.c \ $(MCU_DIR)/drivers/fsl_flexcomm.c \ - lib/sct_neopixel/sct_neopixel.c + lib/sct_neopixel/sct_neopixel.c INC += \ $(TOP)/$(BOARD_PATH) \ @@ -60,10 +60,3 @@ CHIP_FAMILY = lpc_ip3511 # For freeRTOS port source FREERTOS_PORT = ARM_CM33_NTZ/non_secure - -# For flash-jlink target -#JLINK_DEVICE = LPC55S69 - -# flash using pyocd -#flash: $(BUILD)/$(PROJECT).hex -# pyocd flash -t LPC55S69 $< -- cgit v1.3.1