Skip to content

Commit

Permalink
Merge pull request #1539 from hathach/improve-ci
Browse files Browse the repository at this point in the history
Improve ci
  • Loading branch information
hathach committed Jun 29, 2022
2 parents 39069cf + 158b3d7 commit 19956f0
Show file tree
Hide file tree
Showing 30 changed files with 85 additions and 87 deletions.
48 changes: 9 additions & 39 deletions .github/workflows/build_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- 'xmc4000'
steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3

- name: Checkout TinyUSB
uses: actions/checkout@v3
Expand All @@ -79,32 +79,17 @@ jobs:
repository: hathach/linkermap
path: linkermap

- name: Checkout pico-sdk
- name: Checkout pico-sdk for rp2040
if: matrix.family == 'rp2040'
run: |
git clone --depth 1 -b develop https://github.com/raspberrypi/pico-sdk ~/pico-sdk
echo >> $GITHUB_ENV PICO_SDK_PATH=~/pico-sdk
git submodule update --init hw/mcu/raspberry_pi/Pico-PIO-USB
- 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
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
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`
release: '11.2-2022.02'

- name: Build
run: python3 tools/build_family.py ${{ matrix.family }}
Expand Down Expand Up @@ -135,33 +120,18 @@ jobs:

steps:
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v3

- name: Checkout TinyUSB
uses: actions/checkout@v3

- 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

- name: Cache Toolchain
uses: actions/cache@v2
id: cache-toolchain
- name: Install ARM GCC
uses: carlosperate/arm-none-eabi-gcc-action@v1
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`
release: '11.2-2022.02'

- name: Build
run: python3 tools/build_board.py ${{ matrix.example }}
Empty file.
13 changes: 7 additions & 6 deletions examples/device/cdc_msc_freertos/skip.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
mcu:CXD56
mcu:MSP430x5xx
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
mcu:F1C100S
mcu:GD32VF103
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:RP2040
mcu:SAMD11
mcu:SAMX7X
mcu:GD32VF103
family:broadcom_64bit
family:broadcom_32bit
mcu:VALENTYUSB_EPTRI
family:broadcom_32bit
family:broadcom_64bit
Empty file.
12 changes: 7 additions & 5 deletions examples/device/hid_composite_freertos/skip.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
mcu:CXD56
mcu:F1C100S
mcu:GD32VF103
mcu:MKL25ZXX
mcu:MSP430x5xx
mcu:SAMD11
mcu:VALENTYUSB_EPTRI
mcu:RP2040
mcu:SAMD11
mcu:SAMX7X
mcu:GD32VF103
family:broadcom_64bit
family:broadcom_32bit
mcu:VALENTYUSB_EPTRI
family:broadcom_32bit
family:broadcom_64bit
3 changes: 2 additions & 1 deletion examples/device/video_capture/skip.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
mcu:MSP430x5xx
mcu:SAMD11
mcu:NUC121
mcu:SAMD11
1 change: 1 addition & 0 deletions hw/bsp/d5035_01/same51j19a_flash.ld
Original file line number Diff line number Diff line change
Expand Up @@ -160,4 +160,5 @@ SECTIONS

