Skip to content

stm32h7r7-atk bsp #10363

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

Closed
wants to merge 5 commits into from
Closed

stm32h7r7-atk bsp #10363

wants to merge 5 commits into from

Conversation

Wenshan-736
Copy link

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

[

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

在学习rtthread,想要尝试做一个开发板的bsp检验自己的学习成果,bsp制作参考了artpi2

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

使用正点原子的stm32h7r7的开发板,在把artpi2的部分外设适配到这块开发板的基础上,修改了drv-eth和drv-fdcan相关的文件,使其可以在stm32h7r7上使用,如果不出意外,如果有artpi2的扩展板应该也可以使用。
我仿照其他bsp的格式修改了工程目录,经过测试rtthread studio和mkd5可以编译成功。第一次学习制作bsp和使用git,如果有什么做的不完善的地方,希望能谅解

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

https://club.rt-thread.org/ask/article/dd2287595c084d23.html
https://club.rt-thread.org/ask/article/01790de1d3e7af50.html

]

当前拉取/合并请求的状态 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自查

@CLAassistant
Copy link

CLAassistant commented Jun 4, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added BSP: STM32 BSP related with ST/STM32 BSP labels Jun 4, 2025
@supperthomas supperthomas requested a review from Copilot June 5, 2025 01:17
@supperthomas supperthomas added the BSP: new bsp board New added bsp, need sync action label Jun 5, 2025
Copy link
Contributor

@Copilot 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 introduces a new BSP for the STM32H7r7-atk development board by adapting peripheral drivers from the artpi2 BSP and modifying key drivers such as drv-eth and drv-fdcan. Key changes include the addition of board support files (e.g. drv_mpu.c, board.h, board.c), RT-Thread build scripts (SConstruct, SConscript), and comprehensive configuration and documentation files (CubeMX_Config, README.md, Kconfig) to support both MDK/IAR/GCC environments.

Reviewed Changes

Copilot reviewed 110 out of 110 changed files in this pull request and generated 1 comment.

File Description
bsp/stm32/stm32h7r7-atk/board/drv_mpu.c Adds initialization for the MPU and configures memory regions.
bsp/stm32/stm32h7r7-atk/board/board.h Defines chip configurations, clock, and memory layout; documentation comments present.
bsp/stm32/stm32h7r7-atk/applications/main.c Implements a simple LED blink application and a VTOR relocation.
All build script and project configuration files Adds necessary scripts and configuration to support RT-Thread build.
Comments suppressed due to low confidence (1)

bsp/stm32/stm32h7r7-atk/board/board.h:1

  • The memory layout comment in board.h shows address ranges where the high address of the first two regions appears lower than their corresponding base addresses. Please verify and update the memory ranges (for example, changing '0x23071FFF' to '0x24071FFF' if appropriate) to correctly reflect the physical memory layout.
/*
 * @brief H7RS7 SRAM MEMORY Layout
 * 0x24060000 - 0x23071FFF AXI SRAM shared with ECC
 * 0x24040000 - 0x2305FFFF AXI SRAM shared with DTCM
 * 0x24020000 - 0x2403FFFF AXI SRAM
 * 0x24000000 - 0x2401FFFF AXI SRAM shared with ITCM
 */

