Skip to content

Commit 4ad41ef

Browse files
authored
Merge branch 'RT-Thread:master' into use_rttpkgtool_for_aarch64
2 parents c70a9b2 + 0500df5 commit 4ad41ef

File tree

527 files changed

+17091
-674684
lines changed

Some content is hidden

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

527 files changed

+17091
-674684
lines changed

.github/workflows/action_tools.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,14 @@ jobs:
6262
6363
- name: Build Tools
6464
run: |
65+
source ~/.env/env.sh
6566
scons --pyconfig-silent -C $TEST_BSP_ROOT 2>menuconfig.log
6667
cat menuconfig.log
6768
if grep -q "warning:" menuconfig.log; then
6869
echo "Errors found in menuconfig, failing the build."
6970
exit 1
7071
fi
72+
pushd $TEST_BSP_ROOT && pkgs --update && popd
7173
scons -j$(nproc) -C $TEST_BSP_ROOT
7274
7375
- name: Project generate Tools

.github/workflows/bsp_buildings.yml

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
#
2+
# Copyright (c) 2025, RT-Thread Development Team
3+
#
4+
# SPDX-License-Identifier: Apache-2.0
5+
#
6+
# Change Logs:
7+
# Date Author Notes
8+
# 2025-03-22 Supperthomas 添加upload 上传编译固件
9+
#
110
name: RT-Thread BSP Static Build Check
211

312
# Controls when the action will run. Triggers the workflow on push or pull request
@@ -41,11 +50,11 @@ jobs:
4150
RTT_TOOL_CHAIN: "sourcery-arm"
4251
SUB_RTT_BSP:
4352
- "stm32/stm32f407-rt-spark"
44-
- RTT_BSP: "RTduino/Arduino Libraries (STM32F412 Nucleo)"
53+
- RTT_BSP: "RTduino_Arduino Libraries (STM32F412 Nucleo)"
4554
RTT_TOOL_CHAIN: "sourcery-arm"
4655
SUB_RTT_BSP:
4756
- "stm32/stm32f412-st-nucleo"
48-
- RTT_BSP: "RTduino/Arduino Libraries (Raspberry Pico)"
57+
- RTT_BSP: "RTduino_Arduino Libraries (Raspberry Pico)"
4958
RTT_TOOL_CHAIN: "sourcery-arm"
5059
SUB_RTT_BSP:
5160
- "raspberry-pico"
@@ -192,6 +201,7 @@ jobs:
192201
- "stm32/stm32f767-st-nucleo"
193202
- "stm32/stm32f769-st-disco"
194203
- "stm32/stm32f723-st-disco"
204+
- "stm32/stm32g030-tiny-board"
195205
- "stm32/stm32g070-st-nucleo"
196206
- "stm32/stm32g071-st-nucleo"
197207
- "stm32/stm32g431-st-nucleo"
@@ -432,22 +442,22 @@ jobs:
432442
id: cache-gcc-arm
433443
uses: actions/cache@main
434444
with:
435-
path: /opt/gcc-arm-none-eabi-10-2020-q4-major
436-
key: ${{ runner.os }}-arm-none-eabi-10-2020-q4-major
445+
path: /opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi
446+
key: ${{ runner.os }}-arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi
437447

438448
- name: Download Arm ToolChains
439449
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm' && (steps.cache-gcc-arm.outputs.cache-hit != 'true') }}
440450
shell: bash
441451
run: |
442-
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.3/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2
443-
sudo tar xjf gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2 -C /opt
452+
wget -q https://github.com/RT-Thread/toolchains-ci/releases/download/v1.8/arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz
453+
sudo tar -xf arm-gnu-toolchain-13.2.rel1-x86_64-arm-none-eabi.tar.xz -C /opt
444454
445455
- name: Install Arm ToolChains2
446456
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'sourcery-arm'}}
447457
shell: bash
448458
run: |
449-
/opt/gcc-arm-none-eabi-10-2020-q4-major/bin/arm-none-eabi-gcc --version
450-
echo "RTT_EXEC_PATH=/opt/gcc-arm-none-eabi-10-2020-q4-major/bin" >> $GITHUB_ENV
459+
/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin/arm-none-eabi-gcc --version
460+
echo "RTT_EXEC_PATH=/opt/arm-gnu-toolchain-13.2.Rel1-x86_64-arm-none-eabi/bin" >> $GITHUB_ENV
451461
452462
- name: Install LLVM-Arm ToolChains
453463
if: ${{ matrix.legs.RTT_TOOL_CHAIN == 'llvm-arm' && success() }}
@@ -535,9 +545,36 @@ jobs:
535545
source ~/.env/env.sh
536546
python tools/ci/bsp_buildings.py
537547
548+
- name: Upload output as artifact
549+
if: ${{ success() }}
550+
uses: actions/upload-artifact@main
551+
with:
552+
name: ${{ matrix.legs.RTT_BSP }}
553+
if-no-files-found: ignore
554+
path: output/
555+
538556
- name: Post failure comment
539557
if: failure()
540558
run: |
541559
curl -X POST -H "Authorization: token ${{ secrets.RTTHREAD_GITHUB_TOKEN }}" \
542560
-d '{"body":"@${{ github.actor }}, Thank you for your contribution, but there was an error with the action. Could you please help check the BSP compilation issue? Thank you."}' \
543561
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
562+
# 整合所有的output为一个文件夹
563+
collect-artifacts:
564+
needs: build
565+
runs-on: ubuntu-latest
566+
if: github.event_name != 'pull_request' #排除Pull request
567+
steps:
568+
#这里会下载所有产物
569+
- name: Download all artifacts
570+
uses: actions/download-artifact@main
571+
with:
572+
path: output/
573+
merge-multiple: true
574+
- run: ls -R output/
575+
576+
- name: Upload combined output as artifact
577+
uses: actions/upload-artifact@main
578+
with:
579+
name: 00_all_bsp_output_${{ github.sha }}
580+
path: output/

