Skip to content

Commit ba2f229

Browse files
authored
Merge pull request #2668 from hathach/add-c6-board
Add esp c6 devkit board
2 parents d10b65a + 8df372a commit ba2f229

File tree

12 files changed

+95
-74
lines changed

12 files changed

+95
-74
lines changed

.github/actions/setup_toolchain/download/action.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,13 @@ runs:
2424
run: |
2525
mkdir -p ~/cache/${{ inputs.toolchain }}
2626
wget --progress=dot:giga ${{ inputs.toolchain_url }} -O toolchain.tar.gz
27-
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
27+
if [[ ${{ inputs.toolchain }} == rx-gcc ]]; then
28+
mv toolchain.tar.gz toolchain.run
29+
chmod +x toolchain.run
30+
./toolchain.run -p ~/cache/${{ inputs.toolchain }}/gnurx -y
31+
else
32+
tar -C ~/cache/${{ inputs.toolchain }} -xaf toolchain.tar.gz
33+
fi
2834
shell: bash
2935

3036
- name: Set Toolchain Path

.github/workflows/build.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ jobs:
5151
# Build CMake
5252
# ---------------------------------------
5353
cmake:
54+
# if: false
5455
needs: set-matrix
5556
uses: ./.github/workflows/build_util.yml
5657
strategy:
5758
fail-fast: false
5859
matrix:
5960
toolchain:
61+
# - 'arm-clang' is built by circle-ci
6062
- 'aarch64-gcc'
61-
# - 'arm-clang' # clang is built by circle-ci
6263
- 'arm-gcc'
6364
- 'msp430-gcc'
6465
- 'riscv-gcc'
@@ -73,18 +74,19 @@ jobs:
7374
# Build Make
7475
# ---------------------------------------
7576
make:
76-
#if: github.event_name == 'pull_request'
77+
# if: false
7778
needs: set-matrix
7879
uses: ./.github/workflows/build_util.yml
7980
strategy:
8081
fail-fast: false
8182
matrix:
8283
toolchain:
84+
# 'arm-clang' is built by circle-ci
8385
- 'aarch64-gcc'
84-
# - 'arm-clang' # clang is built by circle-ci
8586
- 'arm-gcc'
8687
- 'msp430-gcc'
8788
- 'riscv-gcc'
89+
- 'rx-gcc'
8890
with:
8991
build-system: 'make'
9092
toolchain: ${{ matrix.toolchain }}
@@ -112,6 +114,7 @@ jobs:
112114
# Build Espressif
113115
# ---------------------------------------
114116
espressif:
117+
# if: false
115118
uses: ./.github/workflows/build_util.yml
116119
strategy:
117120
fail-fast: false
@@ -131,6 +134,7 @@ jobs:
131134
# Build IAR on HFP self-hosted
132135
# ---------------------------------------
133136
arm-iar:
137+
# if: false
134138
if: github.repository_owner == 'hathach'
135139
needs: set-matrix
136140
runs-on: [self-hosted, Linux, X64, hifiphile]

.github/workflows/build_renesas.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

.github/workflows/ci_set_matrix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"arm-iar": "",
88
"arm-gcc": "",
99
"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",
10-
"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"
10+
"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",
11+
"rx-gcc": "http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run",
1112
}
1213

1314
# family: [supported toolchain]
@@ -27,6 +28,7 @@
2728
"nrf": ["arm-gcc", "arm-clang"],
2829
"ra": ["arm-gcc"],
2930
"rp2040": ["arm-gcc"],
31+
"rx": ["rx-gcc"],
3032
"samd11 samd21 saml2x": ["arm-gcc", "arm-clang"],
3133
"samd5x_e5x samg": ["arm-gcc", "arm-clang"],
3234
"stm32f0 stm32f1 stm32f2 stm32f3": ["arm-gcc", "arm-clang", "arm-iar"],

.idea/cmake.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

hw/bsp/ch32v20x/boards/ch32v203_r0_1v0/board.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ set(MCU_VARIANT D6)
33
set(LD_FLASH_SIZE 64K)
44
set(LD_RAM_SIZE 20K)
55

6+
# set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/../../linker/${CH32_FAMILY}_tinyuf2.ld)
7+
68
function(update_board TARGET)
79
target_compile_definitions(${TARGET} PUBLIC
810
CFG_EXAMPLE_MSC_DUAL_READONLY

hw/bsp/ch32v20x/family.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void board_init(void) {
127127
}
128128

129129
void board_led_write(bool state) {
130-
GPIO_WriteBit(LED_PORT, LED_PIN, state);
130+
GPIO_WriteBit(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
131131
}
132132

133133
uint32_t board_button_read(void) {

hw/bsp/ch32v20x/family.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include_guard()
22

3+
set(UF2_FAMILY_ID 0x699b62ec)
34
set(CH32_FAMILY ch32v20x)
45
set(SDK_DIR ${TOP}/hw/mcu/wch/${CH32_FAMILY})
56
set(SDK_SRC_DIR ${SDK_DIR}/EVT/EXAM/SRC)
@@ -128,4 +129,7 @@ function(family_configure_example TARGET RTOS)
128129
# Flashing
129130
family_add_bin_hex(${TARGET})
130131
family_flash_openocd_wch(${TARGET})
132+
133+
#family_add_uf2(${TARGET} ${UF2_FAMILY_ID})
134+
#family_flash_uf2(${TARGET} ${UF2_FAMILY_ID})
131135
endfunction()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Apply board specific content here
2+
set(IDF_TARGET "esp32c6")
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2020, Ha Thach (tinyusb.org)
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*
24+
* This file is part of the TinyUSB stack.
25+
*/
26+
27+
#ifndef BOARD_H_
28+
#define BOARD_H_
29+
30+
#ifdef __cplusplus
31+
extern "C" {
32+
#endif
33+
34+
#define NEOPIXEL_PIN 8
35+
36+
#define BUTTON_PIN 9
37+
#define BUTTON_STATE_ACTIVE 0
38+
39+
// SPI for USB host shield
40+
#define MAX3421_SPI_HOST SPI2_HOST
41+
#define MAX3421_SCK_PIN 4
42+
#define MAX3421_MOSI_PIN 6
43+
#define MAX3421_MISO_PIN 5
44+
#define MAX3421_CS_PIN 10
45+
#define MAX3421_INTR_PIN 7
46+
47+
#ifdef __cplusplus
48+
}
49+
#endif
50+
51+
#endif /* BOARD_H_ */

0 commit comments

Comments
 (0)