Skip to content

Conversation

@LinuxMint-User
Copy link

Fixes #11036 .

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

[

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

修复 stm32l475-atk-pandora BSP 在开启 DFS 组件后出现的编译错误。错误根因是 drv_qspi.h 中声明的函数指针类型与框架层 struct rt_qspi_device 中定义的类型不一致。

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

采用适配层方案:

  1. 在 BSP 层 (drv_qspi_flash.c) 添加适配器函数,满足驱动层调用约定
  2. 在驱动层 (drv_qspi.c) 进行安全类型转换,对接框架层正确类型
    此方案避免修改公共头文件接口,确保向后兼容。

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

  • BSP: bsp/stm32/stm32l475-atk-pandora
  • .config: 使用默认配置,开启 DFS 组件
  • 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/ALL_BSP_COMPILE.json 详细请参考链接BSP自查

@CLAassistant
Copy link

CLAassistant commented Dec 11, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  • 将目标分支设置为 \ Set the target branch to:master
  • 设置PR number为 \ Set the PR number to:11041
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将自动推送至你的分支。
    The formatted code will be automatically pushed to your branch.

完成后,提交将自动更新至 master 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the master branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions
Copy link

github-actions bot commented Dec 11, 2025

📌 Code Review Assignment

🏷️ Tag: workflow

Reviewers: @Rbb666 @kurisaW @supperthomas

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

📊 Current Review Status (Last Updated: 2025-12-16 14:14 CST)


📝 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 Dec 11, 2025
@LinuxMint-User
Copy link
Author

@mysteryword 您好,麻烦您帮忙审查一下这个关于修复潘多拉BSP编译错误的PR。谢谢!

Copy link
Contributor

@wdfk-prog wdfk-prog left a comment

Choose a reason for hiding this comment

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

LGTM

@LinuxMint-User
Copy link
Author

验证完成:本地编译通过,开发板测试正常,文件系统操作及MSH读写例程均工作良好。

@LinuxMint-User
Copy link
Author

命令行测试

 \ | /
- RT -     Thread Operating System
 / | \     5.3.0 build Dec 14 2025 14:20:59
 2006 - 2024 Copyright by RT-Thread team
[D/drv.qspi] qspi init success!
[I/SFUD] Found a Winbond flash chip. Size is 16777216 bytes.
[I/SFUD] W25Q128 flash device initialized successfully.
[D/drv.qspi] qspi init success!
[I/SFUD] Probe SPI flash W25Q128 by SPI device qspi10 success.
[I/sensor_v2] sensor[tm-aht10] init success
[I/sensor_v2] sensor[hm-aht10] init success
[I/aht10] AHT10(sensor_v2) has been initialized!
[I/aht10] Temperature/Humidity mount cmd:        [sensor probe tm-aht10/hm-aht10]
[I/aht10] Temperature/Humidity read 5 times cmd: [sensor read 5]
file system initialization done!
msh />help
RT-Thread shell commands:
reboot           - Reboot System
pin_sample       - Key LED sample
aht10_sample     - AHT10 temperature and humidity sensor sample
readwrite_sample - File read write sample
pin              - pin [option]
sensor_fifo      - Sensor fifo mode test function
sensor_int       - Sensor interrupt mode test function
sensor_polling   - Sensor polling mode test function
sensor           - sensor test function
sf               - SPI Flash operate.
clear            - clear the terminal screen
version          - show RT-Thread version information
list             - list objects
help             - RT-Thread shell help
ps               - List threads in the system
free             - Show the memory usage in the system
ls               - List information about the FILEs.
cp               - Copy SOURCE to DEST.
mv               - Rename SOURCE to DEST.
cat              - Concatenate FILE(s)
rm               - Remove(unlink) the FILE(s).
cd               - Change the shell working directory.
pwd              - Print the name of the current working directory.
mkdir            - Create the DIRECTORY.
mkfs             - format disk with file system
mount            - mount <device> <mountpoint> <fstype>
umount           - Unmount the mountpoint
df               - disk free
echo             - echo string to file
tail             - Print the last N lines. Usage: tail -n [+]numbers <filename>
backtrace        - print backtrace of a thread

msh />ls
Directory /:
msh />mkdir test
msh />ls
Directory /:
test                 <DIR>                    
msh />cd test
msh /test>echo hello hello.txt
msh /test>cat hello.txt
hello
msh /test>rea
readwrite_sample
msh /test>readwrite_sample
Write string RT-Thread Programmer! to file.txt.
Write 22 bytes to file successfully.
Write file closed.
Read 22 bytes from file: RT-Thread Programmer!
Read file closed.
msh /test>ls
Directory /test:
hello.txt            5                        
msh /test>cd
/test
msh /test>cd ../
msh />ls
Directory /:
test                 <DIR>                    
file.txt             22                       
msh />cat file.txt
RT-Thread Programmer!
msh />

测试例程

#include "file_sample.h"

void readwrite_sample(void)
{
    int fd, size;
    char s[] = "RT-Thread Programmer!", buffer[80];    // 写入 RT-Thread Programmer!

    rt_kprintf("Write string %s to file.txt.\n", s);

    /* 步骤1:以创建和读写模式打开 /file.txt 文件,如果该文件不存在则创建该文件 */
    fd = open("/file.txt", O_WRONLY | O_CREAT);
    if (fd >= 0)
    {
        //1.1 打开文件之后,写入数据
        size = write(fd, s, sizeof(s));
        if (size > 0)
        {
            rt_kprintf("Write %d bytes to file successfully.\n", size);
        }
        else
        {
            rt_kprintf("Write file failed!\n");
        }
        
        //1.1 写完之后,关闭文件
        close(fd);
        rt_kprintf("Write file closed.\n");
    }
    else
    {
        rt_kprintf("Open file for write failed!\n");
        return;
    }

    /* 步骤2,以只读模式打开 /file.txt 文件 */
    fd = open("/file.txt", O_RDONLY);
    if (fd >= 0)
    {
        //2.1 打开文件之后,读出数据
        size = read(fd, buffer, sizeof(buffer) - 1); // 保留一个字节用于字符串结束符
        if (size > 0)
        {
            buffer[size] = '\0'; // 添加字符串结束符
            rt_kprintf("Read %d bytes from file: %s\n", size, buffer);
        }
        else
        {
            rt_kprintf("Read file failed or file is empty!\n");
        }
        
        //2.2 读完之后,关闭文件并打印数据
        close(fd);
        rt_kprintf("Read file closed.\n");
    }
    else
    {
        rt_kprintf("Open file for read failed!\n");
    }
}

@Rbb666
Copy link
Member

Rbb666 commented Dec 15, 2025

建议作者给潘多拉添加下相关驱动的ci编译看护,这样下次有类似问题ci会检测到:

https://github.com/RT-Thread/rt-thread/blob/master/bsp/stm32/stm32f407-rt-spark/.ci/attachconfig/ci.attachconfig.yml

https://club.rt-thread.org/ask/article/5edd0f0940a57129.html

@LinuxMint-User
Copy link
Author

@Rbb666 已添加用于板载QSPI FLASH的qspi-flash.attach文件,依照链接教程,主仓库工作流阻塞无法查看结果,需要维护者准许。

@Rbb666
Copy link
Member

Rbb666 commented Dec 16, 2025

@LinuxMint-User 还请压缩成一个commit提交

LinuxMint-User and others added 16 commits December 16, 2025 13:46
…k-pandora

- Fix function pointer type mismatch between drv_qspi.h and rt_qspi_device
- Add qspi-flash.attach file for CI compilation guard
- Optimize code with macros and inline adapter
- Include all related bug fixes and configuration updates

Fixes: #11036
The old CLK is can't link all hardware clock cell in system that the
API of layout such as 'set_parent' can't work as expected.

Some hareware clock cell need some flags to prevent some dangerous behaviors, eg:
When a clock cell is link to the PMU, the SoC will power-down if the cell is
disable.

The new CLK can do it, and make the CLK drivers implemented easier from
TRM/DataSheet.

Signed-off-by: GuEe-GUI <[email protected]>
…added.

Some comments have been initially added as a bignner task.
components/libc/cplusplus/os/cxx_Semaphore.cpp
components/libc/cplusplus/os/cxx_Thread.cpp
components/libc/cplusplus/utest/tc_atomic.cpp
components/libc/cplusplus/utest/tc_smartptr.cpp
components/libc/cplusplus/utest/tc_thread.cpp

Signed-off-by:Liu Chengtao<[email protected]>
Some ARCH not has std cache ops, such as RISC-V

Signed-off-by: GuEe-GUI <[email protected]>
The clock should init before common platform devices.

Signed-off-by: GuEe-GUI <[email protected]>
…tion, as tracked in issue [#10895](#10895). This leads to high maintenance costs, difficulty for new contributors, and inefficient code reviews.

Solution:
This patch adds the full, standardized documentation block to `sched_mtx_tc.c`, `sched_sem_tc.c`, `sched_thread_tc.c`, `sched_timed_mtx_tc.c` and `sched_timed_sem_tc.c` following the approved template.

The documentation details:
- Test Objectives and tested APIs
- Test Scenarios
- Verification Metrics
- Dependencies
- Test Execution command and Expected Results

This makes the test case's purpose and behavior immediately clear to future maintainers and reviewers.

Relates to [#10895](#10895)

Signed-off-by: lhxj <[email protected]>
1. Add backlight framework for graphic.
2. Add framebuffer and plane, power, EDID for graphic framework
3. Add boot logo render for graphic
4. Update lcd.h

Signed-off-by: GuEe-GUI <[email protected]>
GuEe-GUI and others added 4 commits December 16, 2025 13:54
1. Generic GPIO based backlight driver
2. Generic PWM based backlight driver
3. Simple framebuffer support
4. Standard 224-color RT-Thread logo
5. Standard 224-color RT-Thread white logo

Signed-off-by: GuEe-GUI <[email protected]>
Some SCSI supported parallel_io = RT_TRUE, like UFS.

Signed-off-by: GuEe-GUI <[email protected]>
@LinuxMint-User
Copy link
Author

抱歉,稍后我将重新开一个新的PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[Bug] 开启DFS后正点原子潘多拉板载支持包编译错误