Skip to content

Conversation

@QianJiu05
Copy link
Contributor

@QianJiu05 QianJiu05 commented May 27, 2025

拉取/合并请求描述:(PR description)

[

stm32f103-keysking-learning

为什么提交这份PR (why to submit this PR)

为stm32f103-keysking-learning的bsp添加uart、pwm、pulse encoder驱动

你的解决方案是什么 (what is your solution)

请提供验证的bsp和config (provide the config and bsp)

  • BSP:bsp/stm32/stm32f103-keysking-learning
  • .config:
  • action:

]

当前拉取/合并请求的状态 Intent for your PR

必须选择一项 Choose one (Mandatory):

  • 本拉取/合并请求是一个草稿版本 This PR is for a code-review and is intended to get feedback
  • 本拉取/合并请求是一个成熟版本 This PR is mature, and ready to be integrated into the repo

代码质量 Code Quality:

我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:

  • 已经仔细查看过代码改动的对比 Already check the difference between PR and old code
  • 代码风格正确,包括缩进空格,命名及其他风格 Style guide is adhered to, including spacing, naming and other styles
  • 没有垃圾代码,代码尽量精简,不包含#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up
  • 所有变更均有原因及合理的,并且不会影响到其他软件组件代码或BSP All modifications are justified and not affect other components or BSP
  • 对难懂代码均提供对应的注释 I've commented appropriately where code is tricky
  • 代码是高质量的 Code in this PR is of high quality
  • 已经使用formatting 等源码格式化工具确保格式符合RT-Thread代码规范 This PR complies with RT-Thread code specification
  • 如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@github-actions github-actions bot added BSP: STM32 BSP related with ST/STM32 BSP labels May 27, 2025
action编译报错:
  board/CubeMX_Config/Src/stm32f1xx_hal_msp.c:23:10: fatal error: main.h: No such file or directory
     23 | #include "main.h"
        |          ^~~~~~~~
# CONFIG_RT_USING_RANDOM is not set
# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
CONFIG_RT_USING_PWM=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个驱动默认不用打开吧,保持关闭就好

@Rbb666
Copy link
Member

Rbb666 commented May 28, 2025

作者是否愿意负责此BSP的看护工作,可以的话欢迎添加到MAINTAINERS中:https://github.com/RT-Thread/rt-thread/blob/master/MAINTAINERS

@QianJiu05
Copy link
Contributor Author

作者是否愿意负责此BSP的看护工作,可以的话欢迎添加到MAINTAINERS中:https://github.com/RT-Thread/rt-thread/blob/master/MAINTAINERS

请问看护需要做什么呢?跟进新功能吗

@Rbb666
Copy link
Member

Rbb666 commented May 28, 2025

作者是否愿意负责此BSP的看护工作,可以的话欢迎添加到MAINTAINERS中:https://github.com/RT-Thread/rt-thread/blob/master/MAINTAINERS

请问看护需要做什么呢?跟进新功能吗

可详见文章中的审核团成员职责章节:https://mp.weixin.qq.com/s/h3WFcTu5Y61qBxFGS8uaxQ

# CONFIG_RT_USING_PWM is not set
# CONFIG_RT_USING_PULSE_ENCODER is not set
CONFIG_RT_USING_PWM=y
CONFIG_RT_USING_PULSE_ENCODER=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里保留最小配置即可,其他配置可以用yml来加ci检查和使用。
rtconfig.h和.config没有特殊情况,不需要修改和提交

@QianJiu05
Copy link
Contributor Author

作者是否愿意负责此BSP的看护工作,可以的话欢迎添加到MAINTAINERS中:https://github.com/RT-Thread/rt-thread/blob/master/MAINTAINERS

请问是直接加还是通过后面那个链接的二维码报名呀?

@supperthomas supperthomas requested a review from Copilot May 28, 2025 08:41
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for new peripheral drivers—UART, PWM, and pulse encoder—for the stm32f103-keysking-learning board.

  • Enables PWM and pulse encoder functionality in rtconfig.h.
  • Updates project and board configuration files (Kconfig, .uvprojx, .ewp, CubeMX_Config files) to include new source files and peripheral mappings.
  • Revises the README and CI attachment configurations to document and test the new features.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