. = ALIGN(4);
_end = . ;
end = .;
}
4 changes: 2 additions & 2 deletions hw/bsp/ea4088qs/ea4088qs.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
void USB_IRQHandler(void)
{
#if CFG_TUD_ENABLED
tuh_int_handler(0);
tud_int_handler(0);
#endif

#if CFG_TUH_ENABLED
tud_int_handler(0);
tuh_int_handler(0);
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/frdm_k32l2b/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_K32L2BXX

# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter
CFLAGS += -Wno-error=unused-parameter -Wno-error=redundant-decls

MCU_DIR = $(SDK_DIR)/devices/K32L2B31A

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/frdm_kl25z/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ LDFLAGS += \
-Wl,--defsym,__heap_size__=0

# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=format
CFLAGS += -Wno-error=unused-parameter -Wno-error=format -Wno-error=redundant-decls

MCU_DIR = $(SDK_DIR)/devices/MKL25Z4

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/kuiic/kuiic.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* Variables
******************************************************************************/
/* System clock frequency. */
extern uint32_t SystemCoreClock;
// extern uint32_t SystemCoreClock;

/*******************************************************************************
* Variables for BOARD_BootClockRUN configuration
Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/lpcxpresso11u37/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CFLAGS += \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'

# mcu driver cause following warnings
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter
CFLAGS += -Wno-error=strict-prototypes -Wno-error=unused-parameter -Wno-error=redundant-decls

MCU_DIR = hw/mcu/nxp/lpcopen/lpc11uxx/lpc_chip_11uxx

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/lpcxpresso1347/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ CFLAGS += \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'

# startup.c and lpc_types.h cause following errors
CFLAGS += -Wno-error=strict-prototypes
CFLAGS += -Wno-error=strict-prototypes -Wno-error=redundant-decls

MCU_DIR = hw/mcu/nxp/lpcopen/lpc13xx/lpc_chip_13xx

Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/nutiny_nuc121s/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ CFLAGS += \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_NUC121

# mcu driver cause following warnings
CFLAGS += -Wno-error=redundant-decls

# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/nuc121_flash.ld

Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/nutiny_nuc125s/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ CFLAGS += \
-DCFG_EXAMPLE_MSC_READONLY \
-DCFG_TUSB_MCU=OPT_MCU_NUC121

# mcu driver cause following warnings
CFLAGS += -Wno-error=redundant-decls

# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/nuc125_flash.ld

Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/nutiny_nuc126v/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ CFLAGS += \
-D__CORTEX_SC=0 \
-DCFG_TUSB_MCU=OPT_MCU_NUC126

# mcu driver cause following warnings
CFLAGS += -Wno-error=redundant-decls

# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/nuc126_flash.ld

Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/nutiny_sdk_nuc505/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ CFLAGS += \
-mfpu=fpv4-sp-d16 \
-DCFG_TUSB_MCU=OPT_MCU_NUC505

# mcu driver cause following warnings
CFLAGS += -Wno-error=redundant-decls

# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/nuc505_flashtoram.ld

Expand Down
1 change: 0 additions & 1 deletion hw/bsp/rp2040/boards/adafruit_feather_rp2040/board.cmake

This file was deleted.

1 change: 0 additions & 1 deletion hw/bsp/rp2040/boards/adafruit_itsybitsy_rp2040/board.cmake

This file was deleted.

1 change: 0 additions & 1 deletion hw/bsp/rp2040/boards/adafruit_qtpy_rp2040/board.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion hw/bsp/same70_qmtech/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_SAMX7X

# suppress following warnings from mcu driver
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual -Wno-error=redundant-decls

ASF_DIR = hw/mcu/microchip/same70

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/same70_xplained/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_SAMX7X

# suppress following warnings from mcu driver
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual
CFLAGS += -Wno-error=unused-parameter -Wno-error=cast-align -Wno-error=cast-qual -Wno-error=redundant-decls

ASF_DIR = hw/mcu/microchip/same70

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/samg55xplained/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_SAMG

# suppress following warnings from mcu driver
CFLAGS += -Wno-error=undef -Wno-error=cast-qual -Wno-error=null-dereference
CFLAGS += -Wno-error=undef -Wno-error=cast-qual -Wno-error=null-dereference -Wno-error=redundant-decls

ASF_DIR = hw/mcu/microchip/samg55

Expand Down
3 changes: 2 additions & 1 deletion hw/bsp/spresense/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ CFLAGS += \
-Wno-error=unused-parameter \
-DCFG_TUSB_MCU=OPT_MCU_CXD56 \

# suppress following warnings from mcu driver
# lwip/src/core/raw.c:334:43: error: declaration of 'recv' shadows a global declaration
CFLAGS += -Wno-error=shadow
CFLAGS += -Wno-error=shadow -Wno-error=redundant-decls

SPRESENSE_SDK = $(TOP)/hw/mcu/sony/cxd56/spresense-exported-sdk

Expand Down
2 changes: 1 addition & 1 deletion hw/bsp/stm32l0538disco/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_STM32L0

# mcu driver cause following warnings
CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized
CFLAGS += -Wno-error=unused-parameter -Wno-error=maybe-uninitialized -Wno-error=redundant-decls

# All source paths should be relative to the top level.
LD_FILE = hw/bsp/$(BOARD)/STM32L053C8Tx_FLASH.ld
Expand Down
3 changes: 3 additions & 0 deletions hw/bsp/xmc4000/boards/xmc4500_relax/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ MCU_VARIANT = XMC4500
CFLAGS += \
-DXMC4500_F100x1024 \

# mcu driver cause following warnings
CFLAGS += -Wno-error=stringop-overread

LD_FILE = $(MCU_DIR)/CMSIS/Infineon/COMPONENT_$(MCU_VARIANT)/Source/TOOLCHAIN_GCC_ARM/XMC4500x1024.ld

JLINK_DEVICE = XMC4500-1024
Expand Down
2 changes: 1 addition & 1 deletion hw/mcu/microchip
Submodule microchip updated 289 files
3 changes: 3 additions & 0 deletions src/portable/synopsys/dwc2/dwc2_stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
#define EP_MAX_FS USB_OTG_FS_MAX_IN_ENDPOINTS
#define EP_FIFO_SIZE_FS USB_OTG_FS_TOTAL_FIFO_SIZE

#define EP_MAX_HS USB_OTG_HS_MAX_IN_ENDPOINTS
#define EP_FIFO_SIZE_HS USB_OTG_HS_TOTAL_FIFO_SIZE

#elif CFG_TUSB_MCU == OPT_MCU_STM32F4
#include "stm32f4xx.h"
#define EP_MAX_FS USB_OTG_FS_MAX_IN_ENDPOINTS
Expand Down
2 changes: 1 addition & 1 deletion tools/build_family.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def filter_with_input(mylist):
def build_family(example, family):
all_boards = []
for entry in os.scandir("hw/bsp/{}/boards".format(family)):
if entry.is_dir():
if entry.is_dir() and entry.name != 'pico_sdk':
all_boards.append(entry.name)
filter_with_input(all_boards)
all_boards.sort()
Expand Down
45 changes: 26 additions & 19 deletions tools/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,34 @@
def skip_example(example, board):
ex_dir = pathlib.Path('examples/') / example
bsp = pathlib.Path("hw/bsp")

board_dir = list(bsp.glob("*/boards/" + board))
if not board_dir:
# Skip unknown boards
return True

board_dir = list(board_dir)[0]

family_dir = board_dir.parent.parent
family = family_dir.name

# family CMake
family_mk = family_dir / "family.cmake"

# family.mk
if not family_mk.exists():
family_mk = family_dir / "family.mk"

mk_contents = family_mk.read_text()
if (bsp / board / "board.mk").exists():
# board without family
board_dir = bsp / board
family = ""
mk_contents = ""
else:
# board within family
board_dir = list(bsp.glob("*/boards/" + board))
if not board_dir:
# Skip unknown boards
return True

board_dir = list(board_dir)[0]

family_dir = board_dir.parent.parent
family = family_dir.name

# family CMake
family_mk = family_dir / "family.cmake"

# family.mk
if not family_mk.exists():
family_mk = family_dir / "family.mk"

mk_contents = family_mk.read_text()

# Find the mcu
# Find the mcu, first in family mk then board mk
if "CFG_TUSB_MCU=OPT_MCU_" not in mk_contents:
board_mk = board_dir / "board.cmake"
if not board_mk.exists():
Expand Down

0 comments on commit 19956f0

Please sign in to comment.