RT-Thread / RT-Thread/rt-thread

[Feature] RTT BSP 瘦身计划

Open
#9,960 50 comments 3 reactions 1 assignee View on GitHub

@mysterywolf is already working on this.

Since Feb 11, 2025.

Dominant language
C
Stars
12.2k
Forks
5.4k
Avg merge
4d 12h
Merged PRs (30d)
40

Description

Describe problem solved by the proposed feature

由于bsp目前过于大,现在大家下载整个rtthread也过于庞大,
但是下下来之后,大部分是bsp的内容,bsp和.git的内容占到大小的90%
Image
可以看到bsp占了2.2G,外加904M的.git
实际上RTTHREAD内部代码占到100M左右,包括文档。差不多3%左右。
目前BSP大头也是芯片比较多的厂商

Image

之前为了方便大家能够实现开箱即用的快速开发形式,将HAL库放到BSP中,但是随着bsp越来越多,HAL也越来越庞大,而且大部分是用不到的芯片。所以为了能够方便各个芯片用户的快速使用,将厂商SDK以软件包的形式上传,保留RTTHREAD的适配,可以放到BSP中。
其他形式由于网络等因素,综合考虑目前软件包的形式优点比较明显。

Describe your preferred solution

目前希望STM32能够持续的将HAL库都剥离出来,避免其他非STM32的用户下载冗余代码。
目前比较统一建议是:
参考bsp/nrf5x和STM32/L4系列,将厂商的HAL库形成一个软件包的形式供需要的用户单独执行pkgs --update 下载
这一块后续新增bsp会强制要求将SDK整合成软件包的形式,精简bsp,没有特殊情况,不再接收厂商单独的SDK放到bsp中。
STM32系列可以参考L4系列将HAL库整合成软件包的形式。
软件包目前统一放到下面的目录中,bsp中默认选中即可。
https://github.com/RT-Thread/packages/tree/master/peripherals/hal-sdk

Describe possible alternatives

大家有好的建议也可以放到这个comment下面。

  • STM32F1
  • STM32F2
  • STM32F3
  • STM32F7
  • STM32H7

修复BSP之后请检查一下几个项目

  • bsp执行scons --dist 看是否有error,参考stm32,修复,参考 #10130
  • readme 中添加pkgs --update 明确说明,需要下载软件包

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.