{
rt_uint32_t count = 1;

while(count++)
Copy link
Preview

Copilot AI Jun 5, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using an infinite loop like 'while(1)' instead of 'while(count++)' for clarity since the purpose is to blink the LED continuously without relying on the incremented counter.

Suggested change
while(count++)
while(1)

Copilot uses AI. Check for mistakes.

@supperthomas
Copy link
Member

请参考其他bsp,清理多余的中间文件

@supperthomas
Copy link
Member

如果是新增bsp, 已经添加ci检查到.github/workflows/bsp_buildings.yml 详细请参考链接BSP自查

@Wenshan-736 Wenshan-736 requested a review from supperthomas as a code owner June 5, 2025 04:59
Copy link

github-actions bot commented Jun 5, 2025

📌 Code Review Assignment

🏷️ Tag: workflow

Path: .github
Reviewers: supperthomas Rbb666 kurisaW

Changed Files (Click to expand)
  • .github/ALL_BSP_COMPILE.json

📊 Current Review Status (Last Updated: 2025-06-05 06:58 UTC)

  • Rbb666 Pending Review
  • kurisaW Pending Review
  • supperthomas 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 the action github action yml imporve label Jun 5, 2025
CONFIG_RT_NAME_MAX=8
# CONFIG_RT_USING_ARCH_DATA_TYPE is not set
# CONFIG_RT_USING_SMART is not set
# CONFIG_RT_USING_NANO is not set
Copy link
Member

Choose a reason for hiding this comment

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

多余文件

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>

<component_viewer schemaVersion="0.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="Component_Viewer.xsd">
Copy link
Member

Choose a reason for hiding this comment

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

多余

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32H7RSxx_IT_H
#define __STM32H7RSxx_IT_H

Copy link
Member

Choose a reason for hiding this comment

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

多余

/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "stm32h7rsxx_it.h"
/* Private includes ----------------------------------------------------------*/
Copy link
Member

Choose a reason for hiding this comment

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

多余

*
* - SystemCoreClock variable: Contains the core clock (sys_cpu_ck), it can
* be used by the user application to setup the
* SysTick timer or configure other parameters.
Copy link
Member

Choose a reason for hiding this comment

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

多余

"aa2g=1" "\x00"
"ccode=ALL"
"\x00"
//#Antenna diversity
Copy link
Member

Choose a reason for hiding this comment

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

这些有测过吗?没有测过的,暂时都删掉

@@ -0,0 +1 @@
[{"config_name":"Debug","exclude_files":[]}]
Copy link
Member

Choose a reason for hiding this comment

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

删除

@supperthomas
Copy link
Member

image

@supperthomas
Copy link
Member

CI问题处理一下

#endif

#ifdef BSP_USING_FDCAN2
static _stm32_fdcan_t st_DrvCan2 = {0};
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进行编译,参考rt-spark bsp

Copy link
Author

@Wenshan-736 Wenshan-736 Jun 5, 2025

Choose a reason for hiding this comment

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

文件功能测试过https://club.rt-thread.org/ask/article/dd2287595c084d23.html


https://club.rt-thread.org/ask/article/01790de1d3e7af50.html


但是fdcan2现在的板子上没有,本来是打算之后画扩展板用,现在是要先把这部分删了吗?
这个yml文件有没有介绍,下面画框的地方不知道格式该怎么写,这个名字要和配置项对应吗。这个文件是要是把.config里面的配置项放进来吗
image

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
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

先把CI问题解决了吧。再加yml

Copy link
Member

Choose a reason for hiding this comment

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

你可以一点点的来,先根据其他bsp先亮个小灯,提个pr。其他的先不提交。先试试比如stm32f103 blue pill怎么使用的。这个可以直接keil模拟器运行。然后提交个最小工程。其他文件后面慢慢提交。一下子步子太大,也容易出错

Copy link
Author

@Wenshan-736 Wenshan-736 Jun 6, 2025

Choose a reason for hiding this comment

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

好,这两天真麻烦你了。我找时间去仔细学一下这些东西。那我这个pr是先在这里挂着,我后面改完了继续提交到这里面,还是先删掉

Copy link
Member

Choose a reason for hiding this comment

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

再建个分支提交PR就可以了

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
Author

Choose a reason for hiding this comment

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

哦哦好的,麻烦你了

@supperthomas supperthomas marked this pull request as draft June 6, 2025 06:41
@supperthomas
Copy link
Member

#10364

可以参考一下这个pr

@supperthomas
Copy link
Member

先close了,后续修改之后再提交。

@Wenshan-736
Copy link
Author

Wenshan-736 commented Jun 11, 2025

嗯,最近期末周了没时间弄这些了,我过些天再弄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action github action yml imporve BSP: new bsp board New added bsp, need sync action BSP: STM32 BSP related with ST/STM32 BSP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants