Skip to content

Commit f45a893

Browse files
authored
Merge pull request #17 from RT-Thread/copilot/update-repository-status
Remove Rust components, update rt-thread, and add CI support
2 parents 6c52362 + c7dd438 commit f45a893

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+138
-7153
lines changed

.github/workflows/bsp_build.yml

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
#
2+
# Copyright (c) 2025, RT-Thread Development Team
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
7+
name: BSP Build Check
8+
9+
# Controls when the action will run
10+
on:
11+
push:
12+
branches:
13+
- main
14+
- master
15+
paths:
16+
- 'machines/**'
17+
- 'rt-thread'
18+
- '.github/workflows/bsp_build.yml'
19+
pull_request:
20+
branches:
21+
- main
22+
- master
23+
paths:
24+
- 'machines/**'
25+
- 'rt-thread'
26+
- '.github/workflows/bsp_build.yml'
27+
workflow_dispatch:
28+
29+
permissions:
30+
contents: read
31+
32+
jobs:
33+
build:
34+
runs-on: ubuntu-22.04
35+
name: Build ${{ matrix.bsp }}
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- bsp: qemu-virt-riscv64
41+
toolchain: riscv64-unknown-elf
42+
toolchain_url: https://github.com/RT-Thread/toolchains-ci/releases/download/v1.4/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14.tar.gz
43+
toolchain_path: /opt/riscv64-unknown-elf-toolchain-10.2.0-2020.12.8-x86_64-linux-ubuntu14
44+
45+
- bsp: qemu-vexpress-a9
46+
toolchain: arm-none-eabi
47+
apt_install: gcc-arm-none-eabi
48+
49+
- bsp: qemu-virt-aarch64
50+
toolchain: aarch64-none-elf
51+
toolchain_url: https://github.com/RT-Thread/toolchains-ci/releases/download/v1.6/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf.tar.xz
52+
toolchain_path: /opt/gcc-arm-10.2-2020.11-x86_64-aarch64-none-elf
53+
54+
- bsp: stm32f407-rt-spark
55+
toolchain: arm-none-eabi
56+
apt_install: gcc-arm-none-eabi
57+
58+
steps:
59+
- name: Checkout repository
60+
uses: actions/checkout@v4
61+
with:
62+
submodules: recursive
63+
64+
- name: Set up Python
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: '3.x'
68+
69+
- name: Install scons
70+
run: |
71+
python -m pip install --upgrade pip
72+
pip install scons
73+
74+
- name: Install toolchain (apt)
75+
if: matrix.apt_install
76+
run: |
77+
sudo apt-get update
78+
sudo apt-get install -y ${{ matrix.apt_install }}
79+
80+
- name: Cache toolchain
81+
if: matrix.toolchain_url
82+
id: cache-toolchain
83+
uses: actions/cache@v4
84+
with:
85+
path: ${{ matrix.toolchain_path }}
86+
key: ${{ runner.os }}-${{ matrix.toolchain }}-${{ matrix.toolchain_url }}
87+
88+
- name: Download and install toolchain
89+
if: matrix.toolchain_url && steps.cache-toolchain.outputs.cache-hit != 'true'
90+
run: |
91+
wget -q ${{ matrix.toolchain_url }}
92+
filename=$(basename ${{ matrix.toolchain_url }})
93+
if [[ $filename == *.tar.gz ]]; then
94+
sudo tar -xzf $filename -C /opt || { echo "Failed to extract $filename"; exit 1; }
95+
elif [[ $filename == *.tar.xz ]]; then
96+
sudo tar -xf $filename -C /opt || { echo "Failed to extract $filename"; exit 1; }
97+
elif [[ $filename == *.tar.bz2 ]]; then
98+
sudo tar -xjf $filename -C /opt || { echo "Failed to extract $filename"; exit 1; }
99+
else
100+
echo "Unsupported archive format: $filename"
101+
exit 1
102+
fi
103+
104+
- name: Verify toolchain
105+
run: |
106+
if [ -n "${{ matrix.toolchain_path }}" ]; then
107+
export RTT_EXEC_PATH=${{ matrix.toolchain_path }}/bin
108+
$RTT_EXEC_PATH/${{ matrix.toolchain }}-gcc --version
109+
else
110+
${{ matrix.toolchain }}-gcc --version
111+
fi
112+
113+
- name: Build BSP
114+
run: |
115+
cd machines/${{ matrix.bsp }}
116+
if [ -n "${{ matrix.toolchain_path }}" ]; then
117+
export RTT_EXEC_PATH=${{ matrix.toolchain_path }}/bin
118+
fi
119+
scons -j$(nproc)
120+
121+
- name: Upload build artifacts
122+
if: success()
123+
uses: actions/upload-artifact@v4
124+
with:
125+
name: ${{ matrix.bsp }}-build
126+
path: |
127+
machines/${{ matrix.bsp }}/*.bin
128+
machines/${{ matrix.bsp }}/*.elf
129+
machines/${{ matrix.bsp }}/*.hex
130+
if-no-files-found: ignore

machines/qemu-virt-aarch64/applications/console.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static int console_init()
3232
}
3333
INIT_ENV_EXPORT(console_init);
3434

35-
static int console(int argc, char **argv)
35+
static int virtio_console_cmd(int argc, char **argv)
3636
{
3737
rt_err_t result = RT_EOK;
3838

@@ -45,16 +45,16 @@ static int console(int argc, char **argv)
4545
}
4646
else
4747
{
48-
rt_kprintf("Unknown command. Please enter 'console' for help\n");
48+
rt_kprintf("Unknown command. Please enter 'virtio_console' for help\n");
4949
result = -RT_ERROR;
5050
}
5151
}
5252
else
5353
{
5454
rt_kprintf("Usage: \n");
55-
rt_kprintf("console set <name> - change console by name\n");
55+
rt_kprintf("virtio_console set <name> - change console by name\n");
5656
result = -RT_ERROR;
5757
}
5858
return result;
5959
}
60-
MSH_CMD_EXPORT(console, set console name);
60+
MSH_CMD_EXPORT_ALIAS(virtio_console_cmd, virtio_console, set virtio console name);

machines/qemu-virt-riscv64/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ PKGS_DIR := packages
99
source "$(RTT_DIR)/Kconfig"
1010
osource "$PKGS_DIR/Kconfig"
1111
rsource "driver/Kconfig"
12-
rsource "rust/Kconfig"
1312

1413
config BOARD_QEMU_VIRT_RV64
1514
bool

machines/qemu-virt-riscv64/rtconfig.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
/* Memory Management */
111111

112112
#define RT_PAGE_MAX_ORDER 11
113+
#define RT_PAGE_AFFINITY_BLOCK_SIZE 0x1000
113114
#define RT_USING_MEMPOOL
114115
#define RT_USING_SLAB
115116
#define RT_USING_SLAB_AS_HEAP
@@ -255,6 +256,7 @@
255256

256257
#define RT_USING_SAL
257258
#define SAL_INTERNET_CHECK
259+
#define SOCKET_TABLE_STEP_LEN 4
258260

259261
/* Docking with protocol stacks */
260262

@@ -323,6 +325,7 @@
323325
#define RT_USING_UTEST
324326
#define UTEST_THR_STACK_SIZE 4096
325327
#define UTEST_THR_PRIORITY 20
328+
#define RT_UTEST_MAX_OPTIONS 64
326329
#define RT_USING_RESOURCE_ID
327330
#define RT_USING_ADT
328331
#define RT_USING_ADT_AVL

machines/qemu-virt-riscv64/rust/Kconfig

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

0 commit comments

Comments
 (0)