rtconfig.h Adds RT_USING_PWM and RT_USING_PULSE_ENCODER macros.
project.uvprojx & project.ewp Updates project file definitions and include paths for added drivers.
board/Kconfig Introduces new configuration options for servo, PWM, and pulse encoder.
CubeMX_Config (stm32f1xx_hal_msp.c, .ioc, etc.) Adjusts HAL initialization and pin mappings for new peripherals.
README.md Updates board peripheral support information.
.config Adjusts BSP configuration settings for new drivers.
.ci/attachconfig/ci.attachconfig.yml Adds attach config entries for servo and pulse encoder devices.

Comment on lines 1393 to 1395
# CONFIG_BSP_USING_UART3 is not set
# CONFIG_BSP_USING_PWM is not set
# CONFIG_BSP_USING_PULSE_ENCODER is not set
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .config file still shows BSP_USING_UART3, BSP_USING_PWM, and BSP_USING_PULSE_ENCODER as disabled, which conflicts with their usage in rtconfig.h and the CI attachment. Please ensure that the configuration defaults are consistent across the files.

Suggested change
# CONFIG_BSP_USING_UART3 is not set
# CONFIG_BSP_USING_PWM is not set
# CONFIG_BSP_USING_PULSE_ENCODER is not set
CONFIG_BSP_USING_UART3=y
CONFIG_BSP_USING_PWM=y
CONFIG_BSP_USING_PULSE_ENCODER=y

Copilot uses AI. Check for mistakes.
select BSP_USING_UART
select BSP_USING_UART2
default y
config BSP_USING_SERVO
Copy link

Copilot AI May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The servo configuration defaults to disabled (default n) in Kconfig, yet the CI attach configuration forces CONFIG_BSP_USING_SERVO to y. Please review and align the defaults across configurations.

Copilot uses AI. Check for mistakes.
@supperthomas
Copy link
Member

.config 删除,不用提交。

@QianJiu05
Copy link
Contributor Author

.config 删除,不用提交。

你好 删除了好像过不了ci是没问题的吗😭

@supperthomas
Copy link
Member

.config 删除,不用提交。

你好 删除了好像过不了ci是没问题的吗😭

不是说让你删除,是让你不要提交,你恢复到上一个版本即可,你看你的PR里面不要有.config的修改。

@Rbb666
Copy link
Member

Rbb666 commented May 29, 2025

.config 删除,不用提交。

你好 删除了好像过不了ci是没问题的吗😭

不用提交.config就行啦

@supperthomas
Copy link
Member

  <<: *scons
  kconfig:
    CONFIG_RT_USING_NANO=y

这个配置名称呢?

system.use_nano:
<<: *scons
kconfig:
CONFIG_RT_USING_NANO=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

配置名呢?

Copy link
Contributor Author

@QianJiu05 QianJiu05 May 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个完整内容是:
system.use_nano:
<<: *scons
kconfig:
CONFIG_RT_USING_NANO=y

是开启use_nano的
效果如下:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nano:
    scons_arg:
      - '--strict'
    kconfig: 
      - CONFIG_RT_USING_NANO=y

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本地有试过:
scons --attach=system.use_nano 生效吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本地试虽然显示成功但是其实没成功,我之前看success了以为没问题了。请问是只有devices开头的命令才会生效吗,我刚才试了一下定义其他类也是失败的

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用这个吧,或者不是必须测的就去掉吧。其他bsp已经测过nano了

nano:
    scons_arg:
      - '--strict'
    kconfig: 
      - CONFIG_RT_USING_NANO=y

@supperthomas
Copy link
Member

image

CI显示你这个nano配置有问题。

system.use_nano:
<<: *scons
kconfig:
CONFIG_RT_USING_NANO=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用这个吧,或者不是必须测的就去掉吧。其他bsp已经测过nano了

nano:
    scons_arg:
      - '--strict'
    kconfig: 
      - CONFIG_RT_USING_NANO=y

@supperthomas
Copy link
Member

yml只需要保留你自己认为该bsp常用的配置即可。

system.use_nano:
<<: *scons
kconfig:
CONFIG_RT_USING_NANO=y
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你这个缺个-号。
image

@supperthomas supperthomas added the +1 Agree +1 label May 29, 2025
@QianJiu05
Copy link
Contributor Author

yml只需要保留你自己认为该bsp常用的配置即可。

明白了🌹

@supperthomas supperthomas merged commit 2cf2161 into RT-Thread:master May 29, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: STM32 BSP related with ST/STM32 BSP +1 Agree +1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants