修复STM32MCU在不同优化级别使用rt_kprintf函数输出异常的问题#10634
Closed
ItsGettingWorse wants to merge 1 commit intoRT-Thread:masterfrom
ItsGettingWorse:ItsGettingWorse-patch-1
Closed
修复STM32MCU在不同优化级别使用rt_kprintf函数输出异常的问题#10634ItsGettingWorse wants to merge 1 commit intoRT-Thread:masterfrom ItsGettingWorse:ItsGettingWorse-patch-1
ItsGettingWorse wants to merge 1 commit intoRT-Thread:masterfrom
ItsGettingWorse:ItsGettingWorse-patch-1
Conversation
Fixed bugs under different optimization levels
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2025-08-24 15:11 CST)
📝 Review Instructions
|
Contributor
|
Contributor
|
把block_timeout时间给长一点不行么。 |
Contributor
Author
|
这个问题等有时间在看看把, 感觉汇编里面问题可能比较大. 可以反汇编看看这个问题是否解决了, 优化登记上去之后确实输出是有问题的, 这个问题可以在不同的处理器上进行复现. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed bugs under different optimization levels
拉取/合并请求描述:(PR description)
[
在使用Keil AC6编译STM32H7xx模版库生成STM32H743VI芯片的对应工程的时候,发现默认的AC6编译条件下生成的msh工作不正常。 逐步逐层逐层查询,发现AC6工程使用armclang默认优化等级为'-O1',AC5工程使用armcc默认优化等级为'-O0',不同的优化等级下编译器优化可能会导致新的问题。
发现修改底层函数中,调试状态不正常,15个字符仅处理了第一个字符,与串口现象相符,查看原因是因为UART_FLAG_TC显示完成上述,但寄存器窗口中显示未完成,存在编译器优化问题。
添加数据同步指令后正常.
你的解决方案是什么 (what is your solution)
在对应出错节点添加DSB同步方法.
输出msh>输出不正常 仅输出"m"
msh>输出正常输出"msh>"
请提供验证的bsp和config (provide the config and bsp)
bsp/stm32/stm32h743-armfly-v7
]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up