-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
[Bug][serial_v1] 主频较高时可能会导致发送不完整 #9964
Comments
这个问题我感觉还是要改TX_BLOCK_TIMEOUT,实际上在f1 9600波特率也会遇到数据发不完整,在 #9543 我也有提到是否能根据不同的波特率改变TX_BLOCK_TIMEOUT,当时我的解决方法是把TX_BLOCK_TIMEOUT这个宏手动调大了。 |
这个是不是要考虑把TX_BLOCK_TIMEOUT 这个放到Kconfig中,给不同平台适配? |
我觉得既然是stm32 driver里的适配问题,拿hal的api获取一下主频算一下就好了 |
好像确实是只有STM32 driver是这样适配的,当时我有特意看了一下 |
欢迎PR修复一下。 |
主要是有cache、flash等待、art加速器这些因素在我怕算不准😂 |
那就加个Kconfig,每个stm32 自己配一下,默认一个最大值。 |
不过v1是不是用的不多了?都要转V2了?可以试试v2 |
主要看默认config都是v1 |
有下面几个方案,看一下哪个合适
|
RT-Thread Version
master
Hardware Type/Architectures
H730 with internal flash
Develop Toolchain
MDK Keil
Describe the bug
在主频550M,打开优化时,使用rt_kprintf只能打出首字符。
调查发现在stm32的
serial_v1
驱动中,会使用一个较为硬编码(由库中define)的值检查是否发送超时。在主频较高且波特率较低时可能会触发。rt-thread/bsp/stm32/libraries/HAL_Drivers/drivers/drv_usart.c
Lines 344 to 361 in 0cc4dc4
而
rt_kpinrtf
调用_kputs
发送时未处理rt_device_write
的返回值,没有重发。rt-thread/src/kservice.c
Lines 312 to 335 in 0cc4dc4
相关PR:#9543
这个PR把代码改正确了,但是导致了这个问题改回去会导致没发完就接着发中间缺字符🤦♂️Other additional context
No response
The text was updated successfully, but these errors were encountered: