Skip to content

[bsp]bluepill readme补充flash描述,整理attachconfig为yml #10396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 16, 2025

Conversation

QianJiu05
Copy link
Contributor

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

[

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

之前提交过一份相关pr,不过由于64kb太小导致程序容易超过限制close了。前天有管理员回复,可以在readme里增加提醒。
此外,顺便整理了attachconfig为yml。
#10258 (comment)
image

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

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

  • BSP:
  • .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自查

@QianJiu05 QianJiu05 requested a review from mysterywolf as a code owner June 15, 2025 15:41
Copy link

github-actions bot commented Jun 15, 2025

📌 Code Review Assignment

🏷️ Tag: bsp_stm32

Path: bsp/stm32
Reviewers: wdfk-prog

Changed Files (Click to expand)
  • bsp/stm32/stm32f103-blue-pill/.ci/attachconfig/ci.attachconfig.yml
  • bsp/stm32/stm32f103-blue-pill/.ci/attachconfig/nano.attach
  • bsp/stm32/stm32f103-blue-pill/.ci/attachconfig/rtduino.attach
  • bsp/stm32/stm32f103-blue-pill/README_zh.md

📊 Current Review Status (Last Updated: 2025-06-16 15:30 UTC)

  • wdfk-prog Pending Review

📝 Review Instructions

  1. 维护者可以通过单击此处来刷新审查状态: 🔄 刷新状态
    Maintainers can refresh the review status by clicking here: 🔄 Refresh Status

  2. 确认审核通过后评论 LGTM/lgtm
    Comment LGTM/lgtm after confirming approval

  3. PR合并前需至少一位维护者确认
    PR must be confirmed by at least one maintainer before merging

ℹ️ 刷新CI状态操作需要具备仓库写入权限。
ℹ️ Refresh CI status operation requires repository Write permission.

@github-actions github-actions bot added BSP: STM32 BSP related with ST/STM32 BSP labels Jun 15, 2025
@wdfk-prog
Copy link
Contributor

  • readme可以增加一下风险提示,高64kb或许不够可靠

@kurisaW
Copy link
Member

kurisaW commented Jun 16, 2025

建议所有凡是资源不足以满足标准版的bsp都统一默认修改为nano版本,通过env可一键开启nano版本,并默认支持finsh组件,bsp更多是对rt-thread移植的参考设计,不一定都得上标准版

@QianJiu05
Copy link
Contributor Author

建议所有凡是资源不足以满足标准版的bsp都统一默认修改为nano版本,通过env可一键开启nano版本,并默认支持finsh组件,bsp更多是对rt-thread移植的参考设计,不一定都得上标准版

请问默认开启nano的话,要上传.config吗?还是说像我在yml对nano那样配置就行,让用户自己开启

@kurisaW
Copy link
Member

kurisaW commented Jun 16, 2025

.config和rtconfig.h都需要上传,另外再使用scons --target=xxx同步一下mdk或iar,此外请给出修改后的运行截图

@kurisaW
Copy link
Member

kurisaW commented Jun 16, 2025

请将提交信息通过rebase压缩成一个commit

@QianJiu05
Copy link
Contributor Author

请将提交信息通过rebase压缩成一个commit

这个是从修改nano开始压缩吗

@wdfk-prog
Copy link
Contributor

请将提交信息通过rebase压缩成一个commit

这个是从修改nano开始压缩吗

  • 这个pr的多个commit整合成一个commit就好了.
  • 这个pr没必要多个commit提交

@QianJiu05
Copy link
Contributor Author

建议所有凡是资源不足以满足标准版的bsp都统一默认修改为nano版本,通过env可一键开启nano版本,并默认支持finsh组件,bsp更多是对rt-thread移植的参考设计,不一定都得上标准版

你好,我有一个问题:nano版本下device不可用,那么finsh对应的串口是通过hal库驱动吗?这种情况下是不是要在board.c 添加初始化

@kurisaW
Copy link
Member

kurisaW commented Jun 16, 2025

可以看一下这个目录下的文件:

这里其实是使用的RT_CONSOLE_DEVICE_NAME去作为nano的串口设备,但其实并不使用驱动框架和uart的设备驱动,也不需要执行任何初始化,主线支持一键开启nano,只需要确保使用cubemx生成对应的串口初始化代码就可以了,作者修改完成之后请附上控制台终端运行成功的截图

@QianJiu05
Copy link
Contributor Author

可以看一下这个目录下的文件:

这里其实是使用的RT_CONSOLE_DEVICE_NAME去作为nano的串口设备,但其实并不使用驱动框架和uart的设备驱动,也不需要执行任何初始化,主线支持一键开启nano,只需要确保使用cubemx生成对应的串口初始化代码就可以了,作者修改完成之后请附上控制台终端运行成功的截图

您好,我遇到一个问题:
我在其他配置都没开启的情况下单独打开nano,程序卡死,debug发现卡在rt_hw_hard_fault_exception,查阅文档发现是启动入口不对。
原启动文件并没有entry和main,我手动在SystemInit后面加上bl entry,程序卡在rt_assert_set_hook的while (dummy == 0);注释掉这一句之后依然卡在rt_hw_hard_fault_exception

我在网上查找不到如何解决这个问题,抱歉麻烦您了

以下是参考文档:
GCC 下的启动文件需要修改,让其跳转到 RT-Thread 提供的 entry() 函数,其中 entry() 函数调用了 RT-Thread 系统启动函数 rtthread_startup()。
image
image

@wdfk-prog
Copy link
Contributor

可以看一下这个目录下的文件:

这里其实是使用的RT_CONSOLE_DEVICE_NAME去作为nano的串口设备,但其实并不使用驱动框架和uart的设备驱动,也不需要执行任何初始化,主线支持一键开启nano,只需要确保使用cubemx生成对应的串口初始化代码就可以了,作者修改完成之后请附上控制台终端运行成功的截图

您好,我遇到一个问题: 我在其他配置都没开启的情况下单独打开nano,程序卡死,debug发现卡在rt_hw_hard_fault_exception,查阅文档发现是启动入口不对。 原启动文件并没有entry和main,我手动在SystemInit后面加上bl entry,程序卡在rt_assert_set_hook的while (dummy == 0);注释掉这一句之后依然卡在rt_hw_hard_fault_exception

我在网上查找不到如何解决这个问题,抱歉麻烦您了

以下是参考文档: GCC 下的启动文件需要修改,让其跳转到 RT-Thread 提供的 entry() 函数,其中 entry() 函数调用了 RT-Thread 系统启动函数 rtthread_startup()。 image image

原启动文件并没有entry和main,我手动在SystemInit后面加上bl entry,程序卡在rt_assert_set_hook的while (dummy == 0);注释掉这一句之后依然卡在rt_hw_hard_fault_exception

  • 检查你的gcc的链接脚本(.lds)文件,正常的链接脚本系统入口函数从Reset_Handler函数开始,执行到entry入口处,进而执行RTT初始化程序.
  • 你的gcc链接脚本应该是使用了HAL库提供的链接脚本了,请查找替换一下
    例如:
    .section .text.Reset_Handler
    .weak Reset_Handler
    .type Reset_Handler, %function
    Reset_Handler:
    /* Copy the data segment initializers from flash to SRAM */
    ldr r0, =_sdata
    ldr r1, =_edata
    ldr r2, =_sidata
    movs r3, #0
    b LoopCopyDataInit
    CopyDataInit:
    ldr r4, [r2, r3]
    str r4, [r0, r3]
    adds r3, r3, #4
    LoopCopyDataInit:
    adds r4, r0, r3
    cmp r4, r1
    bcc CopyDataInit
    /* Zero fill the bss segment. */
    ldr r2, =_sbss
    ldr r4, =_ebss
    movs r3, #0
    b LoopFillZerobss
    FillZerobss:
    str r3, [r2]
    adds r2, r2, #4
    LoopFillZerobss:
    cmp r2, r4
    bcc FillZerobss
    /* Call the clock system intitialization function.*/
    bl SystemInit
    /* Call static constructors */
    bl __libc_init_array
    /* Call the application's entry point.*/
    bl entry
    bx lr
    .size Reset_Handler, .-Reset_Handler

@QianJiu05
Copy link
Contributor Author

  • /* Call the clock system intitialization function.*/

我这里调用的是拉取的packages里面的启动文件,不是hal库提供的呀?:
[1/2] Building ASM object CMakeFiles/rtt_STM32F1-CMSIS.dir/packages/stm32f1_cmsis_driver-latest/Source/Templates/gcc/startup_stm32f103xb.s.obj
[2/2] Linking C executable rtthread.elf

@mysterywolf
Copy link
Member

不建议这个板子主动开启nano version,用户有需求自己手动配置。这个板子有一些配置是按照标准版配置的 @kurisaW
@heyQianJiu 辛苦最后一个commit revert掉 默认开启nano和终端 其他的commit我没有问题

@mysterywolf
Copy link
Member

mysterywolf commented Jun 16, 2025

如果不知道怎么revert的话 我来处理一下就行 辛苦了 折腾了一下

@QianJiu05
Copy link
Contributor Author

如果不知道怎么revert的话 我来处理一下就行 辛苦了 折腾了一下

最后一个commit我修改了yml,我把这个revert一下重新弄吧

@mysterywolf
Copy link
Member

谢谢您

@mysterywolf mysterywolf merged commit f35c775 into RT-Thread:master Jun 16, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants