Merge branch 'hathach:master' into master

This commit is contained in:
tinic 2024-06-12 08:33:48 -07:00 committed by GitHub
commit a0006e6861
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 95 additions and 74 deletions

View File

@ -24,7 +24,13 @@ runs:
run: |
mkdir -p ~/cache/${{ inputs.toolchain }}
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
mv toolchain.tar.gz toolchain.run
chmod +x toolchain.run
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
else
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
fi
shell: bash
- name: Set Toolchain Path

View File

@ -51,14 +51,15 @@ jobs:
# Build CMake
# ---------------------------------------
cmake:
# if: false
needs: set-matrix
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
toolchain:
# - 'arm-clang' is built by circle-ci
- 'aarch64-gcc'
# - 'arm-clang' # clang is built by circle-ci
- 'arm-gcc'
- 'msp430-gcc'
- 'riscv-gcc'
@ -73,18 +74,19 @@ jobs:
# Build Make
# ---------------------------------------
make:
#if: github.event_name == 'pull_request'
# if: false
needs: set-matrix
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
matrix:
toolchain:
# 'arm-clang' is built by circle-ci
- 'aarch64-gcc'
# - 'arm-clang' # clang is built by circle-ci
- 'arm-gcc'
- 'msp430-gcc'
- 'riscv-gcc'
- 'rx-gcc'
with:
build-system: 'make'
toolchain: ${{ matrix.toolchain }}
@ -112,6 +114,7 @@ jobs:
# Build Espressif
# ---------------------------------------
espressif:
# if: false
uses: ./.github/workflows/build_util.yml
strategy:
fail-fast: false
@ -131,6 +134,7 @@ jobs:
# Build IAR on HFP self-hosted
# ---------------------------------------
arm-iar:
# if: false
if: github.repository_owner == 'hathach'
needs: set-matrix
runs-on: [self-hosted, Linux, X64, hifiphile]

View File

@ -1,66 +0,0 @@
name: Build Renesas
on:
workflow_dispatch:
push:
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- 'tools/get_deps.py'
- '.github/workflows/build_renesas.yml'
pull_request:
branches: [ master ]
paths:
- 'src/**'
- 'examples/**'
- 'lib/**'
- 'hw/**'
- 'tools/get_deps.py'
- '.github/workflows/build_renesas.yml'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-rx:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
family:
# Alphabetical order
- 'rx'
steps:
- name: Checkout TinyUSB
uses: actions/checkout@v4
- name: Set Toolchain URL
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run
- name: Cache Toolchain
uses: actions/cache@v4
id: cache-toolchain
with:
path: ~/cache/
key: ${{ runner.os }}-21-03-30-${{ env.TOOLCHAIN_URL }}
- name: Install Toolchain
if: steps.cache-toolchain.outputs.cache-hit != 'true'
run: |
mkdir -p ~/cache/toolchain/gnurx
wget --progress=dot:mega $TOOLCHAIN_URL -O toolchain.run
chmod +x toolchain.run
./toolchain.run -p ~/cache/toolchain/gnurx -y
- name: Set Toolchain Path
run: echo >> $GITHUB_PATH `echo ~/cache/toolchain/*/bin`
- name: Get Dependencies
run: |
python3 tools/get_deps.py ${{ matrix.family }}
- name: Build
run: python3 tools/build.py -s make ${{ matrix.family }}

View File