bsp/at32/tools/sdk_dist.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,11 @@ def dist_do_building(BSP_ROOT, dist_dir):
2828
print("=> copy at32 bsp library")
2929
library_dir = os.path.join(dist_dir, 'libraries')
3030
library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries')
31-
bsp_copy_files(
32-
os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
33-
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE),
34-
)
31+
if rtconfig.BSP_LIBRARY_TYPE is not None:
32+
bsp_copy_files(
33+
os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE),
34+
os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE),
35+
)
3536

3637
print("=> copy bsp drivers")
3738
bsp_copy_files(os.path.join(library_path, 'rt_drivers'), os.path.join(library_dir, 'rt_drivers'))

bsp/cvitek/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,16 @@ $ sudo dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb
350350

351351
3. 如发现切换开发板编译正常,但无法正常打包,请切换至自动下载的 `cvi_bootloader` 目录,并手工运行 `git pull` 更新,或删除该目录后重新自动下载。
352352

353+
4. 有关配置 pinmux(管脚复用)的通用方法, 以 duo256m 配置大核(`bsp/cvitek/cv18xx_risc-v`)的 UART0 输出为例。
354+
- duo256m 控制台默认使用 UART0。查看 [duo256m 的板级输出引脚定义](https://milkv.io/docs/duo/getting-started/duo256m#gpio-pinout),找到 UART0 的 `UART0_RX``UART0_TX` 对应板上引脚为 `GP13``XGPIOA[17]`) 和 `GP12``XGPIOA[16]`)。这也是我们需要连接串口线的引脚。
355+
- duo256m 使用的 SoC 为 SG2002。查看 [SG2002 TRM 手册的 "CHAPTER 10 管脚复用与控制"](https://github.com/sophgo/sophgo-doc/releases),TRM 让我们查看在线表格: <https://github.com/sophgo/sophgo-hardware/blob/master/SG200X/04_SG2002/04_SG2002_PINOUT.xls>。在 “1. 管脚信息表(QFN)” 那一页,对于 `UART0_RX`,我们搜索 “`XGPIOA[17]`” 可以找到其所在行的 "Pin Name" 那一列的值是 “`UART0_RX`”;对于 `UART0_TX`,我们搜索 “XGPIOA[16]” 可以找到其所在行的 "Pin Name" 那一列的值是 “`UART0_TX`”。***注意,这里对于 UART0,duo256m 的 “Pin Name” 和板上引脚中的 UART 信息字符串正好一致,但其他的外设就不一定了。具体的 “Pin Name” 以 xls 表格上的为准***
356+
- 执行 `scons --menuconfig`, 进入 “(Top) → General Drivers Configuration → Using UART”,设置 “uart0 rx pin name” 为 “UART0_RX”;设置 “uart0 tx pin name” 为 “UART0_TX”。这也是目前默认的配置。
357+
353358
# 8. 联系人信息
354359

355-
维护人:[flyingcys](https://github.com/flyingcys)
360+
维护人:
361+
362+
- [flyingcys](https://github.com/flyingcys)
363+
- Chen Wang <[email protected]>
356364

357365
更多信息请参考 [https://riscv-rtthread-programming-manual.readthedocs.io](https://riscv-rtthread-programming-manual.readthedocs.io)

bsp/cvitek/drivers/drv_spi.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ static rt_err_t spi_configure(struct rt_spi_device *device, struct rt_spi_config
7373
RT_ASSERT(device->bus->parent.user_data != RT_NULL);
7474
RT_ASSERT(cfg != RT_NULL);
7575

76-
rt_err_t ret = RT_EOK;
7776
struct _device_spi *spi = (struct _device_spi *)device->bus->parent.user_data;
7877
struct dw_spi *dws = &spi->dws;
7978

@@ -139,9 +138,6 @@ static rt_err_t spi_configure(struct rt_spi_device *device, struct rt_spi_config
139138

140139
static rt_err_t dw_spi_transfer_one(struct dw_spi *dws, const void *tx_buf, void *rx_buf, uint32_t len, enum transfer_type tran_type)
141140
{
142-
uint8_t imask = 0;
143-
uint16_t txlevel = 0;
144-
145141
dws->tx = NULL;
146142
dws->tx_end = NULL;
147143
dws->rx = NULL;
@@ -198,7 +194,7 @@ static rt_ssize_t spi_xfer(struct rt_spi_device *device, struct rt_spi_message *
198194

199195
struct _device_spi *spi = (struct _device_spi *)device->bus->parent.user_data;
200196
struct dw_spi *dws = &spi->dws;
201-
int32_t ret = 0;
197+
int32_t ret = RT_EOK;
202198

203199
if (message->send_buf && message->recv_buf)
204200
{
@@ -214,6 +210,14 @@ static rt_ssize_t spi_xfer(struct rt_spi_device *device, struct rt_spi_message *
214210
{
215211
ret = dw_spi_transfer_one(dws, RT_NULL, message->recv_buf, message->length, POLL_TRAN);
216212

213+
} else {
214+
return 0;
215+
}
216+
217+
if (ret != RT_EOK)
218+
{
219+
LOG_E("spi transfer error : %d", ret);
220+
return 0;
217221
}
218222

219223
return message->length;
@@ -329,13 +333,12 @@ static void rt_hw_spi_pinmux_config()
329333
int rt_hw_spi_init(void)
330334
{
331335
rt_err_t ret = RT_EOK;
332-
struct dw_spi *dws;
333336

334337
rt_hw_spi_pinmux_config();
335338

336339
for (rt_size_t i = 0; i < sizeof(_spi_obj) / sizeof(struct _device_spi); i++)
337340
{
338-
_spi_obj[i].base_addr = (rt_ubase_t)DRV_IOREMAP((void *)_spi_obj[i].base_addr, 0x1000);
341+
_spi_obj[i].dws.regs = (void *)DRV_IOREMAP((void *)_spi_obj[i].dws.regs, 0x1000);
339342

340343
_spi_obj[i].spi_bus.parent.user_data = (void *)&_spi_obj[i];
341344
ret = rt_spi_bus_register(&_spi_obj[i].spi_bus, _spi_obj[i].device_name, &_spi_ops);

bsp/cvitek/drivers/libraries/spi/dw_spi.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* limitations under the License.
1515
*/
1616
#include <errno.h>
17+
#include <rtthread.h>
1718
#include <string.h>
1819
#include <stdio.h>
1920

@@ -23,9 +24,12 @@
2324
#include <rthw.h>
2425

2526
#ifdef SPI_DEBUG
26-
#define SP_DEBUG_LOG printf
27+
#define SP_DEBUG_LOG(fmt, ...) \
28+
do { \
29+
rt_kprintf(fmt, ##__VA_ARGS__); \
30+
} while(0)
2731
#else
28-
#define SP_DEBUG_LOG
32+
#define SP_DEBUG_LOG(fmt, ...)
2933
#endif
3034

3135
/* Restart the controller, disable all interrupts, clean rx fifo */

bsp/nrf5x/nrf52833/rtconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
CFLAGS += ' -O2'
5656

5757
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
58-
58+
POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n'
59+
5960
elif PLATFORM == 'armcc':
6061
# toolchains
6162
CC = 'armcc'

bsp/nrf5x/nrf52840/rtconfig.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@
5555
CFLAGS += ' -O2'
5656

5757
POST_ACTION = OBJCPY + ' -O binary $TARGET rtthread.bin\n' + SIZE + ' $TARGET \n'
58-
58+
POST_ACTION += OBJCPY + ' -O ihex $TARGET rt-thread.hex\n'
59+
5960
elif PLATFORM == 'armcc':
6061
# toolchains
6162
CC = 'armcc'

bsp/stm32/libraries/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ config SOC_SERIES_STM32F4
2525
bool
2626
select ARCH_ARM_CORTEX_M4
2727
select SOC_FAMILY_STM32
28+
select PKG_USING_STM32F4_HAL_DRIVER
2829

2930
config SOC_SERIES_STM32F7
3031
bool

0 commit comments

Comments
 (0)