修复STM32MCU在不同优化级别使用rt_kprintf函数输出异常的问题 #10634
Open
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