@ -7,7 +7,8 @@ toolchain_list = {
"arm-iar": "",
"arm-gcc": "",
"msp430-gcc": "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",
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz"
"riscv-gcc": "https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v13.2.0-2/xpack-riscv-none-elf-gcc-13.2.0-2-linux-x64.tar.gz",
"rx-gcc": "http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run",
}
# family: [supported toolchain]
@ -27,6 +28,7 @@ family_list = {
"nrf": ["arm-gcc", "arm-clang"],
"ra": ["arm-gcc"],
"rp2040": ["arm-gcc"],
"rx": ["rx-gcc"],
"samd11 samd21 saml2x": ["arm-gcc", "arm-clang"],
"samd5x_e5x samg": ["arm-gcc", "arm-clang"],
"stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],

2
.idea/cmake.xml generated
View File

@ -131,7 +131,7 @@
<configuration PROFILE_NAME="fomu" ENABLED="false" GENERATION_OPTIONS="-DBOARD=fomu" />
<configuration PROFILE_NAME="sipeed_longan_nano" ENABLED="false" GENERATION_OPTIONS="-DBOARD=sipeed_longan_nano" />
<configuration PROFILE_NAME="nanoch32v203" ENABLED="false" GENERATION_OPTIONS="-DBOARD=nanoch32v203" />
<configuration PROFILE_NAME="ch32v203_r0_1v0" ENABLED="false" CONFIG_NAME="MinSizeRel" GENERATION_OPTIONS="-DBOARD=ch32v203_r0_1v0" />
<configuration PROFILE_NAME="ch32v203_r0_1v0" ENABLED="true" CONFIG_NAME="MinSizeRel" GENERATION_OPTIONS="-DBOARD=ch32v203_r0_1v0" />
<configuration PROFILE_NAME="ch32v203_r0_1v0 USBFS" ENABLED="false" CONFIG_NAME="MinSizeRel" GENERATION_OPTIONS="-DBOARD=ch32v203_r0_1v0 -DPORT=1" />
<configuration PROFILE_NAME="ch32v307v_r1_1v0" ENABLED="false" GENERATION_OPTIONS="-DBOARD=ch32v307v_r1_1v0 -DLOG=2" />
<configuration PROFILE_NAME="ch32v307v_r1_1v0 USBFS" ENABLED="false" GENERATION_OPTIONS="-DBOARD=ch32v307v_r1_1v0 -DSPEED=full" />

View File

@ -3,6 +3,8 @@ set(MCU_VARIANT D6)
set(LD_FLASH_SIZE 64K)
set(LD_RAM_SIZE 20K)
# set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/../../linker/${CH32_FAMILY}_tinyuf2.ld)
function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
CFG_EXAMPLE_MSC_DUAL_READONLY

View File

@ -127,7 +127,7 @@ void board_init(void) {
}
void board_led_write(bool state) {
GPIO_WriteBit(LED_PORT, LED_PIN, state);
GPIO_WriteBit(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
}
uint32_t board_button_read(void) {

View File

@ -1,5 +1,6 @@
include_guard()
set(UF2_FAMILY_ID 0x699b62ec)
set(CH32_FAMILY ch32v20x)
set(SDK_DIR ${TOP}/hw/mcu/wch/${CH32_FAMILY})
set(SDK_SRC_DIR ${SDK_DIR}/EVT/EXAM/SRC)
@ -128,4 +129,7 @@ function(family_configure_example TARGET RTOS)
# Flashing
family_add_bin_hex(${TARGET})
family_flash_openocd_wch(${TARGET})
#family_add_uf2(${TARGET} ${UF2_FAMILY_ID})
#family_flash_uf2(${TARGET} ${UF2_FAMILY_ID})
endfunction()

View File

@ -0,0 +1,2 @@
# Apply board specific content here
set(IDF_TARGET "esp32c6")

View File

@ -0,0 +1,51 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2020, 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 NEOPIXEL_PIN 8
#define BUTTON_PIN 9
#define BUTTON_STATE_ACTIVE 0
// SPI for USB host shield
#define MAX3421_SPI_HOST SPI2_HOST
#define MAX3421_SCK_PIN 4
#define MAX3421_MOSI_PIN 6
#define MAX3421_MISO_PIN 5
#define MAX3421_CS_PIN 10
#define MAX3421_INTR_PIN 7
#ifdef __cplusplus
}
#endif
#endif /* BOARD_H_ */

View File

@ -6,6 +6,8 @@ include(CMakePrintHelpers)
set(TOP "${CMAKE_CURRENT_LIST_DIR}/../..")
get_filename_component(TOP ${TOP} ABSOLUTE)
set(UF2CONV_PY ${TOP}/tools/uf2/utils/uf2conv.py)
#-------------------------------------------------------------
# Toolchain
# Can be changed via -DTOOLCHAIN=gcc|iar or -DCMAKE_C_COMPILER=
@ -296,6 +298,13 @@ function(family_add_bin_hex TARGET)
VERBATIM)
endfunction()
# Add uf2 output
function(family_add_uf2 TARGET FAMILY_ID)
set(BIN_FILE $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.hex)
add_custom_command(TARGET ${TARGET} POST_BUILD
COMMAND python ${UF2CONV_PY} -f ${FAMILY_ID} -c -o $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.uf2 ${BIN_FILE}
VERBATIM)
endfunction()
#----------------------------------
# Example Target Configure (Default rule)
@ -461,6 +470,13 @@ function(family_flash_pyocd TARGET)
)
endfunction()
# Flash with UF2
function(family_flash_uf2 TARGET FAMILY_ID)
add_custom_target(${TARGET}-uf2
DEPENDS ${TARGET}
COMMAND python ${UF2CONV_PY} -f ${FAMILY_ID} --deploy $<TARGET_FILE_DIR:${TARGET}>/${TARGET}.uf2
)
endfunction()
# Add flash teensy_cli target
function(family_flash_teensy TARGET)

View File

@ -14,7 +14,7 @@ deps_mandatory = {
'159e31b689577dbf69cf0683bbaffbd71fa5ee10',
'all'],
'tools/uf2': ['https://github.com/microsoft/uf2.git',
'19615407727073e36d81bf239c52108ba92e7660',
'c594542b2faa01cc33a2b97c9fbebc38549df80a',
'all'],
}